~ubuntu-branches/ubuntu/quantal/psicode/quantal

« back to all changes in this revision

Viewing changes to src/bin/psimrcc/sort.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _psi_src_bin_psimrcc_ccsort_h
 
2
#define _psi_src_bin_psimrcc_ccsort_h
 
3
 
 
4
/**
 
5
 *  @file sort.h
 
6
 *  @ingroup (PSIMRCC)
 
7
*/
 
8
 
 
9
#include <iostream>
 
10
#include <map>
 
11
#include <vector>
 
12
 
 
13
#include "blas.h"
 
14
 
 
15
namespace psi{ namespace psimrcc{
 
16
 
 
17
#define INDEX(i,j) ((i>j) ? (ioff[(i)]+(j)) : (ioff[(j)]+(i)))
 
18
#define four(i,j,k,l) INDEX(INDEX(i,j),INDEX(k,l))
 
19
 
 
20
typedef std::vector<std::pair<CCMatrix*,int> > MatrixBlks;
 
21
typedef std::vector<std::pair<CCMatrix*,int> >::iterator MatBlksIt;
 
22
 
 
23
enum SortAlgorithm {in_core_sort,out_of_core_sort,mrpt2_sort};
 
24
 
 
25
/** 
 
26
 *  @class CCSort
 
27
 *  @brief Grabs the MO integrals from CCTransform and fills the CCMatrix objects in CCBLAS
 
28
*/
 
29
class CCSort{
 
30
public:
 
31
  CCSort(SortAlgorithm algorithm);
 
32
  ~CCSort();
 
33
private:
 
34
  void init();
 
35
  void cleanup();
 
36
 
 
37
  // In-core algorithm
 
38
  void   build_integrals_in_core();
 
39
  void   frozen_core_energy_in_core();
 
40
  void   sort_integrals_in_core();
 
41
  void   form_two_electron_integrals_in_core(MatrixMap::iterator& iter);
 
42
  void   form_fock_in_core(MatrixMap::iterator& iter);
 
43
  double add_fock_two_in_core(int p, int q, int k, bool exchange);
 
44
 
 
45
  // Out-of-core algorithm
 
46
  void   build_integrals_out_of_core();
 
47
  void   frozen_core_energy_out_of_core();
 
48
  void   sort_integrals_out_of_core(int first_irrep, int last_irrep, MatrixBlks& to_be_processed);
 
49
  void   form_fock_out_of_core(CCMatrix* Matrix, int h);
 
50
  void   form_two_electron_integrals_out_of_core(CCMatrix* Matrix, int h);
 
51
  double add_fock_two_out_of_core(int p, int q, int k, bool exchange);
 
52
  void   setup_out_of_core_list(MatMapIt& mat_it,int& mat_irrep,MatMapIt& mat_end,MatrixBlks&  to_be_processed);
 
53
  void   dump_integrals_to_disk(MatrixBlks& to_be_processed);
 
54
 
 
55
  // MRPT2 algorithm
 
56
  void   build_integrals_mrpt2();
 
57
  void   frozen_core_energy_mrpt2();
 
58
  void   allocate_and_sort_integrals_mrpt2();
 
59
  void   allocate_amplitudes_mrpt2();
 
60
  void   form_two_electron_integrals_mrpt2(MatrixMap::iterator& iter);
 
61
  void   form_fock_mrpt2(MatrixMap::iterator& iter);
 
62
  double add_fock_two_mrpt2(int p, int q, int k, bool exchange);
 
63
 
 
64
  // Data
 
65
  int       nfzc;
 
66
  double    efzc;
 
67
  int*      frozen_core;
 
68
};
 
69
 
 
70
extern CCSort *sorter;
 
71
 
 
72
}} /* End Namespaces */
 
73
 
 
74
#endif // _psi_src_bin_psimrcc_ccsort_h