~ubuntu-branches/ubuntu/utopic/psicode/utopic

« back to all changes in this revision

Viewing changes to .pc/08_525758_ftbfs_with_gcc44.patch/src/bin/psimrcc/blas.h

  • Committer: Package Import Robot
  • Author(s): Michael Banck
  • Date: 2012-03-29 01:26:55 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120329012655-8lnngrup9p40ow4z
Tags: 3.4.0-3
* debian/control: Add CC3, MRCCSD and SCS-MP2 energies, RHF hessian and
  closed-shell MP2 gradient to features, clarify that MP2-R12 is an
  explicitly correlated method.
* debian/patches/09_system_libint.dpatch: New patch, modifies the build
  system to use the system libint and not compile and link in the shipped
  libint codes.
* debian/control (Build-Depends): Added libint-dev.
* debian/rules (DEB_MAKE_CHECK_TARGET): Run quicktests target to invoke the
  test suite.
* debian/rules: Rewritten for dh.
* debian/control (Build-Depends): Bumped debhelper version to 8, removed
  cdbs and dpatch.
* debian/patches: Moved to source version 3.0 (quilt).
* debian/source/format: New file.
* debian/rules (override_dh_auto_install): Install some test suite input
  files as examples.
* debian/dirs: Added examples directory.
* debian/TODO: Updated.
* debian/control (Standards-Version): Bumped to 3.9.3.
* debian/rules (override_dh_auto_test): Do not abort build on test suite
  failure.
* debian/rules (override_dh_auto_build): New rule, build the user manual in
  addition to the main code.
* debian/control (Build-Depends): Added texlive-latex-recommended.
* debian/patches/10_makerules_doc.patch: New patch, build the postscript
  file by default and deletes some more generated files on realclean.
* debian/rules (override_dh_auto_install): Install postscript user manual
  into documentation directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _psi_src_bin_psimrcc_ccblas_h
 
2
#define _psi_src_bin_psimrcc_ccblas_h
 
3
 
 
4
/*! \file 
 
5
    \ingroup (PSIMRCC)
 
6
    \brief   A class to perform contractions
 
7
*/
 
8
 
 
9
#include "index.h"
 
10
#include "matrix.h"
 
11
#include "matrixtmp.h"
 
12
#include "operation.h"
 
13
 
 
14
#include <deque>
 
15
#include <string>
 
16
#include <vector>
 
17
#include <map>
 
18
#include <utility>
 
