-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Probably both of these parameters should be passed by const-reference instead of by value?:
Line 64 in 846704b
| 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
Metadata
Metadata
Assignees
Labels
No labels