- Main Page
- Classes
- Files
- 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     int nbasis1() const;
    00077     int nbasis2() const;
    00079     int nbasis3() const;
    00081     int nbasis4() const;
    00082
    00084     int nshell() const;
    00085
    00087     int nshell1() const;
    00089     int nshell2() const;
    00091     int nshell3() const;
    00093     int nshell4() const;
    00094
    00096     Ref<GaussianBasisSet> basis();
    00097
    00099     Ref<GaussianBasisSet> basis1();
    00101     Ref<GaussianBasisSet> basis2();
    00103     Ref<GaussianBasisSet> basis3();
    00105     Ref<GaussianBasisSet> basis4();
    00106
    00111     enum tbint_type { eri=0, r12=1, r12t1=2, r12t2=3};
    00113     static const int num_tbint_types = 4;
    00114
    00119     virtual const double * buffer(tbint_type type = eri) const;
    00120
    00124     virtual void compute_shell(int,int,int,int) = 0;
    00125
    00129     virtual int log2_shell_bound(int= -1,int= -1,int= -1,int= -1) = 0;
    00130
    00133     virtual int redundant() const { return redundant_; }
    00135     virtual void set_redundant(int i) { redundant_ = i; }
    00136
    00138     virtual void set_integral_storage(size_t storage);
    00139
    00141     Integral *integral() const { return integral_; }
    00142
    00143 };
    00144
    00145 // //////////////////////////////////////////////////////////////////////////
    00146
    00150 class TwoBodyThreeCenterInt : public RefCount {
    00151   protected:
    00152     // this is who created me
    00153     Integral *integral_;
    00154
    00155     Ref<GaussianBasisSet> bs1_;
    00156     Ref<GaussianBasisSet> bs2_;
    00157     Ref<GaussianBasisSet> bs3_;
    00158
    00159     double *buffer_;
    00160
    00161     int redundant_;
    00162
    00163     TwoBodyThreeCenterInt(Integral *integral,
    00164                           const Ref<GaussianBasisSet>&bs1,
    00165                           const Ref<GaussianBasisSet>&bs2,
    00166                           const Ref<GaussianBasisSet>&bs3);
    00167   public:
    00168     virtual ~TwoBodyThreeCenterInt();
    00169
    00171     int nbasis() const;
    00172
    00174     int nbasis1() const;
    00176     int nbasis2() const;
    00178     int nbasis3() const;
    00179
    00181     int nshell() const;
    00182
    00184     int nshell1() const;
    00186     int nshell2() const;
    00188     int nshell3() const;
    00189
    00191     Ref<GaussianBasisSet> basis();
    00192
    00194     Ref<GaussianBasisSet> basis1();
    00196     Ref<GaussianBasisSet> basis2();
    00198     Ref<GaussianBasisSet> basis3();
    00199
    00204     enum tbint_type { eri=0, r12=1, r12t1=2, r12t2=3};
    00206     static const int num_tbint_types = 4;
    00207
    00212     virtual const double * buffer(tbint_type type = eri) const;
    00213
    00217     virtual void compute_shell(int,int,int) = 0;
    00218
    00222     virtual int log2_shell_bound(int= -1,int= -1,int= -1) = 0;
    00223
    00226     int redundant() const { return redundant_; }
    00228     void set_redundant(int i) { redundant_ = i; }
    00229
    00231     virtual void set_integral_storage(size_t storage);
    00232
    00234     Integral *integral() const { return integral_; }
    00235
    00236 };
    00237
    00238 // //////////////////////////////////////////////////////////////////////////
    00239
    00244 class TwoBodyTwoCenterInt : public RefCount {
    00245   protected:
    00246     // this is who created me
    00247     Integral *integral_;
    00248
    00249     Ref<GaussianBasisSet> bs1_;
    00250     Ref<GaussianBasisSet> bs2_;
    00251
    00252     double *buffer_;
    00253
    00254     int redundant_;
    00255
    00256     TwoBodyTwoCenterInt(Integral *integral,
    00257                         const Ref<GaussianBasisSet>&bs1,
    00258                         const Ref<GaussianBasisSet>&bs2);
    00259   public:
    00260     virtual ~TwoBodyTwoCenterInt();
    00261
    00263     int nbasis() const;
    00264
    00266     int nbasis1() const;
    00268     int nbasis2() const;
    00269
    00271     int nshell() const;
    00272
    00274     int nshell1() const;
    00276     int nshell2() const;
    00277
    00279     Ref<GaussianBasisSet> basis();
    00280
    00282     Ref<GaussianBasisSet> basis1();
    00284     Ref<GaussianBasisSet> basis2();
    00285
    00290     enum tbint_type { eri=0, r12=1, r12t1=2, r12t2=3};
    00292     static const int num_tbint_types = 4;
    00293
    00298     virtual const double * buffer(tbint_type type = eri) const;
    00299
    00303     virtual void compute_shell(int,int) = 0;
    00304
    00308     virtual int log2_shell_bound(int= -1,int= -1) = 0;
    00309
    00312     int redundant() const { return redundant_; }
    00314     void set_redundant(int i) { redundant_ = i; }
    00315
    00317     virtual void set_integral_storage(size_t storage);
    00318
    00320     Integral *integral() const { return integral_; }
    00321
    00322 };
    00323
    00324 // //////////////////////////////////////////////////////////////////////////
    00325
    00326 class ShellQuartetIter {
    00327   protected:
    00328     const double * buf;
    00329     double scale_;
    00330
    00331     int redund_;
    00332
    00333     int e12;
    00334     int e34;
    00335     int e13e24;
    00336
    00337     int index;
    00338
    00339     int istart;
    00340     int jstart;
    00341     int kstart;
    00342     int lstart;
    00343
    00344     int iend;
    00345     int jend;
    00346     int kend;
    00347     int lend;
    00348
    00349     int icur;
    00350     int jcur;
    00351     int kcur;
    00352     int lcur;
    00353
    00354     int i_;
    00355     int j_;
    00356     int k_;
    00357     int l_;
    00358
    00359   public:
    00360     ShellQuartetIter();
    00361     virtual ~ShellQuartetIter();
    00362
    00363     virtual void init(const double *,
    00364                       int, int, int, int,
    00365                       int, int, int, int,
    00366                       int, int, int, int,
    00367                       double, int);
    00368
    00369     virtual void start();
    00370     virtual void next();
    00371
    00372     int ready() const { return icur < iend; }
    00373
    00374     int i() const { return i_; }
    00375     int j() const { return j_; }
    00376     int k() const { return k_; }
    00377     int l() const { return l_; }
    00378
    00379     int nint() const { return iend*jend*kend*lend; }
    00380
    00381     double val() const { return buf[index]*scale_; }
    00382 };
    00383
    00384 class TwoBodyIntIter {
    00385   protected:
    00386     Ref<TwoBodyInt> tbi;
    00387     ShellQuartetIter sqi;
    00388
    00389     int iend;
    00390
    00391     int icur;
    00392     int jcur;
    00393     int kcur;
    00394     int lcur;
    00395
    00396   public:
    00397     TwoBodyIntIter();
    00398     TwoBodyIntIter(const Ref<TwoBodyInt>&);
    00399
    00400     virtual ~TwoBodyIntIter();
    00401
    00402     virtual void start();
    00403     virtual void next();
    00404
    00405     int ready() const { return (icur < iend); }
    00406
    00407     int ishell() const { return icur; }
    00408     int jshell() const { return jcur; }
    00409     int kshell() const { return kcur; }
    00410     int lshell() const { return lcur; }
    00411
    00412     virtual double scale() const;
    00413
    00414     ShellQuartetIter& current_quartet();
    00415 };
    00416
    00417 // //////////////////////////////////////////////////////////////////////////
    00418
    00422 class TwoBodyDerivInt : public RefCount {
    00423   protected:
    00424     // this is who created me
    00425     Integral *integral_;
    00426
    00427     Ref<GaussianBasisSet> bs1_;
    00428     Ref<GaussianBasisSet> bs2_;
    00429     Ref<GaussianBasisSet> bs3_;
    00430     Ref<GaussianBasisSet> bs4_;
    00431
    00432     double *buffer_;
    00433
    00434     TwoBodyDerivInt(Integral* integral,
    00435                     const Ref<GaussianBasisSet>&b1,
    00436                     const Ref<GaussianBasisSet>&b2,
    00437                     const Ref<GaussianBasisSet>&b3,
    00438                     const Ref<GaussianBasisSet>&b4);
    00439   public:
    00440     virtual ~TwoBodyDerivInt();
    00441
    00443     int nbasis() const;
    00444
    00446     int nbasis1() const;
    00448     int nbasis2() const;
    00450     int nbasis3() const;
    00452     int nbasis4() const;
    00453
    00455     int nshell() const;
    00456
    00458     int nshell1() const;
    00460     int nshell2() const;
    00462     int nshell3() const;
    00464     int nshell4() const;
    00465
    00467     Ref<GaussianBasisSet> basis();
    00468
    00470     Ref<GaussianBasisSet> basis1();
    00472     Ref<GaussianBasisSet> basis2();
    00474     Ref<GaussianBasisSet> basis3();
    00476     Ref<GaussianBasisSet> basis4();
    00477
    00481     const double * buffer() const;
    00482
    00485     virtual void compute_shell(int,int,int,int,DerivCenters&) = 0;
    00486
    00489     virtual int log2_shell_bound(int= -1,int= -1,int= -1,int= -1) = 0;
    00490 };
    00491
    00492 // //////////////////////////////////////////////////////////////////////////
    00493
    00497 class TwoBodyThreeCenterDerivInt : public RefCount {
    00498   protected:
    00499     // this is who created me
    00500     Integral *integral_;
    00501
    00502     Ref<GaussianBasisSet> bs1_;
    00503     Ref<GaussianBasisSet> bs2_;
    00504     Ref<GaussianBasisSet> bs3_;
    00505
    00506     double *buffer_;
    00507
    00508     TwoBodyThreeCenterDerivInt(Integral* integral,
    00509                     const Ref<GaussianBasisSet>&b1,
    00510                     const Ref<GaussianBasisSet>&b2,
    00511                     const Ref<GaussianBasisSet>&b3);
    00512   public:
    00513     virtual ~TwoBodyThreeCenterDerivInt();
    00514
    00516     int nbasis() const;
    00517
    00519     int nbasis1() const;
    00521     int nbasis2() const;
    00523     int nbasis3() const;
    00524
    00526     int nshell() const;
    00527
    00529     int nshell1() const;
    00531     int nshell2() const;
    00533     int nshell3() const;
    00534
    00536     Ref<GaussianBasisSet> basis();
    00537
    00539     Ref<GaussianBasisSet> basis1();
    00541     Ref<GaussianBasisSet> basis2();
    00543     Ref<GaussianBasisSet> basis3();
    00544
    00548     const double * buffer() const;
    00549
    00552     virtual void compute_shell(int,int,int,DerivCenters&) = 0;
    00553
    00556     virtual int log2_shell_bound(int= -1,int= -1,int= -1) = 0;
    00557 };
    00558
    00559 // //////////////////////////////////////////////////////////////////////////
    00560
    00564 class TwoBodyTwoCenterDerivInt : public RefCount {
    00565   protected:
    00566     // this is who created me
    00567     Integral *integral_;
    00568
    00569     Ref<GaussianBasisSet> bs1_;
    00570     Ref<GaussianBasisSet> bs2_;
    00571
    00572     double *buffer_;
    00573
    00574     TwoBodyTwoCenterDerivInt(Integral* integral,
    00575                     const Ref<GaussianBasisSet>&b1,
    00576                     const Ref<GaussianBasisSet>&b2);
    00577   public:
    00578     virtual ~TwoBodyTwoCenterDerivInt();
    00579
    00581     int nbasis() const;
    00582
    00584     int nbasis1() const;
    00586     int nbasis2() const;
    00587
    00589     int nshell() const;
    00590
    00592     int nshell1() const;
    00594     int nshell2() const;
    00595
    00597     Ref<GaussianBasisSet> basis();
    00598
    00600     Ref<GaussianBasisSet> basis1();
    00602     Ref<GaussianBasisSet> basis2();
    00603
    00607     const double * buffer() const;
    00608
    00611     virtual void compute_shell(int,int,DerivCenters&) = 0;
    00612
    00615     virtual int log2_shell_bound(int= -1,int= -1) = 0;
    00616 };
    00617
    00618 }
    00619
    00620 #endif
    00621
    00622 // Local Variables:
    00623 // mode: c++
    00624 // c-file-style: "ETS"
    00625 // End: