Psi4
sblock_vector.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2018 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef _psi_src_lib_libmemtrix_sblock_vector_h_
30 #define _psi_src_lib_libmemtrix_sblock_vector_h_
31 
32 #include <string>
33 
34 #include "block_vector.h"
35 
36 namespace psi {
37 namespace mcscf {
38 
39 // Smart version of BlockVector
40 class SBlockVector {
41  public:
42  SBlockVector();
43  SBlockVector(std::string label, int nirreps, int*& rows_size);
44  SBlockVector(std::string label, int nirreps, vecint& rows_size);
46  if (block_vector_)
48  }
49 
50  // Manual allocation
51  void allocate(std::string label, int nirreps, int*& rows_size);
52  void allocate(std::string label, int nirreps, vecint& rows_size);
53 
55  if (block_vector_) {
57  }
58  }
59 
60  // Copy constructor and assignment operator
61  SBlockVector(const SBlockVector& src);
62  SBlockVector& operator=(const SBlockVector& src);
63 
64  // Allow access to the implementation object
65  const BlockVector* operator->() const { return block_vector_; }
67 
68  // Access the implementation object
70 
71  // Checking functions
72  bool is_allocated() { return (block_vector_); }
73  void check(const char* cstr);
74 
75  void copy(SBlockVector& source);
76 
77  private:
78  SBlockVector(BlockVector* block_vector);
79 
81 };
82 
83 } // namespace mcscf
84 } // namespace psi
85 
86 #endif // _psi_src_lib_libmemtrix_sblock_vector_h_
BlockVector * operator->()
Definition: sblock_vector.h:66
void copy(SBlockVector &source)
Definition: sblock_vector.cc:89
void check(const char *cstr)
Definition: sblock_vector.cc:81
const BlockVector * operator->() const
Definition: sblock_vector.h:65
bool subtract_reference()
Definition: block_vector.h:64
std::vector< int > vecint
Definition: block_matrix.h:36
SharedWavefunction mcscf(SharedWavefunction, Options &)
Definition: mcscf.cc:69
Definition: block_vector.h:43
void allocate(std::string label, int nirreps, int *&rows_size)
Definition: sblock_vector.cc:60
BlockVector * block_vector_
Definition: sblock_vector.h:80
void subtract_reference()
Definition: sblock_vector.h:54
BlockVector * getBlockVector()
Definition: sblock_vector.h:69
Definition: sblock_vector.h:40
SBlockVector()
Definition: sblock_vector.cc:41
SBlockVector & operator=(const SBlockVector &src)
Definition: sblock_vector.cc:70
bool is_allocated()
Definition: sblock_vector.h:72
~SBlockVector()
Definition: sblock_vector.h:45