Skip to content

Commit

Permalink
Re #9199. Implement iterationStarting() method on M-D-Function
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-roman committed Apr 2, 2014
1 parent 40e59eb commit 06c77ee
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/MultiDomainFunction.h
Expand Up @@ -54,6 +54,10 @@ class MANTID_API_DLL MultiDomainFunction : public CompositeFunction
virtual void function(const FunctionDomain& domain, FunctionValues& values)const;
/// Derivatives of function with respect to active parameters
virtual void functionDeriv(const FunctionDomain& domain, Jacobian& jacobian);
/// Called at the start of each iteration
virtual void iterationStarting();
/// Called at the end of an iteration
virtual void iterationFinished();

/// Associate a function and a domain
void setDomainIndex(size_t funIndex, size_t domainIndex);
Expand Down
22 changes: 22 additions & 0 deletions Code/Mantid/Framework/API/src/MultiDomainFunction.cpp
Expand Up @@ -177,6 +177,28 @@ namespace API
}
}

/**
* Called at the start of each iteration. Call iterationStarting() of the members.
*/
void MultiDomainFunction::iterationStarting()
{
for(size_t iFun = 0; iFun < nFunctions(); ++iFun)
{
getFunction(iFun)->iterationStarting();
}
}

/**
* Called at the end of an iteration. Call iterationFinished() of the members.
*/
void MultiDomainFunction::iterationFinished()
{
for(size_t iFun = 0; iFun < nFunctions(); ++iFun)
{
getFunction(iFun)->iterationFinished();
}
}

/// Return a value of attribute attName
IFunction::Attribute MultiDomainFunction::getLocalAttribute(size_t i, const std::string& attName)const
{
Expand Down

0 comments on commit 06c77ee

Please sign in to comment.