00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _chemistry_qc_basis_orthog_h
00030 #define _chemistry_qc_basis_orthog_h
00031
00032 #include <util/state/state.h>
00033 #include <math/scmat/matrix.h>
00034
00035 namespace sc {
00036
00038 class OverlapOrthog: virtual public SavableState {
00039 public:
00040
00042 enum OrthogMethod { Symmetric=1, Canonical=2, GramSchmidt=3 };
00044 static OrthogMethod default_orthog_method() { return Symmetric; }
00046 static double default_lindep_tol() { return 1e-8; }
00047
00048 private:
00049 int debug_;
00050
00051 RefSCDimension dim_;
00052 RefSCDimension orthog_dim_;
00053
00054
00055
00056 double lindep_tol_;
00057
00058 int nlindep_;
00059
00060 OrthogMethod orthog_method_;
00061
00062 RefSCMatrix orthog_trans_;
00063 RefSCMatrix orthog_trans_inverse_;
00064
00065
00066
00067
00068
00069 double min_orthog_res_;
00070 double max_orthog_res_;
00071
00072 void compute_overlap_eig(RefSCMatrix& overlap_eigvec,
00073 RefDiagSCMatrix& overlap_isqrt_eigval,
00074 RefDiagSCMatrix& overlap_sqrt_eigval);
00075 void compute_symmetric_orthog();
00076 void compute_canonical_orthog();
00077 void compute_gs_orthog();
00078 void compute_orthog_trans();
00079
00080
00081
00082
00083 RefSymmSCMatrix overlap_;
00084 Ref<SCMatrixKit> result_kit_;
00085
00086 public:
00087 OverlapOrthog(OrthogMethod method,
00088 const RefSymmSCMatrix &overlap,
00089 const Ref<SCMatrixKit> &result_kit,
00090 double lindep_tolerance,
00091 int debug = 0);
00092
00093 OverlapOrthog(StateIn&);
00094
00095 virtual ~OverlapOrthog();
00096
00097 void save_data_state(StateOut&);
00098
00099 void reinit(OrthogMethod method,
00100 const RefSymmSCMatrix &overlap,
00101 const Ref<SCMatrixKit> &result_kit,
00102 double lindep_tolerance,
00103 int debug = 0);
00104
00105 double min_orthog_res() const { return min_orthog_res_; }
00106 double max_orthog_res() const { return max_orthog_res_; }
00107
00108 Ref<OverlapOrthog> copy() const;
00109
00111 OrthogMethod orthog_method() const { return orthog_method_; }
00112
00114 double lindep_tol() const { return lindep_tol_; }
00115
00122 RefSCMatrix basis_to_orthog_basis();
00123
00127 RefSCMatrix basis_to_orthog_basis_inverse();
00128
00130 RefSymmSCMatrix overlap_inverse();
00131
00132 RefSCDimension dim();
00133 RefSCDimension orthog_dim();
00134
00138 int nlindep();
00139 };
00140
00141 }
00142
00143 #endif