19
 
 
20
namespace psi{ namespace psimrcc{
 
21
 
 
22
typedef std::map<CCMatrix*,int> MatCnt;
 
23
typedef std::map<std::string,CCMatrix*> MatrixMap;
 
24
typedef std::map<std::string,CCMatrix*>::iterator MatMapIt;
 
25
typedef std::map<std::string,CCIndex*>  IndexMap;
 
26
typedef std::vector<double*>            ArrayVec;
 
27
typedef std::map<std::string,double***> SortMap;
 
28
 
 
29
enum DiisType {DiisEachCycle,DiisCC};
 
30
 
 
31
/**
 
32
        @author Francesco A. Evangelista and Andrew C. Simmonett <frank@ccc.uga.edu>
 
33
*/
 
34
class CCBLAS{
 
35
public: 
 
36
  typedef std::vector<std::string>            strvec;
 
37
  typedef std::vector<int>                    intvec;
 
38
  typedef std::vector<std::pair<int,int> >    intpairvec;
 
39
  typedef std::deque<CCOperation>             OpDeque;
 
40
 
 
41
  CCBLAS();
 
42
  ~CCBLAS();
 
43
  // Add routines
 
44
  void       add_Matrix(const char* cstr);
 
45
  void       add_Matrix(std::string str);
 
46
  void       add_index(const char* cstr);
 
47
  // Solve and sort
 
48
  void       solve(const char* cstr);
 
49
  void       solve(std::string str);
 
50
  void       solve_zero_two_diagonal(const char* cstr);
 
51
  void       zero_right_four_diagonal(const char* cstr);
 
52
  void       zero_left_four_diagonal(const char* cstr);
 
53
  void       zero_non_doubly_occupied(const char* cstr);
 
54
  void       zero_non_external(const char* cstr);
 
55
  void       zero(const char* cstr);
 
56
  void       reduce_spaces(const char* out,const char* in);
 
57
  void       expand_spaces(const char* out,const char* in);
 
58
  void       append(const char* cstr);
 
59
  void       append(std::string str);
 
60
  void       append_zero_two_diagonal(const char* cstr);
 
61
  void       compute();
 
62
  int        compute_storage_strategy();
 
63
  void       show_storage();
 
64
  // DIIS
 
65
  void       diis_add(std::string amps, std::string delta_amps);
 
66
  void       diis_save_t_amps(int cycle);
 
67
  void       diis(int cycle, double delta, DiisType diis_type);
 
68
  // Printing
 
69
  void       print(const char* cstr);
 
70
  void       print_ref(string& str);
 
71
  void       print_memory();
 
72
  // Safe get and set
 
73
  CCIndex*   get_index(const char* cstr);
 
74
  CCIndex*   get_index(std::string& str);
 
75
  CCMatTmp   get_MatTmp(std::string str, int reference, DiskOpt disk_option);
 
76
  CCMatTmp   get_MatTmp(std::string str, DiskOpt disk_option);
 
77
  CCMatTmp   get_MatTmp(CCMatrix* Matrix, DiskOpt disk_option);
 
78
  CCMatIrTmp get_MatIrTmp(std::string str, int reference, int irrep,  DiskOpt disk_option);
 
79
  CCMatIrTmp get_MatIrTmp(std::string str, int irrep, DiskOpt disk_option);
 
80
  CCMatIrTmp get_MatIrTmp(CCMatrix* Matrix, int irrep, DiskOpt disk_option);
 
81
 
 
82
  double     get_scalar(std::string str);
 
83
  double     get_scalar(const char* cstr,int reference);
 
84
  double     get_scalar(std::string& str,int reference);
 
85
  void       set_scalar(const char* cstr,int reference,double value);
 
86
  void       set_scalar(std::string& str,int reference,double value);
 
87
 
 
88
  // These have to be improved
 
89
  MatrixMap& get_MatrixMap() {return(matrices);}
 
90
private:
 
91
  size_t     work_size;
 
92
  size_t     buffer_size;
 
93
  bool       full_in_core;
 
94
  MatrixMap  matrices;
 
95
  IndexMap   indices;
 
96
  OpDeque    operations;
 
97
  ArrayVec   work;
 
98
  ArrayVec   buffer;
 
99
  MatCnt     matrices_in_deque;
 
100
  MatCnt     matrices_in_deque_target;
 
101
  MatCnt     matrices_in_deque_source;
 
102
  SortMap    sortmap;
 
103
private:
 
104
 
 
105
  IndexMap&  get_IndexMap()  {return(indices);}
 
106
  CCMatrix*  get_Matrix(std::string& str);
 
107
  CCMatrix*  get_Matrix(const char* cstr);
 
108
  CCMatrix*  get_Matrix(const char* cstr, int reference);
 
109
  CCMatrix*  get_Matrix(std::string& str,std::string& expression); // Prints a clear error message
 
110
  double*    get_work(int n)   {return(work[n]);}
 
111
//   double***  get_sortmap(CCIndex* T_left,CCIndex* T_right,int thread);
 
112
 
 
113
  void       allocate_matrices_in_core();
 
114
  void       load(CCMatrix* Matrix);
 
115
  void       load_irrep(CCMatrix* Matrix,int h);
 
116
  ///////////////////////////////////////////////////////////////////////////////
 
117
  // Class private functions
 
118
  ///////////////////////////////////////////////////////////////////////////////
 
119
  void       add_Matrix_ref(std::string& str);
 
120
  void       add_indices();
 
121
  void       add_matrix_ref(std::string& str);
 
122
  void       solve_ref(string& str);
 
123
  int        parse(std::string& str);
 
124
  void       process_operations();
 
125
  void       process_reduce_spaces(CCMatrix* out_Matrix,CCMatrix* in_Matrix);
 
126
  void       process_expand_spaces(CCMatrix* out_Matrix,CCMatrix* in_Matrix);
 
127
  bool       get_factor(const std::string& str,double& factor);
 
128
  // General routines
 
129
 
 
130
  void       make_space(double memory_required);
 
131
  // Low level memory routines
 
132
  void       init();
 
133
  void       cleanup();
 
134
  void       allocate_work();
 
135
  void       allocate_buffer();
 
136
  void       free_sortmap();
 
137
  void       free_work();
 
138
  void       free_indices();
 
139
  void       free_matrices();
 
140
  void       free_buffer();
 
141
};
 
142
 
 
143
extern CCBLAS *blas;
 
144
 
 
145
}} /* End Namespaces */
 
146
 
 
147
#endif // _psi_src_bin_psimrcc_ccblas_h