Skip to content

Commit

Permalink
Declaring const methods needed by CdSalcList.
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathonMisiewicz committed Jan 18, 2018
1 parent 11247db commit 654cf4b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions psi4/src/export_mints.cc
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@ void export_mints(py::module& m)
"Is the deriv_density already backtransformed? Default is False", py::arg("val") = false)
.def("compute", &Deriv::compute, "Compute the gradient");

typedef SharedMatrix (MatrixFactory::*create_shared_matrix)();
typedef SharedMatrix (MatrixFactory::*create_shared_matrix_name)(const std::string&);
typedef SharedMatrix (MatrixFactory::*create_shared_matrix)() const;
typedef SharedMatrix (MatrixFactory::*create_shared_matrix_name)(const std::string&) const;
//Something here is wrong. These will not work with py::args defined, not sure why
py::class_<MatrixFactory, std::shared_ptr<MatrixFactory>>(m, "MatrixFactory", "Creates Matrix objects")
.def("create_matrix", create_shared_matrix(&MatrixFactory::create_shared_matrix),
Expand Down
8 changes: 4 additions & 4 deletions psi4/src/psi4/libmints/factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int MatrixFactory::norb() const { return nso_; }
Matrix* MatrixFactory::create_matrix(int symmetry) { return new Matrix(nirrep_, rowspi_, colspi_, symmetry); }

/// Returns a new Matrix object with default dimensions
SharedMatrix MatrixFactory::create_shared_matrix() { return std::make_shared<Matrix>(nirrep_, rowspi_, colspi_); }
SharedMatrix MatrixFactory::create_shared_matrix() const { return std::make_shared<Matrix>(nirrep_, rowspi_, colspi_); }

void MatrixFactory::create_matrix(Matrix& mat, int symmetry) { mat.init(nirrep_, rowspi_, colspi_, "", symmetry); }

Expand All @@ -118,15 +118,15 @@ Matrix* MatrixFactory::create_matrix(std::string name, int symmetry) {
return new Matrix(name, nirrep_, rowspi_, colspi_, symmetry);
}

SharedMatrix MatrixFactory::create_shared_matrix(const std::string& name) {
SharedMatrix MatrixFactory::create_shared_matrix(const std::string& name) const {
return std::make_shared<Matrix>(name, nirrep_, rowspi_, colspi_);
}

SharedMatrix MatrixFactory::create_shared_matrix(const std::string& name, int symmetry) {
SharedMatrix MatrixFactory::create_shared_matrix(const std::string& name, int symmetry) const {
return std::make_shared<Matrix>(name, nirrep_, rowspi_, colspi_, symmetry);
}

SharedMatrix MatrixFactory::create_shared_matrix(const std::string& name, int rows, int cols) {
SharedMatrix MatrixFactory::create_shared_matrix(const std::string& name, int rows, int cols) const {
return std::make_shared<Matrix>(name, rows, cols);
}

Expand Down
8 changes: 4 additions & 4 deletions psi4/src/psi4/libmints/factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,18 @@ class MatrixFactory {
Matrix * create_matrix(int symmetry=0);

/// Returns a new Matrix object with default dimensions
SharedMatrix create_shared_matrix();
SharedMatrix create_shared_matrix() const;

void create_matrix(Matrix& mat, int symmetry=0);

/// Returns a new Matrix object named name with default dimensions
Matrix * create_matrix(std::string name, int symmetry=0);

SharedMatrix create_shared_matrix(const std::string& name);
SharedMatrix create_shared_matrix(const std::string& name) const;

SharedMatrix create_shared_matrix(const std::string& name, int symmetry);
SharedMatrix create_shared_matrix(const std::string& name, int symmetry) const;

SharedMatrix create_shared_matrix(const std::string& name, int rows, int cols);
SharedMatrix create_shared_matrix(const std::string& name, int rows, int cols) const;

void create_matrix(Matrix& mat, std::string name, int symmetry=0);

Expand Down
4 changes: 2 additions & 2 deletions psi4/src/psi4/libmints/pointgrp.h
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,10 @@ class CharacterTable
const std::string& symbol() const
{ return symb; }
/// Returns the i'th irrep.
IrreducibleRepresentation& gamma(int i)
IrreducibleRepresentation& gamma(int i) const
{ return gamma_[i]; }
/// Returns the i'th symmetry operation.
SymmetryOperation& symm_operation(int i)
SymmetryOperation& symm_operation(int i) const
{ return symop[i]; }

/** Cn, Cnh, Sn, T, and Th point groups have complex representations.
Expand Down

0 comments on commit 654cf4b

Please sign in to comment.