ERKALE
ERKALE - DFT from Hel
 All Classes Functions Variables Friends Pages
optimize_completeness.h
1 /*
2  * This source code is part of
3  *
4  * E R K A L E
5  * -
6  * HF/DFT from Hel
7  *
8  * Written by Susi Lehtola, 2010-2011
9  * Copyright (c) 2010-2011, Susi Lehtola
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  */
16 
17 #ifndef ERKALE_OPTCOMP
18 #define ERKALE_OPTCOMP
19 
21 #define MINTAU pow(10.0,-5.5)
22 
23 #include "../global.h"
24 #include <armadillo>
25 #include <vector>
26 
27 extern "C" {
28 #include <gsl/gsl_vector.h>
29 }
30 
32 typedef struct {
34  int am;
36  int n;
37 
39  arma::vec scanexp;
40 
42  bool odd;
44  size_t neven;
46  size_t nfull;
48 
50 arma::vec get_exponents(const gsl_vector *x, const completeness_scan_t & p);
51 
53 arma::mat self_overlap(const arma::vec & z, int am);
54 
56 arma::vec completeness_profile(const gsl_vector * x, void * params);
57 
59 double compl_mog(const gsl_vector * x, void * params);
60 
62 void compl_mog_df(const gsl_vector * x, void * params, gsl_vector * g);
63 
65 void compl_mog_fdf(const gsl_vector * x, void * params, double * f, gsl_vector * df);
66 
76 arma::vec optimize_completeness(int am, double min, double max, int Nf, int n=1, bool verbose=true, double *mog=NULL, int nfull=4);
77 
89 arma::vec optimize_completeness_cg(int am, double min, double max, int Nf, int n=1, bool verbose=true, double *mog=NULL, int nfull=4);
90 
103 arma::vec optimize_completeness_simplex(int am, double min, double max, int Nf, int n=1, bool verbose=true, double *mog=NULL, int nfull=4);
104 
106 double maxwidth(int am, double tol, int nexp, int n=1, int nfull=4);
107 
109 arma::vec maxwidth_exps(int am, double tol, int nexp, double & width, int n=1, int nfull=4);
110 
112 arma::vec move_exps(const arma::vec & exps, double start);
113 
115 arma::vec get_exponents(int am, double start, double end, double tol, int n=1, bool verbose=false, int nfull=4);
116 
117 #endif
Parameters for completeness scan.
Definition: optimize_completeness.h:32
int am
Angular momentum of shell to optimize.
Definition: optimize_completeness.h:34
size_t neven
Amount of even-tempered exponents near the center.
Definition: optimize_completeness.h:44
bool odd
Add in exponent at the center?
Definition: optimize_completeness.h:42
int n
Which moment to optimize.
Definition: optimize_completeness.h:36
size_t nfull
Amount of fully optimized exponents at the edges.
Definition: optimize_completeness.h:46
arma::vec scanexp
Scanning exponents to optimize against.
Definition: optimize_completeness.h:39