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_cints_int2e_h
00033
#define _chemistry_qc_cints_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
00041
namespace sc {
00042
00043
class Integral;
00044
00048 class Int2eCints:
public RefCount {
00049
protected:
00050
Integral *integral_;
00051
00052
Ref<GaussianBasisSet> bs1_;
00053
Ref<GaussianBasisSet> bs2_;
00054
Ref<GaussianBasisSet> bs3_;
00055
Ref<GaussianBasisSet> bs4_;
00056
00057
Ref<MessageGrp> grp_;
00058
00059
GaussianShell *int_shell1_;
00060
GaussianShell *int_shell2_;
00061
GaussianShell *int_shell3_;
00062
GaussianShell *int_shell4_;
00063
00064
00065
int permute_;
00066
00067
int redundant_;
00068
00069
00070
00071 size_t storage_;
00072
00073 size_t storage_used_;
00074
00075
void check_storage_()
const;
00076
00077
static size_t storage_required_(
const Ref<GaussianBasisSet>& b1,
00078
const Ref<GaussianBasisSet>& b2 = 0,
00079
const Ref<GaussianBasisSet>& b3 = 0,
00080
const Ref<GaussianBasisSet>& b4 = 0);
00081
00082
00083
double *tformbuf_;
00084
00085
00086
00087
void transform_contrquartets_(
double *,
double *);
00088
00089
void sort_contrquartets_to_shellquartet_(
double *,
double *);
00090
00091
void permute_target_(
double *,
double *,
int,
int,
int);
00092
void permute_1234_to_1243_(
double *,
double *);
00093
void permute_1234_to_2134_(
double *,
double *);
00094
void permute_1234_to_2143_(
double *,
double *);
00095
void permute_1234_to_3412_(
double *,
double *);
00096
void permute_1234_to_3421_(
double *,
double *);
00097
void permute_1234_to_4312_(
double *,
double *);
00098
void permute_1234_to_4321_(
double *,
double *);
00099
00100
void get_nonredundant_ints_(
double *,
double *,
int,
int,
int);
00101
00102
public:
00103
Int2eCints(
Integral *,
00104
const Ref<GaussianBasisSet>&,
00105
const Ref<GaussianBasisSet>&,
00106
const Ref<GaussianBasisSet>&,
00107
const Ref<GaussianBasisSet>&,
00108 size_t storage);
00109 ~
Int2eCints();
00110
00112
void init_storage(size_t);
00114
void done_storage();
00116 size_t
storage_used()
const {
return storage_used_; }
00117
00119 int redundant()
const {
return redundant_; }
00121 void set_redundant(
int flag) { redundant_ = flag; }
00122
00124 int permute()
const {
return permute_; }
00126 void set_permute(
int flag) { permute_ = flag; }
00127
00129
virtual void compute_quartet(
int *,
int*,
int*,
int*) =0;
00131
virtual double *buffer(TwoBodyInt::tbint_type = TwoBodyInt::eri)
const =0;
00132
00133
Ref<GaussianBasisSet> basis()
00134 {
00135
if (bs1_==bs2_ && bs1_ == bs3_ && bs1_ == bs4_)
return bs1_;
00136
return 0;
00137 }
00138 Ref<GaussianBasisSet> basis1() {
return bs1_; }
00139 Ref<GaussianBasisSet> basis2() {
return bs2_; }
00140 Ref<GaussianBasisSet> basis3() {
return bs3_; }
00141 Ref<GaussianBasisSet> basis4() {
return bs4_; }
00142
00143 };
00144
00145 }
00146
00147
#endif
00148
00149
00150
00151
00152