I am preparing a large PR on ISAPT and I noticed that some of the things that I’ve done with psi::Vector
half a year ago no longer work in my hands, most likely as a result of PR #2628. Could someone please point out to me the correct way to copy one Vector
onto another now?
Here’s what I’m doing right now: the FISAPT
class defines
std::map<std::string, std::shared_ptr<Vector> > vectors_;
and then I use it like this:
vectors_["ZA"] = std::make_shared<Vector>("ZA", nA);
(and then some time later)
std::shared_ptr<Vector> ZA = std::make_shared<Vector>("ZA2", nA);
ZA->copy(vectors_["ZA"]);
Here’s the complete compiler error:
/home/kjp0013/psi4_gitisapt/psi4/psi4/src/psi4/fisapt/fisapt.cc:1078:32: error: no matching function for call to 'psi::Vector::copy(std::map<std::__cxx11::basic_string<char>, std::shared_ptr<psi::Vector> >::mapped_type&)'
ZA->copy(vectors_["ZA"]);
^
In file included from /home/kjp0013/psi4_gitisapt/psi4/psi4/src/psi4/libmints/factory.h:32:0,
from /home/kjp0013/psi4_gitisapt/psi4/psi4/src/psi4/fisapt/fisapt.cc:48:
/home/kjp0013/psi4_gitisapt/psi4/psi4/src/psi4/libmints/vector.h:170:10: note: candidate: void psi::IrreppedVector<T>::copy(const psi::IrreppedVector<T>&) [with T = double]
void copy(const IrreppedVector<T>& vector) {
^~~~
/home/kjp0013/psi4_gitisapt/psi4/psi4/src/psi4/libmints/vector.h:170:10: note: no known conversion for argument 1 from 'std::map<std::__cxx11::basic_string<char>, std::shared_ptr<psi::Vector>>::mapped_type {aka std::shared_ptr<psi::Vector>}' to 'const psi::IrreppedVector<double>&'
What am I doing wrong and what should I be doing instead? I do a lot of the same things with psi::Matrix
that work just fine.
Thank you,
Konrad