60 typename std::vector<T*>::const_iterator funcIt = functionVec_.begin();
61 for( ; funcIt != functionVec_.end(); ++funcIt ) {
62 totParNums += (*funcIt)->parNum();
65 int functionVecSize = functionVec_.size();
67 std::cout <<
"Error: inconsistent number of functions("<<functionVecSize<<
") and iterations("<<
iterationNum_+1<<
")" << std::endl;
70 else if( totParNums != parVecVecSize ) {
71 std::cout <<
"Error: inconsistent total number of requested parameters("<<totParNums<<
") and parameters read("<<parVecVecSize<<
")" << std::endl;
88 function_ =
new T*[functionVecSize];
89 typename std::vector<T * >::const_iterator func = functionVec_.begin();
90 std::vector<double>::const_iterator parVec =
parVecVec_.begin();
92 int iterationCounter = 0;
93 for( ; func != functionVec_.end(); ++func, ++iterationCounter ) {
96 int parNum = (*func)->parNum();
97 parArray_[iterationCounter] =
new double[parNum];
98 for(
int par = 0; par < parNum; ++par ) {
99 parArray_[iterationCounter][par] = *parVec;
112 function_[iterationCounter] = *func;
116 #endif // BaseFunction_h
BaseFunction(const MuScleFitDBobject *dbObject)
Constructor when receiving database parameters.
std::vector< int > identifiers() const
Return the vector of function identifiers.
std::vector< double > parVecVec_
void convertToArrays(T **&function_, const std::vector< T * > &functionVec_)
Convert vectors to arrays for faster random access. The first pointer is replaced, thus it is taken by reference.
std::vector< double > fitQuality() const
Return the vector of fit quality values.
std::vector< double > fitQuality_
double ** fitQualityArray_
std::vector< int > identifiers
std::vector< int > functionId_
std::vector< double > parameters() const
Return the vector of parameters.
std::vector< double > parameters