/// Function you want to fit to. /// @param domain :: The buffer for writing the calculated values. Must be big enough to accept dataSize() values void ProductFunction::function(const FunctionDomain& domain, FunctionValues& values)const { FunctionValues tmp(domain); values.setCalculated(1.0); for(size_t iFun = 0; iFun < nFunctions(); ++iFun) { m_functions[ iFun ]->function(domain,tmp); values *= tmp; } }
/** * Performs the function evaluations on the domain * * @param domain :: The MD domain to evaluate the function * @param values :: The computed values */ void IFunctionMD::evaluateFunction(const FunctionDomainMD& domain,FunctionValues& values) const { domain.reset(); size_t i=0; for(const IMDIterator* r = domain.getNextIterator(); r != NULL; r = domain.getNextIterator()) { this->reportProgress("Evaluating function for box " + boost::lexical_cast<std::string>(i+1)); values.setCalculated(i,functionMD(*r)); i++; }; }
/// Function you want to fit to. /// @param domain :: The domain void FunctionComposition::function(const FunctionDomain& domain, FunctionValues& values)const { FunctionValues tmp(domain); values.setCalculated(1.0); for(size_t iFun = 0; iFun < nFunctions(); ++iFun) { FunctionDomain1DView view(tmp.getPointerToCalculated(0),domain.size()); if ( iFun == 0 ) { m_functions[ iFun ]->function(domain,tmp); } else { } } }