Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

tbint.h

00001 //
00002 // tbint.h
00003 //
00004 // Copyright (C) 1996 Limit Point Systems, Inc.
00005 //
00006 // Author: Edward Seidl <seidl@janed.com>
00007 // Maintainer: LPS
00008 //
00009 // This file is part of the SC Toolkit.
00010 //
00011 // The SC Toolkit is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Library General Public License as published by
00013 // the Free Software Foundation; either version 2, or (at your option)
00014 // any later version.
00015 //
00016 // The SC Toolkit is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 // GNU Library General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Library General Public License
00022 // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
00023 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00024 //
00025 // The U.S. Government is granted a limited license as per AL 91-7.
00026 //
00027 
00028 #ifndef _chemistry_qc_basis_tbint_h
00029 #define _chemistry_qc_basis_tbint_h
00030 
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034 
00035 #include <util/ref/ref.h>
00036 #include <util/group/message.h>
00037 #include <chemistry/qc/basis/gaussbas.h>
00038 #include <chemistry/qc/basis/dercent.h>
00039 
00040 // //////////////////////////////////////////////////////////////////////////
00041 
00042 class Integral;
00043 
00047 class TwoBodyInt : public RefCount {
00048   protected:
00049     // this is who created me
00050     Integral *integral_;
00051 
00052     Ref<GaussianBasisSet> bs1_;
00053     Ref<GaussianBasisSet> bs2_;
00054     Ref<GaussianBasisSet> bs3_;
00055     Ref<GaussianBasisSet> bs4_;
00056 
00057     double *buffer_;
00058 
00059     int redundant_;
00060     
00061     TwoBodyInt(Integral *integral,
00062                const Ref<GaussianBasisSet>&bs1,
00063                const Ref<GaussianBasisSet>&bs2,
00064                const Ref<GaussianBasisSet>&bs3,
00065                const Ref<GaussianBasisSet>&bs4);
00066   public:
00067     virtual ~TwoBodyInt();
00068   
00070     int nbasis() const;
00071     
00073 
00074     int nbasis1() const;
00075     int nbasis2() const;
00076     int nbasis3() const;
00077     int nbasis4() const;
00079 
00081     int nshell() const;
00082     
00084 
00085     int nshell1() const;
00086     int nshell2() const;
00087     int nshell3() const;
00088     int nshell4() const;
00090 
00092     Ref<GaussianBasisSet> basis();
00093 
00095 
00096     Ref<GaussianBasisSet> basis1();
00097     Ref<GaussianBasisSet> basis2();
00098     Ref<GaussianBasisSet> basis3();
00099     Ref<GaussianBasisSet> basis4();
00101 
00105     const double * buffer() const;
00106     
00109     virtual void compute_shell(int,int,int,int) = 0;
00110 
00113     virtual int log2_shell_bound(int= -1,int= -1,int= -1,int= -1) = 0;
00114 
00118     int redundant() const { return redundant_; }
00119     void set_redundant(int i) { redundant_ = i; }
00121 
00123     virtual void set_integral_storage(int storage);
00124 
00126     Integral *integral() const { return integral_; }
00127 };
00128 
00129 
00130 
00131 // //////////////////////////////////////////////////////////////////////////
00132 
00133 class ShellQuartetIter {
00134   protected:
00135     const double * buf;
00136     double scale_;
00137 
00138     int redund_;
00139     
00140     int e12;
00141     int e34;
00142     int e13e24;
00143 
00144     int index;
00145     
00146     int istart;
00147     int jstart;
00148     int kstart;
00149     int lstart;
00150 
00151     int iend;
00152     int jend;
00153     int kend;
00154     int lend;
00155 
00156     int icur;
00157     int jcur;
00158     int kcur;
00159     int lcur;
00160 
00161     int i_;
00162     int j_;
00163     int k_;
00164     int l_;
00165     
00166   public:
00167     ShellQuartetIter();
00168     virtual ~ShellQuartetIter();
00169 
00170     virtual void init(const double *,
00171                       int, int, int, int,
00172                       int, int, int, int,
00173                       int, int, int, int,
00174                       double, int);
00175 
00176     virtual void start();
00177     virtual void next();
00178 
00179     int ready() const { return icur < iend; }
00180 
00181     int i() const { return i_; }
00182     int j() const { return j_; }
00183     int k() const { return k_; }
00184     int l() const { return l_; }
00185 
00186     int nint() const { return iend*jend*kend*lend; }
00187     
00188     double val() const { return buf[index]*scale_; }
00189 };
00190 
00191 class TwoBodyIntIter {
00192   protected:
00193     Ref<TwoBodyInt> tbi;
00194     ShellQuartetIter sqi;
00195     
00196     int iend;
00197     
00198     int icur;
00199     int jcur;
00200     int kcur;
00201     int lcur;
00202     
00203   public:
00204     TwoBodyIntIter();
00205     TwoBodyIntIter(const Ref<TwoBodyInt>&);
00206 
00207     virtual ~TwoBodyIntIter();
00208     
00209     virtual void start();
00210     virtual void next();
00211 
00212     int ready() const { return (icur < iend); }
00213 
00214     int ishell() const { return icur; }
00215     int jshell() const { return jcur; }
00216     int kshell() const { return kcur; }
00217     int lshell() const { return lcur; }
00218 
00219     virtual double scale() const;
00220 
00221     ShellQuartetIter& current_quartet();
00222 };
00223 
00224 // //////////////////////////////////////////////////////////////////////////
00225 
00229 class TwoBodyDerivInt : public RefCount {
00230   protected:
00231     // this is who created me
00232     Integral *integral_;
00233 
00234     Ref<GaussianBasisSet> bs1_;
00235     Ref<GaussianBasisSet> bs2_;
00236     Ref<GaussianBasisSet> bs3_;
00237     Ref<GaussianBasisSet> bs4_;
00238 
00239     double *buffer_;
00240 
00241     TwoBodyDerivInt(Integral* integral,
00242                     const Ref<GaussianBasisSet>&b1,
00243                     const Ref<GaussianBasisSet>&b2,
00244                     const Ref<GaussianBasisSet>&b3,
00245                     const Ref<GaussianBasisSet>&b4);
00246   public:
00247     virtual ~TwoBodyDerivInt();
00248   
00250     int nbasis() const;
00251 
00253 
00254     int nbasis1() const;
00255     int nbasis2() const;
00256     int nbasis3() const;
00257     int nbasis4() const;
00259 
00261     int nshell() const;
00262 
00264 
00265     int nshell1() const;
00266     int nshell2() const;
00267     int nshell3() const;
00268     int nshell4() const;
00270 
00272     Ref<GaussianBasisSet> basis();
00273 
00275 
00276     Ref<GaussianBasisSet> basis1();
00277     Ref<GaussianBasisSet> basis2();
00278     Ref<GaussianBasisSet> basis3();
00279     Ref<GaussianBasisSet> basis4();
00281 
00285     const double * buffer() const;
00286     
00289     virtual void compute_shell(int,int,int,int,DerivCenters&) = 0;
00290 
00293     virtual int log2_shell_bound(int= -1,int= -1,int= -1,int= -1) = 0;
00294 };
00295 
00296 
00297 
00298 #endif
00299 
00300 // Local Variables:
00301 // mode: c++
00302 // c-file-style: "ETS"
00303 // End:

Generated at Thu Oct 4 18:08:47 2001 for MPQC 2.0.0 using the documentation package Doxygen 1.2.5.