00001 // 00002 // accum.h 00003 // 00004 // Copyright (C) 1996 Limit Point Systems, Inc. 00005 // 00006 // Author: Curtis Janssen <cljanss@limitpt.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_wfn_accum_h 00029 #define _chemistry_qc_wfn_accum_h 00030 00031 #ifdef __GNUC__ 00032 #pragma interface 00033 #endif 00034 00035 #include <chemistry/qc/wfn/wfn.h> 00036 00037 namespace sc { 00038 00039 // ////////////////////////////////////////////////////////////////////////// 00040 00045 class AccumH: virtual public SavableState { 00046 protected: 00047 Ref<Wavefunction> wfn_; 00048 00049 public: 00050 AccumH(); 00051 AccumH(StateIn&); 00064 AccumH(const Ref<KeyVal>&); 00065 virtual ~AccumH(); 00066 00067 void save_data_state(StateOut&); 00068 00073 virtual void init(const Ref<Wavefunction>&); 00075 virtual void accum(const RefSymmSCMatrix& h) =0; 00077 virtual void print_summary(); 00082 virtual void done(); 00083 00087 virtual double e(); 00088 }; 00089 00090 00093 class AccumHNull: public AccumH { 00094 public: 00095 AccumHNull(); 00096 AccumHNull(StateIn&); 00097 AccumHNull(const Ref<KeyVal>&); 00098 ~AccumHNull(); 00099 00100 void save_data_state(StateOut&); 00101 00102 void accum(const RefSymmSCMatrix& h); 00103 }; 00104 00108 class SumAccumH: public AccumH { 00109 protected: 00110 int n_; 00111 Ref<AccumH> *accums_; 00112 00113 public: 00114 SumAccumH(StateIn&); 00125 SumAccumH(const Ref<KeyVal>&); 00126 ~SumAccumH(); 00127 00128 void save_data_state(StateOut&); 00129 00130 void init(const Ref<Wavefunction>&); 00131 void accum(const RefSymmSCMatrix& h); 00132 void done(); 00133 00134 double e(); 00135 }; 00136 00137 } 00138 00139 #endif 00140 00141 // Local Variables: 00142 // mode: c++ 00143 // c-file-style: "ETS" 00144 // End: