Your current code is making full copies of those vectors you should instead just get a const-reference to the array.
|
std::vector <double> R = vm.R; |
|
std::vector <double> Z = vm.Z; |
|
std::vector <double> L = vm.L; |
|
std::vector <double> iota = vm.iota; |
|
std::vector <double> psi = vm.psi; |
|
std::vector <double> xm = vm.xm; |
|
std::vector <double> xn = vm.xn; |
For example, you can do:
const std::vector <double>& xn = vm.xn; or better const auto& xn = vm.xn;
Your current code is making full copies of those vectors you should instead just get a const-reference to the array.
STOMMS/src/modeling.cc
Lines 24 to 30 in 8878501
For example, you can do:
const std::vector <double>& xn = vm.xn;or betterconst auto& xn = vm.xn;