Commit c0eedf97 authored by Roman Tolchenov's avatar Roman Tolchenov
Browse files

Implemented derivative calculation for MultiBG, changed many int to size_t in...

Implemented derivative calculation for MultiBG, changed many int to size_t in functions. re #966. Removed references to Workspace2D from API/CompositFunctionTest and API/FunctionTest, fixes #3653.
parent f0367333
......@@ -55,11 +55,11 @@ public:
std::string asString()const;
/// Set i-th parameter
void setParameter(int, const double& value, bool explicitlySet = true);
void setParameter(size_t, const double& value, bool explicitlySet = true);
/// Set i-th parameter description
void setParameterDescription(size_t, const std::string& description);
/// Get i-th parameter
double getParameter(int i)const;
double getParameter(size_t i)const;
/// Set parameter by name.
void setParameter(const std::string& name, const double& value, bool explicitlySet = true);
/// Set description of parameter by name.
......@@ -67,44 +67,42 @@ public:
/// Get parameter by name.
double getParameter(const std::string& name)const;
/// Total number of parameters
int nParams()const;
size_t nParams()const;
/// Returns the index of parameter name
int parameterIndex(const std::string& name)const;
/// Returns the index of a parameter
//int parameterIndex(const double* p)const;
size_t parameterIndex(const std::string& name)const;
/// Returns the name of parameter i
std::string parameterName(int i)const;
std::string parameterName(size_t i)const;
/// Returns the description of parameter i
std::string parameterDescription(size_t i)const;
/// Checks if a parameter has been set explicitly
bool isExplicitlySet(int i)const;
bool isExplicitlySet(size_t i)const;
/// Number of active (in terms of fitting) parameters
int nActive()const;
size_t nActive()const;
/// Value of i-th active parameter. Override this method to make fitted parameters different from the declared
double activeParameter(int i)const;
double activeParameter(size_t i)const;
/// Set new value of i-th active parameter. Override this method to make fitted parameters different from the declared
void setActiveParameter(int i, double value);
void setActiveParameter(size_t i, double value);
/// Update parameters after a fitting iteration
void updateActive(const double* in);
/// Returns "global" index of active parameter i
int indexOfActive(int i)const;
size_t indexOfActive(size_t i)const;
/// Returns the name of active parameter i
std::string nameOfActive(int i)const;
std::string nameOfActive(size_t i)const;
/// Returns the name of active parameter i
std::string descriptionOfActive(size_t i)const;
/// Check if a parameter is active
bool isActive(int i)const;
bool isActive(size_t i)const;
/// Get active index for a declared parameter i
int activeIndex(int i)const;
size_t activeIndex(size_t i)const;
/// Removes a parameter from the list of active
void removeActive(int i);
void removeActive(size_t i);
/// Restores a declared parameter i to the active status
void restoreActive(int i);
void restoreActive(size_t i);
/// Return parameter index from a parameter reference.
int getParameterIndex(const ParameterReference& ref)const;
size_t getParameterIndex(const ParameterReference& ref)const;
/// Get the containing function
IFitFunction* getContainingFunction(const ParameterReference& ref)const;
/// Get the containing function
......@@ -117,14 +115,14 @@ public:
// Unhide base class function: removeTie(string). Avoids Intel compiler warning
using IFitFunction::removeTie;
/// Removes i-th parameter's tie
bool removeTie(int i);
bool removeTie(size_t i);
/// Get the tie of i-th parameter
ParameterTie* getTie(int i)const;
ParameterTie* getTie(size_t i)const;
/// Overwrite IFitFunction methods
void addConstraint(IConstraint* ic);
/// Get constraint of i-th parameter
virtual IConstraint* getConstraint(int i)const;
virtual IConstraint* getConstraint(size_t i)const;
void setParametersToSatisfyConstraints();
/// Remove a constraint
void removeConstraint(const std::string& parName);
......@@ -133,25 +131,25 @@ public:
/* CompositeFunction own methods */
/// Add a function at the back of the internal function list
virtual int addFunction(IFitFunction* f);
virtual size_t addFunction(IFitFunction* f);
/// Returns the pointer to i-th function
IFitFunction* getFunction(std::size_t i)const;
/// Number of functions
std::size_t nFunctions()const{return m_functions.size();}
/// Remove a function
void removeFunction(int i, bool del=true);
void removeFunction(size_t i, bool del=true);
/// Replace a function
void replaceFunction(int i,IFitFunction* f);
void replaceFunction(size_t i,IFitFunction* f);
/// Replace a function
void replaceFunction(const IFitFunction* f_old,IFitFunction* f_new);
void replaceFunctionPtr(const IFitFunction* f_old,IFitFunction* f_new);
/// Get the function index
std::size_t functionIndex(std::size_t i)const;
/// Get the function index
std::size_t functionIndexActive(std::size_t i)const;
/// Returns the index of parameter i as it declared in its function
int parameterLocalIndex(int i)const;
size_t parameterLocalIndex(size_t i)const;
/// Returns the name of parameter i as it declared in its function
std::string parameterLocalName(int i)const;
std::string parameterLocalName(size_t i)const;
/// Check the function.
void checkFunction();
......@@ -163,32 +161,32 @@ protected:
/// Add a new tie
virtual void addTie(ParameterTie* tie);
int paramOffset(int i)const{return m_paramOffsets[i];}
int activeOffset(int i)const{return m_activeOffsets[i];}
size_t paramOffset(size_t i)const{return m_paramOffsets[i];}
size_t activeOffset(size_t i)const{return m_activeOffsets[i];}
private:
/// Extract function index and parameter name from a variable name
static void parseName(const std::string& varName,int& index, std::string& name);
static void parseName(const std::string& varName,size_t& index, std::string& name);
/// Pointers to the included funtions
std::vector<IFitFunction*> m_functions;
/// Individual function parameter offsets (function index in m_functions)
/// e.g. m_functions[i]->activeParameter(m_activeOffsets[i]+1) gives second active parameter of i-th function
std::vector<int> m_activeOffsets;
std::vector<size_t> m_activeOffsets;
/// Individual function parameter offsets (function index in m_functions)
/// e.g. m_functions[i]->parameter(m_paramOffsets[i]+1) gives second declared parameter of i-th function
std::vector<int> m_paramOffsets;
std::vector<size_t> m_paramOffsets;
/// Keeps the function index for each declared parameter (parameter declared index)
std::vector<int> m_IFitFunction;
std::vector<size_t> m_IFitFunction;
/// Keeps the function index for each active parameter (parameter active index)
std::vector<int> m_IFitFunctionActive;
std::vector<size_t> m_IFitFunctionActive;
/// Number of active parameters
int m_nActive;
size_t m_nActive;
/// Total number of parameters
int m_nParams;
size_t m_nParams;
/// Function counter to be used in nextConstraint
mutable int m_iConstraintFunction;
mutable size_t m_iConstraintFunction;
};
......@@ -197,15 +195,15 @@ private:
class PartialJacobian: public Jacobian
{
Jacobian* m_J; ///< pointer to the overall Jacobian
int m_iP0; ///< offset in the overall Jacobian for a particular function
int m_iaP0; ///< offset in the active Jacobian for a particular function
size_t m_iP0; ///< offset in the overall Jacobian for a particular function
size_t m_iaP0; ///< offset in the active Jacobian for a particular function
public:
/** Constructor
* @param J :: A pointer to the overall Jacobian
* @param iP0 :: The parameter index (declared) offset for a particular function
* @param iap0 :: The active parameter index (declared) offset for a particular function
*/
PartialJacobian(Jacobian* J,int iP0, int iap0):m_J(J),m_iP0(iP0),m_iaP0(iap0)
PartialJacobian(Jacobian* J,size_t iP0, size_t iap0):m_J(J),m_iP0(iP0),m_iaP0(iap0)
{}
/**
* Overridden Jacobian::set(...).
......@@ -230,7 +228,7 @@ public:
* @param value :: Value to add
* @param iActiveP :: The index of an active parameter.
*/
virtual void addNumberToColumn(const double& value, const int& iActiveP)
virtual void addNumberToColumn(const double& value, const size_t& iActiveP)
{
m_J->addNumberToColumn(value,m_iaP0+iActiveP);
}
......
......@@ -246,7 +246,7 @@ public:
virtual const std::string category() const { return "General";}
/// Returns the size of the fitted data (number of double values returned by the function getData())
virtual int dataSize()const = 0;
virtual size_t dataSize()const = 0;
/// Returns a reference to the fitted data. These data are taken from the workspace set by setWorkspace() method.
virtual const double* getData()const = 0;
virtual const double* getWeights()const = 0;
......@@ -257,11 +257,11 @@ public:
virtual void functionDeriv(Jacobian* out);
/// Set i-th parameter
virtual void setParameter(int, const double& value, bool explicitlySet = true) = 0;
virtual void setParameter(size_t, const double& value, bool explicitlySet = true) = 0;
/// Set i-th parameter description
virtual void setParameterDescription(size_t, const std::string& description) = 0;
/// Get i-th parameter
virtual double getParameter(int i)const = 0;
virtual double getParameter(size_t i)const = 0;
/// Set parameter by name.
virtual void setParameter(const std::string& name, const double& value, bool explicitlySet = true) = 0;
/// Set description of parameter by name.
......@@ -269,42 +269,42 @@ public:
/// Get parameter by name.
virtual double getParameter(const std::string& name)const = 0;
/// Total number of parameters
virtual int nParams()const = 0;
virtual size_t nParams()const = 0;
/// Returns the index of parameter name
virtual int parameterIndex(const std::string& name)const = 0;
virtual size_t parameterIndex(const std::string& name)const = 0;
/// Returns the name of parameter i
virtual std::string parameterName(int i)const = 0;
virtual std::string parameterName(size_t i)const = 0;
/// Returns the description of parameter i
virtual std::string parameterDescription(size_t i)const = 0;
/// Checks if a parameter has been set explicitly
virtual bool isExplicitlySet(int i)const = 0;
virtual bool isExplicitlySet(size_t i)const = 0;
/// Number of active (in terms of fitting) parameters
virtual int nActive()const = 0;
virtual size_t nActive()const = 0;
/// Value of i-th active parameter. Override this method to make fitted parameters different from the declared
virtual double activeParameter(int i)const;
virtual double activeParameter(size_t i)const;
/// Set new value of i-th active parameter. Override this method to make fitted parameters different from the declared
virtual void setActiveParameter(int i, double value);
virtual void setActiveParameter(size_t i, double value);
/// Update parameters after a fitting iteration
virtual void updateActive(const double* in);
/// Returns "global" index of active parameter i
virtual int indexOfActive(int i)const = 0;
virtual size_t indexOfActive(size_t i)const = 0;
/// Returns the name of active parameter i
virtual std::string nameOfActive(int i)const = 0;
virtual std::string nameOfActive(size_t i)const = 0;
/// Returns the name of active parameter i
virtual std::string descriptionOfActive(size_t i)const = 0;
/// Check if a declared parameter i is active
virtual bool isActive(int i)const = 0;
virtual bool isActive(size_t i)const = 0;
/// Get active index for a declared parameter i
virtual int activeIndex(int i)const = 0;
virtual size_t activeIndex(size_t i)const = 0;
/// Removes a declared parameter i from the list of active
virtual void removeActive(int i) = 0;
virtual void removeActive(size_t i) = 0;
/// Restores a declared parameter i to the active status
virtual void restoreActive(int i) = 0;
virtual void restoreActive(size_t i) = 0;
/// Return parameter index from a parameter reference. Usefull for constraints and ties in composite functions
virtual int getParameterIndex(const ParameterReference& ref)const = 0;
virtual size_t getParameterIndex(const ParameterReference& ref)const = 0;
/// Get a function containing the parameter refered to by the reference. In case of a simple function
/// it will be the same as ParameterReference::getFunction(). In case of a CompositeFunction it returns
/// a top-level function that contains the parameter. The return function itself can be a CompositeFunction
......@@ -323,14 +323,14 @@ public:
/// Remove all ties
virtual void clearTies() = 0;
/// Removes i-th parameter's tie
virtual bool removeTie(int i) = 0;
virtual bool removeTie(size_t i) = 0;
/// Get the tie of i-th parameter
virtual ParameterTie* getTie(int i)const = 0;
virtual ParameterTie* getTie(size_t i)const = 0;
/// Add a constraint to function
virtual void addConstraint(IConstraint* ic) = 0;
/// Get constraint of i-th parameter
virtual IConstraint* getConstraint(int i)const = 0;
virtual IConstraint* getConstraint(size_t i)const = 0;
/// Remove a constraint
virtual void removeConstraint(const std::string& parName) = 0;
/// Add a penalty to the output if some parameters do not satisfy constraints.
......@@ -346,7 +346,7 @@ public:
virtual void setParametersToSatisfyConstraints() {};
/// Returns the number of attributes associated with the function
virtual int nAttributes()const{return 0;}
virtual size_t nAttributes()const{return 0;}
/// Returns a list of attribute names
virtual std::vector<std::string> getAttributeNames()const{return std::vector<std::string>();}
/// Return a value of attribute attName
......@@ -412,7 +412,7 @@ public:
/** Add number to all iY (data) Jacobian elements for a given iP (parameter)
* @param value :: Value to add
*/
virtual void addNumberToColumn(const double& value, const int& iActiveP)
virtual void addNumberToColumn(const double& value, const size_t& iActiveP)
{
(void)value; (void)iActiveP; // Avoid compiler warning
throw Kernel::Exception::NotImplementedError("No addNumberToColumn() method of Jacobian provided");
......
......@@ -66,7 +66,7 @@ class FunctionHandler;
for both active and declared parameters must ensure that any changes to one of them
immediately reflected on the other so that the two are consistent at any moment.
IFunctionMD declares method nameOfActive(int i) which returns the name of the declared parameter
IFunctionMD declares method nameOfActive(size_t i) which returns the name of the declared parameter
corresponding to the i-th active parameter. I am not completely sure in the usefulness of it.
IFunctionMD provides methods for tying and untying parameters. Only the declared parameters can be
......@@ -126,7 +126,7 @@ public:
virtual boost::shared_ptr<const Workspace> getWorkspace()const;
/// Returns the size of the fitted data (number of double values returned by the function)
virtual int dataSize()const;
virtual size_t dataSize()const;
/// Returns a reference to the fitted data. These data are taken from the workspace set by setWorkspace() method.
virtual const double* getData()const;
/// Returns a reference to the fitting weights.
......@@ -151,7 +151,7 @@ protected:
/// Shared pointer to the workspace
boost::shared_ptr<const API::IMDWorkspace> m_workspace;
/// Size of the fitted data
int m_dataSize;
size_t m_dataSize;
/// Pointer to the fitted data
boost::shared_array<double> m_data;
/// Pointer to the fitting weights
......@@ -160,7 +160,7 @@ protected:
// fields supporting IMDWorkspace iteration
/// maps dimension id to its index in m_dimensions
std::map<std::string,int> m_dimensionIndexMap;
std::map<std::string,size_t> m_dimensionIndexMap;
/// dimensions used in this function in the expected order
std::vector< boost::shared_ptr<const Mantid::Geometry::IMDDimension> > m_dimensions;
......
......@@ -68,7 +68,7 @@ class FunctionHandler;
for both active and declared parameters must ensure that any changes to one of them
immediately reflected on the other so that the two are consistent at any moment.
IFunctionMW declares method nameOfActive(int i) which returns the name of the declared parameter
IFunctionMW declares method nameOfActive(size_t i) which returns the name of the declared parameter
corresponding to the i-th active parameter. I am not completely sure in the usefulness of it.
IFunctionMW provides methods for tying and untying parameters. Only the declared parameters can be
......@@ -128,7 +128,7 @@ public:
virtual boost::shared_ptr<const API::Workspace> getWorkspace()const;
/// Returns the size of the fitted data (number of double values returned by the function)
virtual int dataSize()const;
virtual size_t dataSize()const;
/// Returns a reference to the fitted data. These data are taken from the workspace set by setWorkspace() method.
virtual const double* getData()const;
virtual const double* getWeights()const;
......@@ -141,11 +141,11 @@ public:
/* MatrixWorkspace specific methods */
/// Set the workspace
virtual void setMatrixWorkspace(boost::shared_ptr<const API::MatrixWorkspace> workspace, int wi, int xMin, int xMax);
virtual void setMatrixWorkspace(boost::shared_ptr<const API::MatrixWorkspace> workspace, size_t wi, size_t xMin, size_t xMax);
/// Get the workspace
virtual boost::shared_ptr<const API::MatrixWorkspace> getMatrixWorkspace()const{return m_workspace;}
/// Get workspace index
virtual int getWorkspaceIndex()const{return m_workspaceIndex;}
virtual size_t getWorkspaceIndex()const{return m_workspaceIndex;}
/// Function you want to fit to.
virtual void functionMW(double* out, const double* xValues, const size_t nData)const = 0;
......@@ -164,15 +164,15 @@ protected:
/// Convert a value from one unit (inUnit) to unit defined in workspace (ws)
double convertValue(double value, Kernel::Unit_sptr& inUnit,
boost::shared_ptr<const MatrixWorkspace> ws,
int wsIndex)const;
size_t wsIndex)const;
void convertValue(std::vector<double>& values, Kernel::Unit_sptr& outUnit,
boost::shared_ptr<const MatrixWorkspace> ws,
int wsIndex) const;
size_t wsIndex) const;
boost::shared_ptr<API::MatrixWorkspace> createCalculatedWorkspace(
boost::shared_ptr<const API::MatrixWorkspace> inWS,
int wi,
size_t wi,
const std::vector<double>& sd = std::vector<double>()
);
......@@ -182,13 +182,13 @@ protected:
/// Shared pointer to the workspace
boost::shared_ptr<const API::MatrixWorkspace> m_workspace;
/// Spectrum index
int m_workspaceIndex;
size_t m_workspaceIndex;
/// Lower bin index
int m_xMinIndex;
size_t m_xMinIndex;
/// Upper bin index
int m_xMaxIndex;
size_t m_xMaxIndex;
/// Size of the fitted data
int m_dataSize;
size_t m_dataSize;
/// Pointer to the fitted data
const double* m_data;
/// Pointer to the fitting weights
......
......@@ -67,11 +67,11 @@ public:
virtual ~ParamFunction ();
/// Set i-th parameter
virtual void setParameter(int, const double& value, bool explicitlySet = true);
virtual void setParameter(size_t, const double& value, bool explicitlySet = true);
/// Set i-th parameter description
virtual void setParameterDescription(size_t, const std::string& description);
/// Get i-th parameter
virtual double getParameter(int i)const;
virtual double getParameter(size_t i)const;
/// Set parameter by name.
virtual void setParameter(const std::string& name, const double& value, bool explicitlySet = true);
/// Set description of parameter by name.
......@@ -79,38 +79,36 @@ public:
/// Get parameter by name.
virtual double getParameter(const std::string& name)const;
/// Total number of parameters
virtual int nParams()const{return static_cast<int>(m_parameters.size());}
virtual size_t nParams()const{return m_parameters.size();}
/// Returns the index of parameter name
virtual int parameterIndex(const std::string& name)const;
/// Returns the index of a parameter
//virtual int parameterIndex(const double* p)const;
virtual size_t parameterIndex(const std::string& name)const;
/// Returns the name of parameter i
virtual std::string parameterName(int i)const;
virtual std::string parameterName(size_t i)const;
/// Returns the description of parameter i
virtual std::string parameterDescription(size_t i)const;
/// Checks if a parameter has been set explicitly
virtual bool isExplicitlySet(int i)const;
virtual bool isExplicitlySet(size_t i)const;
/// Number of active (in terms of fitting) parameters
virtual int nActive()const{return static_cast<int>(m_indexMap.size());}
virtual size_t nActive()const{return m_indexMap.size();}
/// Returns "global" index of active parameter i
virtual int indexOfActive(int i)const;
virtual size_t indexOfActive(size_t i)const;
/// Returns the name of active parameter i
virtual std::string nameOfActive(int i)const;
virtual std::string nameOfActive(size_t i)const;
/// Returns the name of active parameter i
virtual std::string descriptionOfActive(size_t i)const;
/// Check if a declared parameter i is active
virtual bool isActive(int i)const;
virtual bool isActive(size_t i)const;
/// Get active index for a declared parameter i
virtual int activeIndex(int i)const;
virtual size_t activeIndex(size_t i)const;
/// Removes a declared parameter i from the list of active
virtual void removeActive(int i);
virtual void removeActive(size_t i);
/// Restores a declared parameter i to the active status
virtual void restoreActive(int i);
virtual void restoreActive(size_t i);
/// Return parameter index from a parameter reference. Usefull for constraints and ties in composite functions
virtual int getParameterIndex(const ParameterReference& ref)const;
virtual size_t getParameterIndex(const ParameterReference& ref)const;
/// Get the containing function
IFitFunction* getContainingFunction(const ParameterReference& ref)const;
/// Get the containing function
......@@ -122,14 +120,14 @@ public:
virtual void clearTies();
virtual void removeTie(const std::string& parName){IFitFunction::removeTie(parName);}
/// Removes i-th parameter's tie
virtual bool removeTie(int i);
virtual bool removeTie(size_t i);
/// Get the tie of i-th parameter
virtual ParameterTie* getTie(int i)const;
virtual ParameterTie* getTie(size_t i)const;
/// Add a constraint to function
virtual void addConstraint(IConstraint* ic);
/// Get constraint of i-th parameter
virtual IConstraint* getConstraint(int i)const;
virtual IConstraint* getConstraint(size_t i)const;
/// Remove a constraint
virtual void removeConstraint(const std::string& parName);
/// Set parameters to satisfy constraints
......@@ -147,14 +145,14 @@ protected:
/// Add a new tie
virtual void addTie(ParameterTie* tie);
/// Get the address of the parameter. For use in UserFunction with mu::Parser
virtual double* getParameterAddress(int i);
virtual double* getParameterAddress(size_t i);
/// Nonvirtual member which removes all declared parameters
void clearAllParameters();
private:
/// The index map. m_indexMap[i] gives the total index for active parameter i
std::vector<int> m_indexMap;
std::vector<size_t> m_indexMap;
/// Keeps parameter names
std::vector<std::string> m_parameterNames;
/// Keeps parameter values
......
......@@ -87,8 +87,8 @@ void CompositeFunctionMD::functionDeriv(Jacobian* out)
// claculate numerically
double stepPercentage = DBL_EPSILON*1000; // step percentage
double step; // real step
const int nParam = nParams();
const int nData = dataSize();
const size_t nParam = nParams();
const size_t nData = dataSize();
// allocate memory if not already done
if (!m_tmpFunctionOutputMinusStep && nData>0)
......@@ -99,7 +99,7 @@ void CompositeFunctionMD::functionDeriv(Jacobian* out)
function(m_tmpFunctionOutputMinusStep.get());
for (int iP = 0; iP < nParam; iP++)
for (size_t iP = 0; iP < nParam; iP++)
{
if ( isActive(iP) )
{
......@@ -120,7 +120,7 @@ void CompositeFunctionMD::functionDeriv(Jacobian* out)
step = paramPstep - val;
setParameter(iP, val);
for (int i = 0; i < nData; i++)
for (size_t i = 0; i < nData; i++)
{
double value = (m_tmpFunctionOutputPlusStep[i]-m_tmpFunctionOutputMinusStep[i])/step;
out->set(i,iP,value);
......@@ -176,7 +176,7 @@ void CompositeFunctionMD::setWorkspace(boost::shared_ptr<const Workspace> ws,con
if (index.empty())
{
index.resize(m_workspaces.size());
int i = 0;
size_t i = 0;
std::for_each(index.begin(),index.end(),_1 = var(i)++);
}
}
......
......@@ -157,9 +157,11 @@ void CompositeFunctionMW::setWorkspace(boost::shared_ptr<const Workspace> ws,con
for(size_t iFun=0;iFun<nFunctions();iFun++)
{
IFunctionMW* fun = dynamic_cast<IFunctionMW*>(getFunction(iFun));
//fun->setWorkspace(ws, slicing, copyData); // TODO: This was added by JZ May 13, 2011, to fix tests. Does this make sense to someone who knows?
if (fun)
{
fun->setWorkspace(ws, slicing, copyData); // TODO: This was added by JZ May 13, 2011, to fix tests. Does this make sense to someone who knows?
fun->setUpNewStuff(m_xValues,m_weights);
}
}
}
......
......@@ -564,7 +564,7 @@ std::string Expression::str()const
for(size_t i=0;i<m_terms.size();i++)
{
res << m_terms[i].operator_name();
int prec1 = op_prec(m_terms[i].m_funct);
size_t prec1 = op_prec(m_terms[i].m_funct);
bool isItUnary = false;
if (m_terms[i].size() == 1 && is_unary(m_terms[i].m_funct))
{
......
......@@ -51,7 +51,7 @@ void IFitFunction::functionDeriv(Jacobian* out)
void IFitFunction::updateActive(const double* in)
{
if (in)
for(int i=0;i<nActive();i++)
for(size_t i=0;i<nActive();i++)
{
setActiveParameter(i,in[i]);