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 #ifdef __GNUG__
00029 #pragma interface
00030 #endif
00031
00032 #ifndef _chemistry_qc_mbptr12_moindexspace_h
00033 #define _chemistry_qc_mbptr12_moindexspace_h
00034
00035 #include <vector>
00036 #include <util/ref/ref.h>
00037 #include <util/state/statein.h>
00038 #include <util/state/stateout.h>
00039 #include <math/scmat/abstract.h>
00040 #include <util/state/statein.h>
00041 #include <chemistry/qc/basis/basis.h>
00042
00043 using namespace std;
00044
00045 namespace sc {
00046
00055 class MOIndexSpace : virtual public SavableState {
00056
00057 public:
00058
00060 enum IndexOrder { symmetry = 0, energy = 1, undefined = 2 };
00061
00062 MOIndexSpace(StateIn&);
00080 MOIndexSpace(std::string name, const RefSCMatrix& full_coefs,
00081 const Ref<GaussianBasisSet> basis, const Ref<Integral>& integral,
00082 const vector<int>& offsets, const vector<int>& nmopi,
00083 IndexOrder moorder = symmetry,
00084 const RefDiagSCMatrix& evals = 0);
00090 MOIndexSpace(std::string name, const RefSCMatrix& full_coefs,
00091 const Ref<GaussianBasisSet> basis, const Ref<Integral>& integral,
00092 const RefDiagSCMatrix& evals, int nfzc, int nfzv, IndexOrder moorder = energy);
00095 MOIndexSpace(std::string name, const RefSCMatrix& full_coefs,
00096 const Ref<GaussianBasisSet> basis, const Ref<Integral>& integral);
00097
00100 MOIndexSpace(std::string name, const Ref<MOIndexSpace>& orig_space,
00101 const RefSCMatrix& new_coefs,
00102 const Ref<GaussianBasisSet>& new_basis);
00103 ~MOIndexSpace();
00104
00105 void save_data_state(StateOut&);
00106
00108 const std::string name() const;
00110 const Ref<GaussianBasisSet> basis() const;
00112 Ref<Integral> integral() const;
00114 const RefSCMatrix coefs() const;
00116 const RefDiagSCMatrix evals() const;
00118 vector<int> mosym() const;
00120 IndexOrder moorder() const;
00122 int rank() const;
00124 int full_rank() const;
00126 int nblocks() const;
00128 vector<int> nmo() const;
00130 vector<int> offsets() const;
00132 int to_full_space(const int i) const;
00133
00135 size_t memory_in_use() const;
00136
00138 void print(std::ostream&o=ExEnv::out0()) const;
00140 void print_summary(std::ostream& os) const;
00141
00142 private:
00143 std::string name_;
00144
00145 Ref<GaussianBasisSet> basis_;
00146 Ref<Integral> integral_;
00147 RefSCMatrix coefs_;
00148 RefDiagSCMatrix evals_;
00149 RefSCDimension modim_;
00150 vector<int> mosym_;
00151
00152 int rank_;
00153 int full_rank_;
00154 int nblocks_;
00155 vector<int> nmo_;
00156 vector<int> offsets_;
00157 vector<int> map_to_full_space_;
00158
00159 IndexOrder moorder_;
00160
00161
00162 void check_mosym() const;
00163
00164
00165 void frozen_to_blockinfo(const int nfzc, const int nfzv, const RefDiagSCMatrix& evals);
00166
00167
00168
00169 void full_coefs_to_coefs(const RefSCMatrix& full_coefs, const RefDiagSCMatrix& evals);
00170
00171
00172 void init();
00173
00174
00175 static void dquicksort(double *item,int *index,int n);
00176 static void dqs(double *item,int *index,int left,int right);
00177
00178 };
00179
00180 }
00181
00182 #endif
00183
00184
00185
00186
00187
00188
00189