Probably both of these parameters should be passed by const-reference instead of by value?:
|
get_potential(const std::complex<double> site, const std::vector<std::complex<double> *> neighbours) { |
(passing a vector by const value is quite expensive compared to passing a const reference, even for a small vector like this one, because passing by value makes a copy, which requires it to allocate memory on the heap)
Also it looks like these methods could also all be marked const, as they don't alter any of the class member variables? e.g.
get_potential(const std::complex<double>& site, const std::vector<std::complex<double> *>& neighbours) const
Probably both of these parameters should be passed by const-reference instead of by value?:
LatticeModelSimulationLib/include/lattice_model_impl/lattice/lattice_models/complex_anharmonic_oscillator.hpp
Line 64 in 846704b
(passing a vector by const value is quite expensive compared to passing a const reference, even for a small vector like this one, because passing by value makes a copy, which requires it to allocate memory on the heap)
Also it looks like these methods could also all be marked const, as they don't alter any of the class member variables? e.g.