From 63e37eb122e82c7430f2031fb1b06c7a79bed6ce Mon Sep 17 00:00:00 2001 From: Laurent Belcour Date: Tue, 17 Sep 2013 18:38:18 +0200 Subject: [PATCH] Adding safe guards to the change of parametrization to avoid over costs when convertin from one param to another. --- sources/core/params.h | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/sources/core/params.h b/sources/core/params.h index 92a30b7..075bcd9 100644 --- a/sources/core/params.h +++ b/sources/core/params.h @@ -115,19 +115,34 @@ class params static void convert(const double* invec, params::input intype, params::input outtype, double* outvec) { - if(intype != outtype) - { - // temporary CARTESIAN vector - double temvec[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; - - to_cartesian(invec, intype, temvec); - from_cartesian(temvec, outtype, outvec); - } - else - { - int dim = dimension(outtype); - for(int i=0; i