tbint.h
//
// tbint.h
//
// Copyright (C) 1996 Limit Point Systems, Inc.
//
// Author: Edward Seidl <seidl@janed.com>
// Maintainer: LPS
//
// This file is part of the SC Toolkit.
//
// The SC Toolkit is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// The SC Toolkit is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public License
// along with the SC Toolkit; see the file COPYING.LIB. If not, write to
// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
//
// The U.S. Government is granted a limited license as per AL 91-7.
//
#ifndef _chemistry_qc_basis_tbint_h
#define _chemistry_qc_basis_tbint_h
#ifdef __GNUC__
#pragma interface
#endif
#include <util/ref/ref.h>
#include <util/group/message.h>
#include <chemistry/qc/basis/gaussbas.h>
#include <chemistry/qc/basis/dercent.h>
namespace sc {
// //////////////////////////////////////////////////////////////////////////
class Integral;
class TwoBodyInt : public RefCount {
protected:
// this is who created me
Integral *integral_;
Ref<GaussianBasisSet> bs1_;
Ref<GaussianBasisSet> bs2_;
Ref<GaussianBasisSet> bs3_;
Ref<GaussianBasisSet> bs4_;
double *buffer_;
int redundant_;
TwoBodyInt(Integral *integral,
const Ref<GaussianBasisSet>&bs1,
const Ref<GaussianBasisSet>&bs2,
const Ref<GaussianBasisSet>&bs3,
const Ref<GaussianBasisSet>&bs4);
public:
virtual ~TwoBodyInt();
int nbasis() const;
int nbasis1() const;
int nbasis2() const;
int nbasis3() const;
int nbasis4() const;
int nshell() const;
int nshell1() const;
int nshell2() const;
int nshell3() const;
int nshell4() const;
Ref<GaussianBasisSet> basis();
Ref<GaussianBasisSet> basis1();
Ref<GaussianBasisSet> basis2();
Ref<GaussianBasisSet> basis3();
Ref<GaussianBasisSet> basis4();
enum tbint_type { eri=0, r12=1, r12t1=2, r12t2=3};
static const int num_tbint_types = 4;
virtual const double * buffer(tbint_type type = eri) const;
virtual void compute_shell(int,int,int,int) = 0;
virtual int log2_shell_bound(int= -1,int= -1,int= -1,int= -1) = 0;
virtual int redundant() const { return redundant_; }
virtual void set_redundant(int i) { redundant_ = i; }
virtual void set_integral_storage(size_t storage);
Integral *integral() const { return integral_; }
};
// //////////////////////////////////////////////////////////////////////////
class TwoBodyThreeCenterInt : public RefCount {
protected:
// this is who created me
Integral *integral_;
Ref<GaussianBasisSet> bs1_;
Ref<GaussianBasisSet> bs2_;
Ref<GaussianBasisSet> bs3_;
double *buffer_;
int redundant_;
TwoBodyThreeCenterInt(Integral *integral,
const Ref<GaussianBasisSet>&bs1,
const Ref<GaussianBasisSet>&bs2,
const Ref<GaussianBasisSet>&bs3);
public:
virtual ~TwoBodyThreeCenterInt();
int nbasis() const;
int nbasis1() const;
int nbasis2() const;
int nbasis3() const;
int nshell() const;
int nshell1() const;
int nshell2() const;
int nshell3() const;
Ref<GaussianBasisSet> basis();
Ref<GaussianBasisSet> basis1();
Ref<GaussianBasisSet> basis2();
Ref<GaussianBasisSet> basis3();
enum tbint_type { eri=0, r12=1, r12t1=2, r12t2=3};
static const int num_tbint_types = 4;
virtual const double * buffer(tbint_type type = eri) const;
virtual void compute_shell(int,int,int) = 0;
virtual int log2_shell_bound(int= -1,int= -1,int= -1) = 0;
int redundant() const { return redundant_; }
void set_redundant(int i) { redundant_ = i; }
virtual void set_integral_storage(size_t storage);
Integral *integral() const { return integral_; }
};
// //////////////////////////////////////////////////////////////////////////
class TwoBodyTwoCenterInt : public RefCount {
protected:
// this is who created me
Integral *integral_;
Ref<GaussianBasisSet> bs1_;
Ref<GaussianBasisSet> bs2_;
double *buffer_;
int redundant_;
TwoBodyTwoCenterInt(Integral *integral,
const Ref<GaussianBasisSet>&bs1,
const Ref<GaussianBasisSet>&bs2);
public:
virtual ~TwoBodyTwoCenterInt();
int nbasis() const;
int nbasis1() const;
int nbasis2() const;
int nshell() const;
int nshell1() const;
int nshell2() const;
Ref<GaussianBasisSet> basis();
Ref<GaussianBasisSet> basis1();
Ref<GaussianBasisSet> basis2();
enum tbint_type { eri=0, r12=1, r12t1=2, r12t2=3};
static const int num_tbint_types = 4;
virtual const double * buffer(tbint_type type = eri) const;
virtual void compute_shell(int,int) = 0;
virtual int log2_shell_bound(int= -1,int= -1) = 0;
int redundant() const { return redundant_; }
void set_redundant(int i) { redundant_ = i; }
virtual void set_integral_storage(size_t storage);
Integral *integral() const { return integral_; }
};
// //////////////////////////////////////////////////////////////////////////
class ShellQuartetIter {
protected:
const double * buf;
double scale_;
int redund_;
int e12;
int e34;
int e13e24;
int index;
int istart;
int jstart;
int kstart;
int lstart;
int iend;
int jend;
int kend;
int lend;
int icur;
int jcur;
int kcur;
int lcur;
int i_;
int j_;
int k_;
int l_;
public:
ShellQuartetIter();
virtual ~ShellQuartetIter();
virtual void init(const double *,
int, int, int, int,
int, int, int, int,
int, int, int, int,
double, int);
virtual void start();
virtual void next();
int ready() const { return icur < iend; }
int i() const { return i_; }
int j() const { return j_; }
int k() const { return k_; }
int l() const { return l_; }
int nint() const { return iend*jend*kend*lend; }
double val() const { return buf[index]*scale_; }
};
class TwoBodyIntIter {
protected:
Ref<TwoBodyInt> tbi;
ShellQuartetIter sqi;
int iend;
int icur;
int jcur;
int kcur;
int lcur;
public:
TwoBodyIntIter();
TwoBodyIntIter(const Ref<TwoBodyInt>&);
virtual ~TwoBodyIntIter();
virtual void start();
virtual void next();
int ready() const { return (icur < iend); }
int ishell() const { return icur; }
int jshell() const { return jcur; }
int kshell() const { return kcur; }
int lshell() const { return lcur; }
virtual double scale() const;
ShellQuartetIter& current_quartet();
};
// //////////////////////////////////////////////////////////////////////////
class TwoBodyDerivInt : public RefCount {
protected:
// this is who created me
Integral *integral_;
Ref<GaussianBasisSet> bs1_;
Ref<GaussianBasisSet> bs2_;
Ref<GaussianBasisSet> bs3_;
Ref<GaussianBasisSet> bs4_;
double *buffer_;
TwoBodyDerivInt(Integral* integral,
const Ref<GaussianBasisSet>&b1,
const Ref<GaussianBasisSet>&b2,
const Ref<GaussianBasisSet>&b3,
const Ref<GaussianBasisSet>&b4);
public:
virtual ~TwoBodyDerivInt();
int nbasis() const;
int nbasis1() const;
int nbasis2() const;
int nbasis3() const;
int nbasis4() const;
int nshell() const;
int nshell1() const;
int nshell2() const;
int nshell3() const;
int nshell4() const;
Ref<GaussianBasisSet> basis();
Ref<GaussianBasisSet> basis1();
Ref<GaussianBasisSet> basis2();
Ref<GaussianBasisSet> basis3();
Ref<GaussianBasisSet> basis4();
const double * buffer() const;
virtual void compute_shell(int,int,int,int,DerivCenters&) = 0;
virtual int log2_shell_bound(int= -1,int= -1,int= -1,int= -1) = 0;
};
// //////////////////////////////////////////////////////////////////////////
class TwoBodyThreeCenterDerivInt : public RefCount {
protected:
// this is who created me
Integral *integral_;
Ref<GaussianBasisSet> bs1_;
Ref<GaussianBasisSet> bs2_;
Ref<GaussianBasisSet> bs3_;
double *buffer_;
TwoBodyThreeCenterDerivInt(Integral* integral,
const Ref<GaussianBasisSet>&b1,
const Ref<GaussianBasisSet>&b2,
const Ref<GaussianBasisSet>&b3);
public:
virtual ~TwoBodyThreeCenterDerivInt();
int nbasis() const;
int nbasis1() const;
int nbasis2() const;
int nbasis3() const;
int nshell() const;
int nshell1() const;
int nshell2() const;
int nshell3() const;
Ref<GaussianBasisSet> basis();
Ref<GaussianBasisSet> basis1();
Ref<GaussianBasisSet> basis2();
Ref<GaussianBasisSet> basis3();
const double * buffer() const;
virtual void compute_shell(int,int,int,DerivCenters&) = 0;
virtual int log2_shell_bound(int= -1,int= -1,int= -1) = 0;
};
// //////////////////////////////////////////////////////////////////////////
class TwoBodyTwoCenterDerivInt : public RefCount {
protected:
// this is who created me
Integral *integral_;
Ref<GaussianBasisSet> bs1_;
Ref<GaussianBasisSet> bs2_;
double *buffer_;
TwoBodyTwoCenterDerivInt(Integral* integral,
const Ref<GaussianBasisSet>&b1,
const Ref<GaussianBasisSet>&b2);
public:
virtual ~TwoBodyTwoCenterDerivInt();
int nbasis() const;
int nbasis1() const;
int nbasis2() const;
int nshell() const;
int nshell1() const;
int nshell2() const;
Ref<GaussianBasisSet> basis();
Ref<GaussianBasisSet> basis1();
Ref<GaussianBasisSet> basis2();
const double * buffer() const;
virtual void compute_shell(int,int,DerivCenters&) = 0;
virtual int log2_shell_bound(int= -1,int= -1) = 0;
};
}
#endif
// Local Variables:
// mode: c++
// c-file-style: "ETS"
// End: