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_basis_intparams_h
00033 #define _chemistry_qc_basis_intparams_h
00034
00035 #include <vector>
00036 #include <utility>
00037 #include <util/state/state.h>
00038 #include <util/state/statein.h>
00039 #include <util/state/stateout.h>
00040
00041 namespace sc {
00042
00048 class IntParams : virtual public SavableState {
00049 public:
00050 IntParams(unsigned int nparams=0);
00051 IntParams(StateIn&);
00052 virtual ~IntParams();
00053 void save_data_state(StateOut&);
00054
00055 unsigned int nparams() const;
00056
00057 protected:
00058 template <typename T> const T* downcast(const IntParams& p) const {
00059 try {
00060 const T& voidref = dynamic_cast<const T&>(p);
00061 return &voidref;
00062 }
00063 catch (std::bad_cast&) { return 0; }
00064 }
00065
00066 private:
00067 unsigned int nparams_;
00068
00069 friend bool operator==(const IntParams& p1, const IntParams& p2);
00070 virtual bool equiv(const IntParams& other) const =0;
00071 };
00072 inline bool operator==(const IntParams& p1, const IntParams& p2) {
00073 return p1.equiv(p2);
00074 }
00075
00077 class IntParamsVoid : public IntParams {
00078 public:
00079 IntParamsVoid();
00080 IntParamsVoid(StateIn&);
00081 ~IntParamsVoid();
00082 void save_data_state(StateOut&);
00083 private:
00084 bool equiv(const IntParams& other) const;
00085 };
00086
00088 class IntParamsG12 : public IntParams {
00089 public:
00091 typedef std::pair<double,double> PrimitiveGeminal;
00092 typedef std::vector<PrimitiveGeminal> ContractedGeminal;
00094 static ContractedGeminal zero_exponent_geminal;
00096 static ContractedGeminal null_geminal;
00097
00099 IntParamsG12(const ContractedGeminal& bra);
00101 IntParamsG12(const ContractedGeminal& bra,
00102 const ContractedGeminal& ket);
00103 IntParamsG12(StateIn&);
00104 ~IntParamsG12();
00105
00106 void save_data_state(StateOut&);
00107
00108 const ContractedGeminal& bra() const;
00109 const ContractedGeminal& ket() const;
00110
00111 static PrimitiveGeminal product(const PrimitiveGeminal& A,
00112 const PrimitiveGeminal& B);
00113 static ContractedGeminal product(const ContractedGeminal& A,
00114 const ContractedGeminal& B);
00115
00116 private:
00117 bool equiv(const IntParams& other) const;
00118
00120 static double null_exponent;
00121
00122 ContractedGeminal bra_;
00123 ContractedGeminal ket_;
00124 };
00125
00127 class IntParamsGenG12 : public IntParams {
00128 public:
00130 typedef std::pair<std::pair<double,double>, double> PrimitiveGeminal;
00131 typedef std::vector<PrimitiveGeminal> ContractedGeminal;
00133 static ContractedGeminal zero_exponent_geminal;
00135 static ContractedGeminal null_geminal;
00136
00138 IntParamsGenG12(const ContractedGeminal& bra);
00142 IntParamsGenG12(const ContractedGeminal& bra,
00143 const ContractedGeminal& ket);
00144 IntParamsGenG12(StateIn&);
00145 ~IntParamsGenG12();
00146 void save_data_state(StateOut&);
00147
00148 const ContractedGeminal& bra() const;
00149 const ContractedGeminal& ket() const;
00150
00151 private:
00152 bool equiv(const IntParams& other) const;
00153
00155 static double null_exponent;
00156
00157 ContractedGeminal bra_;
00158 ContractedGeminal ket_;
00159 };
00160
00161
00162 }
00163
00164 #endif
00165
00166
00167
00168
00169