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_libint2_int2e_h
00033 #define _chemistry_qc_libint2_int2e_h
00034
00035 #include <limits.h>
00036
00037 #include <util/ref/ref.h>
00038 #include <chemistry/qc/basis/basis.h>
00039 #include <chemistry/qc/basis/tbint.h>
00040 #include <chemistry/qc/libint2/bounds.h>
00041
00042 namespace sc {
00043
00044 class Integral;
00045 class Log2Bounds;
00046
00050 class Int2eLibint2: public RefCount {
00051 protected:
00052 Integral *integral_;
00053
00054 Ref<GaussianBasisSet> bs1_;
00055 Ref<GaussianBasisSet> bs2_;
00056 Ref<GaussianBasisSet> bs3_;
00057 Ref<GaussianBasisSet> bs4_;
00058
00059 Ref<Log2Bounds> bounds_;
00060 Ref<MessageGrp> grp_;
00061
00062 GaussianShell *int_shell1_;
00063 GaussianShell *int_shell2_;
00064 GaussianShell *int_shell3_;
00065 GaussianShell *int_shell4_;
00066
00067
00068 int permute_;
00069
00070 int redundant_;
00071
00072
00073
00074 size_t storage_;
00075
00076 size_t storage_used_;
00077
00078 void check_storage_() const;
00079
00080 static size_t storage_required_(const Ref<GaussianBasisSet>& b1,
00081 const Ref<GaussianBasisSet>& b2 = 0,
00082 const Ref<GaussianBasisSet>& b3 = 0,
00083 const Ref<GaussianBasisSet>& b4 = 0);
00084
00085
00086 double *tformbuf_;
00087
00088
00089
00090 void transform_contrquartets_(double *,double *);
00091
00092 void sort_contrquartets_to_shellquartet_(double *,double *);
00093
00094 void permute_target_(double *, double *, int, int, int);
00095 void permute_1234_to_1243_(double *, double *);
00096 void permute_1234_to_2134_(double *, double *);
00097 void permute_1234_to_2143_(double *, double *);
00098 void permute_1234_to_3412_(double *, double *);
00099 void permute_1234_to_3421_(double *, double *);
00100 void permute_1234_to_4312_(double *, double *);
00101 void permute_1234_to_4321_(double *, double *);
00102
00103 void get_nonredundant_ints_(double *, double *, int, int, int);
00104
00105 public:
00106 Int2eLibint2(Integral *,
00107 const Ref<GaussianBasisSet>&,
00108 const Ref<GaussianBasisSet>&,
00109 const Ref<GaussianBasisSet>&,
00110 const Ref<GaussianBasisSet>&,
00111 size_t storage);
00112 ~Int2eLibint2();
00113
00114
00116 void bounds(const Ref<Log2Bounds>&);
00117
00119 void init_storage(size_t);
00121 void done_storage();
00123 size_t storage_used() const { return storage_used_; }
00124
00126 int redundant() const { return redundant_; }
00128 void set_redundant(int flag) { redundant_ = flag; }
00129
00131 int permute() const { return permute_; }
00133 void set_permute(int flag) { permute_ = flag; }
00134
00136 virtual void compute_quartet(int *, int*, int*, int*) =0;
00138 virtual double *buffer(unsigned int) const =0;
00141 virtual int log2_bound(int s1, int s2, int s3, int s4);
00142
00143
00144 Ref<GaussianBasisSet> basis()
00145 {
00146 if (bs1_==bs2_ && bs1_ == bs3_ && bs1_ == bs4_) return bs1_;
00147 return 0;
00148 }
00149 Ref<GaussianBasisSet> basis1() { return bs1_; }
00150 Ref<GaussianBasisSet> basis2() { return bs2_; }
00151 Ref<GaussianBasisSet> basis3() { return bs3_; }
00152 Ref<GaussianBasisSet> basis4() { return bs4_; }
00153
00154 };
00155
00156 }
00157
00158 #endif
00159
00160
00161
00162
00163