MPQC  3.0.0-alpha
src/lib/chemistry/qc/mbptr12/twoparticlecontraction.h
00001 //
00002 // twoparticlecontraction.h
00003 //
00004 // Copyright (C) 2005 Edward Valeev
00005 //
00006 // Author: Edward Valeev <evaleev@vt.edu>
00007 // Maintainer: EV
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 #include <util/state/state.h>
00029 #include <util/state/statein.h>
00030 #include <util/state/stateout.h>
00031 
00032 #ifndef _chemistry_qc_mbptr12_twoparticlecontraction_h
00033 #define _chemistry_qc_mbptr12_twoparticlecontraction_h
00034 
00035 namespace sc {
00036   
00037   namespace mbptr12 {
00038     
00043     class TwoParticleContraction : virtual public SavableState {
00044       public:
00045       TwoParticleContraction(unsigned int nrow, unsigned int ncol);
00046       TwoParticleContraction(StateIn& si);
00047       virtual ~TwoParticleContraction() {}
00048       
00049       void save_data_state(StateOut& so);
00050       
00051       unsigned int nrow() const;
00052       unsigned int ncol() const;
00053       
00055       virtual double contract(const double* A, const double* B) const =0;
00056       
00057       protected:
00058       double dot_prod(const double* A, const double* B) const;
00059       
00060       private:
00061       unsigned int nrow_;
00062       unsigned int ncol_;
00063     };
00064     
00068     class Direct_Contraction : public TwoParticleContraction {
00069       public:
00070       Direct_Contraction(unsigned int nrow, unsigned int ncol, double scale);
00071       Direct_Contraction(StateIn& si);
00072       ~Direct_Contraction() {}
00073       void save_data_state(StateOut& so);
00074       
00076       double contract(const double* A, const double* B) const;
00077       
00078       private:
00079       double scale_;
00080     };
00081     
00087     class ABS_OBS_Contraction : public TwoParticleContraction {
00088       public:
00090       ABS_OBS_Contraction(unsigned int nobs, unsigned int nocc1, unsigned int nocc2);
00091       ABS_OBS_Contraction(StateIn&);
00092       ~ABS_OBS_Contraction() {}
00093       void save_data_state(StateOut&);
00095       double contract(const double* A, const double* B) const;
00096       
00097       private:
00098       unsigned int nocc1_;
00099       unsigned int nocc2_;
00100     };
00101     
00106     class CABS_OBS_Contraction : public TwoParticleContraction {
00107       public:
00109       CABS_OBS_Contraction(unsigned int nobs);
00110       CABS_OBS_Contraction(StateIn&);
00111       ~CABS_OBS_Contraction() {}
00112       void save_data_state(StateOut&);
00114       double contract(const double* A, const double* B) const;
00115     };
00116   }
00117 }
00118 
00119 #endif
00120 

Generated at Sat Jul 7 2012 11:52:46 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.0.