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 };
00043
00044 private:
00045 int debug_;
00046
00047 RefSCDimension dim_;
00048 RefSCDimension orthog_dim_;
00049
00050
00051
00052 double lindep_tol_;
00053
00054 int nlindep_;
00055
00056 OrthogMethod orthog_method_;
00057
00058 RefSCMatrix orthog_trans_;
00059 RefSCMatrix orthog_trans_inverse_;
00060
00061
00062
00063
00064
00065 double min_orthog_res_;
00066 double max_orthog_res_;
00067
00068 void compute_overlap_eig(RefSCMatrix& overlap_eigvec,
00069 RefDiagSCMatrix& overlap_isqrt_eigval,
00070 RefDiagSCMatrix& overlap_sqrt_eigval);
00071 void compute_symmetric_orthog();
00072 void compute_canonical_orthog();
00073 void compute_gs_orthog();
00074 void compute_orthog_trans();
00075
00076
00077
00078
00079 RefSymmSCMatrix overlap_;
00080 Ref<SCMatrixKit> result_kit_;
00081
00082 public:
00083 OverlapOrthog(OrthogMethod method,
00084 const RefSymmSCMatrix &overlap,
00085 const Ref<SCMatrixKit> &result_kit,
00086 double lindep_tolerance,
00087 int debug = 0);
00088
00089 OverlapOrthog(StateIn&);
00090
00091 virtual ~OverlapOrthog();
00092
00093 void save_data_state(StateOut&);
00094
00095 void reinit(OrthogMethod method,
00096 const RefSymmSCMatrix &overlap,
00097 const Ref<SCMatrixKit> &result_kit,
00098 double lindep_tolerance,
00099 int debug = 0);
00100
00101 double min_orthog_res() const { return min_orthog_res_; }
00102 double max_orthog_res() const { return max_orthog_res_; }
00103
00104 Ref<OverlapOrthog> copy() const;
00105
00107 OrthogMethod orthog_method() const { return orthog_method_; }
00108
00110 double lindep_tol() const { return lindep_tol_; }
00111
00118 RefSCMatrix basis_to_orthog_basis();
00119
00123 RefSCMatrix basis_to_orthog_basis_inverse();
00124
00125 RefSCDimension dim();
00126 RefSCDimension orthog_dim();
00127
00131 int nlindep();
00132 };
00133
00134 }
00135
00136 #endif