Google

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 namespace sc {
00041 
00042 // //////////////////////////////////////////////////////////////////////////
00043 
00044 class Integral;
00045 
00049 class TwoBodyInt : public RefCount {
00050   protected:
00051     // this is who created me
00052     Integral *integral_;
00053 
00054     Ref<GaussianBasisSet> bs1_;
00055     Ref<GaussianBasisSet> bs2_;
00056     Ref<GaussianBasisSet> bs3_;
00057     Ref<GaussianBasisSet> bs4_;
00058 
00059     double *buffer_;
00060 
00061     int redundant_;
00062     
00063     TwoBodyInt(Integral *integral,
00064                const Ref<GaussianBasisSet>&bs1,
00065                const Ref<GaussianBasisSet>&bs2,
00066                const Ref<GaussianBasisSet>&bs3,
00067                const Ref<GaussianBasisSet>&bs4);
00068   public:
00069     virtual ~TwoBodyInt();
00070   
00072     int nbasis() const;
00073     
00075 
00076     int nbasis1() const;
00077     int nbasis2() const;
00078     int nbasis3() const;
00079     int nbasis4() const;
00081 
00083     int nshell() const;
00084     
00086 
00087     int nshell1() const;
00088     int nshell2() const;
00089     int nshell3() const;
00090     int nshell4() const;
00092 
00094     Ref<GaussianBasisSet> basis();
00095 
00097 
00098     Ref<GaussianBasisSet> basis1();
00099     Ref<GaussianBasisSet> basis2();
00100     Ref<GaussianBasisSet> basis3();
00101     Ref<GaussianBasisSet> basis4();
00103 
00107     const double * buffer() const;
00108     
00111     virtual void compute_shell(int,int,int,int) = 0;
00112 
00115     virtual int log2_shell_bound(int= -1,int= -1,int= -1,int= -1) = 0;
00116 
00120     int redundant() const { return redundant_; }
00121     void set_redundant(int i) { redundant_ = i; }
00123 
00125     virtual void set_integral_storage(size_t storage);
00126 
00128     Integral *integral() const { return integral_; }
00129 };
00130 
00131 
00132 
00133 // //////////////////////////////////////////////////////////////////////////
00134 
00135 class ShellQuartetIter {
00136   protected:
00137     const double * buf;
00138     double scale_;
00139 
00140     int redund_;
00141     
00142     int e12;
00143     int e34;
00144     int e13e24;
00145 
00146     int index;
00147     
00148     int istart;
00149     int jstart;
00150     int kstart;
00151     int lstart;
00152 
00153     int iend;
00154     int jend;
00155     int kend;
00156     int lend;
00157 
00158     int icur;
00159     int jcur;
00160     int kcur;
00161     int lcur;
00162 
00163     int i_;
00164     int j_;
00165     int k_;
00166     int l_;
00167     
00168   public:
00169     ShellQuartetIter();
00170     virtual ~ShellQuartetIter();
00171 
00172     virtual void init(const double *,
00173                       int, int, int, int,
00174                       int, int, int, int,
00175                       int, int, int, int,
00176                       double, int);
00177 
00178     virtual void start();
00179     virtual void next();
00180 
00181     int ready() const { return icur < iend; }
00182 
00183     int i() const { return i_; }
00184     int j() const { return j_; }
00185     int k() const { return k_; }
00186     int l() const { return l_; }
00187 
00188     int nint() const { return iend*jend*kend*lend; }
00189     
00190     double val() const { return buf[index]*scale_; }
00191 };
00192 
00193 class TwoBodyIntIter {
00194   protected:
00195     Ref<TwoBodyInt> tbi;
00196     ShellQuartetIter sqi;
00197     
00198     int iend;
00199     
00200     int icur;
00201     int jcur;
00202     int kcur;
00203     int lcur;
00204     
00205   public:
00206     TwoBodyIntIter();
00207     TwoBodyIntIter(const Ref<TwoBodyInt>&);
00208 
00209     virtual ~TwoBodyIntIter();
00210     
00211     virtual void start();
00212     virtual void next();
00213 
00214     int ready() const { return (icur < iend); }
00215 
00216     int ishell() const { return icur; }
00217     int jshell() const { return jcur; }
00218     int kshell() const { return kcur; }
00219     int lshell() const { return lcur; }
00220 
00221     virtual double scale() const;
00222 
00223     ShellQuartetIter& current_quartet();
00224 };
00225 
00226 // //////////////////////////////////////////////////////////////////////////
00227 
00231 class TwoBodyDerivInt : public RefCount {
00232   protected:
00233     // this is who created me
00234     Integral *integral_;
00235 
00236     Ref<GaussianBasisSet> bs1_;
00237     Ref<GaussianBasisSet> bs2_;
00238     Ref<GaussianBasisSet> bs3_;
00239     Ref<GaussianBasisSet> bs4_;
00240 
00241     double *buffer_;
00242 
00243     TwoBodyDerivInt(Integral* integral,
00244                     const Ref<GaussianBasisSet>&b1,
00245                     const Ref<GaussianBasisSet>&b2,
00246                     const Ref<GaussianBasisSet>&b3,
00247                     const Ref<GaussianBasisSet>&b4);
00248   public:
00249     virtual ~TwoBodyDerivInt();
00250   
00252     int nbasis() const;
00253 
00255 
00256     int nbasis1() const;
00257     int nbasis2() const;
00258     int nbasis3() const;
00259     int nbasis4() const;
00261 
00263     int nshell() const;
00264 
00266 
00267     int nshell1() const;
00268     int nshell2() const;
00269     int nshell3() const;
00270     int nshell4() const;
00272 
00274     Ref<GaussianBasisSet> basis();
00275 
00277 
00278     Ref<GaussianBasisSet> basis1();
00279     Ref<GaussianBasisSet> basis2();
00280     Ref<GaussianBasisSet> basis3();
00281     Ref<GaussianBasisSet> basis4();
00283 
00287     const double * buffer() const;
00288     
00291     virtual void compute_shell(int,int,int,int,DerivCenters&) = 0;
00292 
00295     virtual int log2_shell_bound(int= -1,int= -1,int= -1,int= -1) = 0;
00296 };
00297 
00298 }
00299 
00300 #endif
00301 
00302 // Local Variables:
00303 // mode: c++
00304 // c-file-style: "ETS"
00305 // End:

Generated at Fri Jan 10 08:14:10 2003 for MPQC 2.1.3 using the documentation package Doxygen 1.2.14.