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 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_libmints_factory_h_
30 #define _psi_src_lib_libmints_factory_h_
31 
32 #include "psi4/libmints/vector.h"
33 #include "psi4/libmints/matrix.h"
35 #include "psi4/libpsio/psio.hpp"
36 
37 namespace psi {
38 
39 class SOBasisSet;
40 
50  int nirrep_;
52  int nso_;
57 
58 public:
60  MatrixFactory();
62  MatrixFactory(const MatrixFactory& copy);
64 
66  bool init_with(int nirrep, int *rowspi, int *colspi);
67 
69  bool init_with(const Dimension& rows, const Dimension& cols);
70 
72  bool init_with(const std::shared_ptr<SOBasisSet>& sobasis);
73 
75  int nirrep() const;
76 
78  const Dimension& rowspi() const;
79 
81  int nrow(int h) const;
82 
84  const Dimension& colspi() const;
85 
87  int ncol(int h) const;
88 
90  int norb() const;
91 
93  Matrix * create_matrix(int symmetry=0);
94 
97 
98  void create_matrix(Matrix& mat, int symmetry=0);
99 
101  Matrix * create_matrix(std::string name, int symmetry=0);
102 
103  SharedMatrix create_shared_matrix(const std::string& name);
104 
105  SharedMatrix create_shared_matrix(const std::string& name, int symmetry);
106 
107  SharedMatrix create_shared_matrix(const std::string& name, int rows, int cols);
108 
109  void create_matrix(Matrix& mat, std::string name, int symmetry=0);
110 
112  Vector * create_vector();
113 
114  void create_vector(Vector& vec);
115 
116  SharedVector create_shared_vector(const std::string& name);
117 };
118 
119 }
120 
121 #endif
SharedMatrix create_shared_matrix()
Returns a new Matrix object with default dimensions.
Definition: libmints/factory.cc:138
A class for creating Matrix, SimpleMatrix, Vector, and SimpleVector objects.
Definition: factory.h:48
const Dimension & colspi() const
Returns the columns per irrep array.
Definition: libmints/factory.cc:117
Matrix * create_matrix(int symmetry=0)
Returns a new Matrix object with default dimensions.
Definition: libmints/factory.cc:132
Vector * create_vector()
Returns a new Vector object with default dimensions.
Definition: libmints/factory.cc:175
int ncol(int h) const
Returns the number of columns in irrep h.
Definition: libmints/factory.cc:122
int nirrep_
Number of irreps.
Definition: factory.h:50
bool init_with(int nirrep, int *rowspi, int *colspi)
Manually initialize the matrix factory.
Definition: libmints/factory.cc:62
Dimension rowspi_
Number of rows per irrep.
Definition: factory.h:54
Dimension colspi_
Number of columns per irrep.
Definition: factory.h:56
int nso_
Number of orbitals.
Definition: factory.h:52
MatrixFactory()
Default constructor, does nothing.
Definition: libmints/factory.cc:46
int nrow(int h) const
Returns the number of rows in irrep h.
Definition: libmints/factory.cc:112
~MatrixFactory()
Definition: libmints/factory.cc:58
int nirrep() const
Returns number of irreps.
Definition: libmints/factory.cc:102
Definition: dimension.h:38
Makes using matrices just a little easier.
Definition: libmints/matrix.h:70
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:49
int norb() const
Returns the number of orbitals.
Definition: libmints/factory.cc:127
const Dimension & rowspi() const
Returns the rows per irrep array.
Definition: libmints/factory.cc:107
Definition: vector.h:50
std::shared_ptr< Vector > SharedVector
Definition: adc.h:51
SharedVector create_shared_vector(const std::string &name)
Definition: libmints/factory.cc:185