/usr/include/libmints/factory.h is in libpsi3-dev 3.4.0-6build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | #ifndef _psi_src_lib_libmints_factory_h_
#define _psi_src_lib_libmints_factory_h_
/*!
\file libmints/factory.h
\ingroup MINTS
*/
#include <libmints/vector.h>
#include <libmints/matrix.h>
#include <libchkpt/chkpt.hpp>
#include <libpsio/psio.hpp>
namespace psi {
/// A class for creating Matrix, SimpleMatrix, Vector, and SimpleVector objects.
/// The objects this factory creates can automatically be sized based on information
/// from checkpoint.
class MatrixFactory {
/// Number of irreps
int nirreps_;
/// Number of orbitals
int nso_;
/// Number of rows per irrep
int *rowspi_;
/// Number of columns per irrep
int *colspi_;
public:
/// Default constructor, does nothing.
MatrixFactory();
/// Copy constructor.
MatrixFactory(const MatrixFactory& copy);
~MatrixFactory();
/// Initializes the matrix factory by creating a chkpt object with a psio reference.
bool init_with_chkpt(Ref<psi::PSIO>& psio);
/// Initializes the matrix factory using the given chkpt object.
bool init_with_chkpt(Ref<psi::Chkpt>& chkpt);
/// Manually initialize the matrix factory
bool init_with(int nirreps, int *rowspi, int *colspi);
/// Returns number of irreps
int nirreps() const {
return nirreps_;
}
/// Returns the rows per irrep array
int *rowspi() const {
return rowspi_;
}
/// Returns the number of rows in irrep h
int nrows(int h) const {
return rowspi_[h];
}
/// Returns the columns per irrep array
int *colspi() const {
return colspi_;
}
/// Returns the number of columns in irrep h
int ncols(int h) const {
return colspi_[h];
}
/// Returns the number of orbitals
int nso() const {
return nso_;
}
/// Returns a new Matrix object with default dimensions
Matrix * create_matrix()
{
return new Matrix(nirreps_, rowspi_, colspi_);
}
/// Returns a new Matrix object named name with default dimensions
Matrix * create_matrix(std::string name)
{
return new Matrix(name, nirreps_, rowspi_, colspi_);
}
/// Returns a new Vector object with default dimensions
Vector * create_vector()
{
return new Vector(nirreps_, rowspi_);
}
/// Returns a new SimpleMatrix object with default dimensions
SimpleMatrix * create_simple_matrix()
{
return new SimpleMatrix(nso_, nso_);
}
/// Returns a new SimpleMatrix object named name with default dimensions
SimpleMatrix * create_simple_matrix(std::string name)
{
return new SimpleMatrix(name, nso_, nso_);
}
/// Returns a new SimpleMatrix object named name of size m x n
SimpleMatrix * create_simple_matrix(std::string name, int m, int n)
{
return new SimpleMatrix(name, m, n);
}
/// Returns a new SimpleMatrix object with size m x n
SimpleMatrix * create_simple_matrix(int m, int n)
{
return new SimpleMatrix(m, n);
}
/// Returns a new SimpleVector object with default dimension
SimpleVector * create_simple_vector()
{
return new SimpleVector(nso_);
}
/// Returns a new SimpleVector object with size m
SimpleVector * create_simple_vector(int m)
{
return new SimpleVector(m);
}
};
}
#endif
|