00001 #include <vector> 00002 #include <Chemistry_QC_GaussianBasis_DescrInterface.hxx> 00003 #include <chemistry/qc/basis/gaussbas.h> 00004 #include <chemistry/qc/intv3/cartitv3.h> 00005 #include <chemistry/qc/intv3/intv3.h> 00006 #include <sidl_SIDLException.hxx> 00007 #pragma implementation "ccaiter.h" 00008 #include <ccaiter.h> 00009 #include <buffer_size.h> 00010 00011 namespace MpqcCca { 00012 00013 class ReorderEngine { 00014 00015 public: 00016 00017 ReorderEngine( ) { } 00018 00019 ~ReorderEngine( ) { } 00020 00021 private: 00022 int n_center_, maxam_, size_, max_deriv_lvl_; 00023 int **reorder_; 00024 std::vector<int> deriv_lvls_; 00025 std::vector<int> segments_; 00026 std::vector<double*> buffers_; 00027 double* temp_buffer_; 00028 BufferSize buffer_size_; 00029 00030 sc::Ref<sc::GaussianBasisSet> basis_sets_[4]; 00031 int shell_ids_[4]; 00032 sc::GaussianShell* shells_[4]; 00033 00034 public: 00035 00036 void init( int n, 00037 sc::Ref<sc::GaussianBasisSet>, 00038 sc::Ref<sc::GaussianBasisSet>, 00039 sc::Ref<sc::GaussianBasisSet>, 00040 sc::Ref<sc::GaussianBasisSet> ); 00041 00042 void check_temp_buffer( int deriv_lvl, int n_segment ); 00043 00044 void 00045 add_buffer ( 00046 double* buffer, 00047 Chemistry::QC::GaussianBasis::DescrInterface desc 00048 ); 00049 00050 void do_it( int s1, int s2, int s3, int s4 ); 00051 00052 void reorder_1c( double* buf, double* tbuf, int offset ); 00053 void reorder_2c( double* buf, double* tbuf, int offset, bool is_deriv ); 00054 void reorder_3c( double* buf, double* tbuf, int offset ); 00055 void reorder_4c( double* buf, double* tbuf, int offset ); 00056 00057 }; 00058 }