Psi4
factory.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-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
28 #ifndef _psi_src_lib_libmints_factory_h_
29 #define _psi_src_lib_libmints_factory_h_
30 
31 #include "psi4/libmints/vector.h"
32 #include "psi4/libmints/matrix.h"
34 #include "psi4/libpsio/psio.hpp"
35 
36 namespace psi {
37 
38 class SOBasisSet;
39 
49  int nirrep_;
51  int nso_;
56 
57 public:
59  MatrixFactory();
61  MatrixFactory(const MatrixFactory& copy);
63 
65  bool init_with(int nirrep, int *rowspi, int *colspi);
66 
68  bool init_with(const Dimension& rows, const Dimension& cols);
69 
71  bool init_with(const std::shared_ptr<SOBasisSet>& sobasis);
72 
74  int nirrep() const;
75 
77  const Dimension& rowspi() const;
78 
80  int nrow(int h) const;
81 
83  const Dimension& colspi() const;
84 
86  int ncol(int h) const;
87 
89  int norb() const;
90 
92  Matrix * create_matrix(int symmetry=0);
93 
96 
97  void create_matrix(Matrix& mat, int symmetry=0);
98 
100  Matrix * create_matrix(std::string name, int symmetry=0);
101 
102  SharedMatrix create_shared_matrix(const std::string& name);
103 
104  SharedMatrix create_shared_matrix(const std::string& name, int symmetry);
105 
106  SharedMatrix create_shared_matrix(const std::string& name, int rows, int cols);
107 
108  void create_matrix(Matrix& mat, std::string name, int symmetry=0);
109 
111  Vector * create_vector();
112 
113  void create_vector(Vector& vec);
114 
115  SharedVector create_shared_vector(const std::string& name);
116 };
117 
118 }
119 
120 #endif
SharedMatrix create_shared_matrix()
Returns a new Matrix object with default dimensions.
Definition: libmints/factory.cc:137
A class for creating Matrix, SimpleMatrix, Vector, and SimpleVector objects.
Definition: factory.h:47
const Dimension & colspi() const
Returns the columns per irrep array.
Definition: libmints/factory.cc:116
Matrix * create_matrix(int symmetry=0)
Returns a new Matrix object with default dimensions.
Definition: libmints/factory.cc:131
Vector * create_vector()
Returns a new Vector object with default dimensions.
Definition: libmints/factory.cc:174
int ncol(int h) const
Returns the number of columns in irrep h.
Definition: libmints/factory.cc:121
int nirrep_
Number of irreps.
Definition: factory.h:49
bool init_with(int nirrep, int *rowspi, int *colspi)
Manually initialize the matrix factory.
Definition: libmints/factory.cc:61
Dimension rowspi_
Number of rows per irrep.
Definition: factory.h:53
Dimension colspi_
Number of columns per irrep.
Definition: factory.h:55
int nso_
Number of orbitals.
Definition: factory.h:51
MatrixFactory()
Default constructor, does nothing.
Definition: libmints/factory.cc:45
int nrow(int h) const
Returns the number of rows in irrep h.
Definition: libmints/factory.cc:111
~MatrixFactory()
Definition: libmints/factory.cc:57
int nirrep() const
Returns number of irreps.
Definition: libmints/factory.cc:101
Definition: dimension.h:39
Makes using matrices just a little easier.
Definition: libmints/matrix.h:71
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:50
int norb() const
Returns the number of orbitals.
Definition: libmints/factory.cc:126
const Dimension & rowspi() const
Returns the rows per irrep array.
Definition: libmints/factory.cc:106
Definition: vector.h:48
std::shared_ptr< Vector > SharedVector
Definition: adc.h:52
SharedVector create_shared_vector(const std::string &name)
Definition: libmints/factory.cc:184