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

Re #18518. Changed back param ref index to be local.

parent e9a143f4
......@@ -5,6 +5,7 @@
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/DllConfig.h"
#include <string>
namespace Mantid {
namespace API {
......@@ -41,18 +42,27 @@ class MANTID_API_DLL ParameterReference {
public:
ParameterReference();
ParameterReference(IFunction *fun, std::size_t index, bool isDefault = false);
std::size_t getIndex() const;
void reset(IFunction *fun, std::size_t index, bool isDefault = false);
void setParameter(const double &value);
void setParameter(const double &value, bool isExplicitlySet = true);
double getParameter() const;
IFunction *getFunction() const;
bool isDefault() const;
bool isParameterOf(const IFunction *fun) const;
virtual ~ParameterReference() = default;
IFunction *getLocalFunction() const;
std::size_t getLocalIndex() const;
std::size_t parameterIndex() const;
std::string parameterName() const;
protected:
void reset(IFunction *fun, std::size_t index, bool isDefault = false);
private:
IFunction *m_function; ///< pointer to the function
std::size_t m_index; ///< parameter index
/// Function-owner of this reference. parameterName() and parameterIndex()
/// return values relative to this function.
IFunction *m_owner;
/// Function that together with m_index uniquely identify the parameter.
IFunction *m_function;
/// Index of the parameter in m_function. It is assumed that this index
/// uniquely identifies the parameter withing m_function
std::size_t m_index;
/// Flag to mark as default the value of an object associated with this
/// reference: a tie or a constraint.
bool m_isDefault;
......
......@@ -409,7 +409,7 @@ void CompositeFunction::removeFunction(size_t i) {
}
IFunction_sptr fun = getFunction(i);
// Reduction in parameters
size_t dnp = fun->nParams();
for (size_t j = 0; j < nParams();) {
......@@ -420,6 +420,10 @@ void CompositeFunction::removeFunction(size_t i) {
j++;
}
}
// Number of parameters in functions preceding the removed one.
// Indices of those parameters won't change
size_t nParamsBeforeRemoved = m_paramOffsets[i];
//
// Shift down the function indeces for parameters
for (auto it = m_IFunction.begin(); it != m_IFunction.end();) {
......@@ -724,8 +728,8 @@ bool CompositeFunction::isExplicitlySet(size_t i) const {
*/
size_t
CompositeFunction::getParameterIndex(const ParameterReference &ref) const {
if (ref.getFunction() == this && ref.getIndex() < nParams()) {
return ref.getIndex();
if (ref.getLocalFunction() == this && ref.getLocalIndex() < nParams()) {
return ref.getLocalIndex();
}
for (size_t iFun = 0; iFun < nFunctions(); iFun++) {
IFunction_sptr fun = getFunction(iFun);
......
......@@ -180,8 +180,8 @@ size_t FunctionParameterDecorator::getParameterIndex(
return m_wrappedFunction->getParameterIndex(ref);
}
if (ref.getFunction() == this && ref.getIndex() < nParams()) {
return ref.getIndex();
if (ref.getLocalFunction() == this && ref.getLocalIndex() < nParams()) {
return ref.getLocalIndex();
}
return nParams();
......
......@@ -170,6 +170,7 @@ std::string IFunction::writeTies() const {
std::ostringstream tieStream;
bool first = true;
for(auto &tie: m_ties) {
if (tie->isDefault()) continue;
if (!first) {
tieStream << ',';
} else {
......@@ -276,10 +277,10 @@ void IFunction::clearTies() {
* @param ic :: Pointer to a constraint.
*/
void IFunction::addConstraint(std::unique_ptr<IConstraint> ic) {
size_t iPar = ic->getIndex();
size_t iPar = ic->parameterIndex();
bool found = false;
for (auto &constraint : m_constraints) {
if (constraint->getIndex() == iPar) {
if (constraint->parameterIndex() == iPar) {
found = true;
constraint = std::move(ic);
break;
......@@ -312,7 +313,7 @@ IConstraint *IFunction::getConstraint(size_t i) const {
void IFunction::removeConstraint(const std::string &parName) {
size_t iPar = parameterIndex(parName);
for (auto it = m_constraints.begin(); it != m_constraints.end(); ++it) {
if (iPar == (**it).getIndex()) {
if (iPar == (**it).getLocalIndex()) {
m_constraints.erase(it);
break;
}
......@@ -337,6 +338,7 @@ std::string IFunction::writeConstraints() const {
std::ostringstream stream;
bool first = true;
for(auto &constrint: m_constraints) {
if (constrint->isDefault()) continue;
if (!first) {
stream << ',';
} else {
......
......@@ -291,8 +291,8 @@ bool ParamFunction::isExplicitlySet(size_t i) const {
* @return Parameter index or number of nParams() if parameter not found
*/
size_t ParamFunction::getParameterIndex(const ParameterReference &ref) const {
if (ref.getFunction() == this && ref.getIndex() < nParams()) {
return ref.getIndex();
if (ref.getLocalFunction() == this && ref.getLocalIndex() < nParams()) {
return ref.getLocalIndex();
}
return nParams();
}
......
......@@ -6,7 +6,7 @@ namespace API {
/// Default constructor
ParameterReference::ParameterReference()
: m_function(), m_index(0), m_isDefault(false) {}
: m_owner(), m_function(), m_index(0), m_isDefault(false) {}
/**
* Constructor.
......@@ -18,15 +18,27 @@ ParameterReference::ParameterReference()
*/
ParameterReference::ParameterReference(IFunction *fun, std::size_t index,
bool isDefault)
: m_function(fun), m_index(index), m_isDefault(isDefault) {
: m_owner(fun), m_function(fun), m_index(index), m_isDefault(isDefault) {
reset(fun, index, isDefault);
}
/// Return pointer to the function
IFunction *ParameterReference::getFunction() const { return m_function; }
/// Return pointer to the local function
IFunction *ParameterReference::getLocalFunction() const { return m_function; }
/// Return parameter index in that function
std::size_t ParameterReference::getIndex() const { return m_index; }
/// Return parameter index in the local function
std::size_t ParameterReference::getLocalIndex() const {
return m_index;
}
/// Return parameter index in the owning function
std::size_t ParameterReference::parameterIndex() const {
return m_owner->getParameterIndex(*this);
}
/// Return parameter name in the owning function
std::string ParameterReference::parameterName() const {
return m_owner->parameterName(parameterIndex());
}
/**
* Reset the reference
......@@ -38,22 +50,20 @@ std::size_t ParameterReference::getIndex() const { return m_index; }
*/
void ParameterReference::reset(IFunction *fun, std::size_t index,
bool isDefault) {
//IFunction *fLocal = fun;
//size_t iLocal = index;
//CompositeFunction *cf = dynamic_cast<CompositeFunction *>(fun);
//while (cf) {
// size_t iFun =
// cf->functionIndex(iLocal); // TODO squashing the warning breaks the code
// fLocal = cf->getFunction(iFun).get();
// iLocal = fLocal->parameterIndex(cf->parameterLocalName(iLocal));
// cf = dynamic_cast<CompositeFunction *>(fLocal);
//}
m_owner = fun;
IFunction *fLocal = fun;
size_t iLocal = index;
CompositeFunction *cf = dynamic_cast<CompositeFunction *>(fun);
while (cf) {
size_t iFun =
cf->functionIndex(iLocal); // TODO squashing the warning breaks the code
fLocal = cf->getFunction(iFun).get();
iLocal = fLocal->parameterIndex(cf->parameterLocalName(iLocal));
cf = dynamic_cast<CompositeFunction *>(fLocal);
}
//m_function = fLocal;
//m_index = iLocal;
//m_isDefault = isDefault;
m_function = fun;
m_index = index;
m_function = fLocal;
m_index = iLocal;
m_isDefault = isDefault;
}
......@@ -61,8 +71,8 @@ void ParameterReference::reset(IFunction *fun, std::size_t index,
* Set the parameter
* @param value :: A value to set.
*/
void ParameterReference::setParameter(const double &value) {
m_function->setParameter(m_index, value);
void ParameterReference::setParameter(const double &value, bool isExplicitlySet) {
m_function->setParameter(m_index, value, isExplicitlySet);
}
/// Get the value of the parameter
......
......@@ -279,10 +279,14 @@ public:
icf.addTies("b2=b1,a2=a1/5");
icf.applyTies();
auto icfString = icf.asString();
TS_ASSERT_EQUALS(
icf.asString(),
icfString.substr(0, 78),
"name=ImmutableCompositeFunctionTest_"
"Function,NumDeriv=false,a1=11,b1=12,a2=2.2,b2=12,ties=(a2=a1/5,b2=b1)");
"Function,NumDeriv=false,a1=11,b1=12,ties=(");
auto icfTies = icfString.substr(78);
TS_ASSERT(icfTies.find("a2=a1/5") != std::string::npos)
TS_ASSERT(icfTies.find("b2=b1") != std::string::npos)
auto fun = FunctionFactory::Instance().createInitialized(icf.asString());
TS_ASSERT(fun);
......@@ -308,8 +312,7 @@ public:
TS_ASSERT_EQUALS(icf.getParameter(3), 1.0);
TS_ASSERT_EQUALS(icf.asString(), "name=ImmutableCompositeFunctionTest_"
"FunctionWithTies,NumDeriv=false,a1=1,b1="
"2,a2=0.25,b2=1");
"FunctionWithTies,NumDeriv=false,a1=1,b1=2");
auto fun = FunctionFactory::Instance().createInitialized(icf.asString());
TS_ASSERT(fun);
......
......@@ -86,37 +86,37 @@ public:
TS_ASSERT_EQUALS(f1->getContainingFunction(r12), f1_2);
TS_ASSERT_EQUALS(f1_2->getContainingFunction(r12), f1_2_1);
TS_ASSERT_EQUALS(r0.getFunction(), f0.get());
TS_ASSERT_EQUALS(r1.getFunction(), f0.get());
TS_ASSERT_EQUALS(r2.getFunction(), f0.get());
TS_ASSERT_EQUALS(r0.getLocalFunction(), f0.get());
TS_ASSERT_EQUALS(r1.getLocalFunction(), f0.get());
TS_ASSERT_EQUALS(r2.getLocalFunction(), f0.get());
TS_ASSERT_EQUALS(r0.getIndex(), 0);
TS_ASSERT_EQUALS(r1.getIndex(), 1);
TS_ASSERT_EQUALS(r2.getIndex(), 2);
TS_ASSERT_EQUALS(r0.getLocalIndex(), 0);
TS_ASSERT_EQUALS(r1.getLocalIndex(), 1);
TS_ASSERT_EQUALS(r2.getLocalIndex(), 2);
TS_ASSERT_EQUALS(r3.getFunction(), f1_0.get());
TS_ASSERT_EQUALS(r4.getFunction(), f1_0.get());
TS_ASSERT_EQUALS(r5.getFunction(), f1_0.get());
TS_ASSERT_EQUALS(r3.getLocalFunction(), f1_0.get());
TS_ASSERT_EQUALS(r4.getLocalFunction(), f1_0.get());
TS_ASSERT_EQUALS(r5.getLocalFunction(), f1_0.get());
TS_ASSERT_EQUALS(r3.getIndex(), 0);
TS_ASSERT_EQUALS(r4.getIndex(), 1);
TS_ASSERT_EQUALS(r5.getIndex(), 2);
TS_ASSERT_EQUALS(r3.getLocalIndex(), 0);
TS_ASSERT_EQUALS(r4.getLocalIndex(), 1);
TS_ASSERT_EQUALS(r5.getLocalIndex(), 2);
TS_ASSERT_EQUALS(r6.getFunction(), f1_1.get());
TS_ASSERT_EQUALS(r7.getFunction(), f1_1.get());
TS_ASSERT_EQUALS(r8.getFunction(), f1_1.get());
TS_ASSERT_EQUALS(r6.getLocalFunction(), f1_1.get());
TS_ASSERT_EQUALS(r7.getLocalFunction(), f1_1.get());
TS_ASSERT_EQUALS(r8.getLocalFunction(), f1_1.get());
TS_ASSERT_EQUALS(r6.getIndex(), 0);
TS_ASSERT_EQUALS(r7.getIndex(), 1);
TS_ASSERT_EQUALS(r8.getIndex(), 2);
TS_ASSERT_EQUALS(r6.getLocalIndex(), 0);
TS_ASSERT_EQUALS(r7.getLocalIndex(), 1);
TS_ASSERT_EQUALS(r8.getLocalIndex(), 2);
TS_ASSERT_EQUALS(r9.getFunction(), f1_2_0.get());
TS_ASSERT_EQUALS(r10.getFunction(), f1_2_0.get());
TS_ASSERT_EQUALS(r11.getFunction(), f1_2_0.get());
TS_ASSERT_EQUALS(r9.getLocalFunction(), f1_2_0.get());
TS_ASSERT_EQUALS(r10.getLocalFunction(), f1_2_0.get());
TS_ASSERT_EQUALS(r11.getLocalFunction(), f1_2_0.get());
TS_ASSERT_EQUALS(r9.getIndex(), 0);
TS_ASSERT_EQUALS(r10.getIndex(), 1);
TS_ASSERT_EQUALS(r11.getIndex(), 2);
TS_ASSERT_EQUALS(r9.getLocalIndex(), 0);
TS_ASSERT_EQUALS(r10.getLocalIndex(), 1);
TS_ASSERT_EQUALS(r11.getLocalIndex(), 2);
delete cf;
}
......
......@@ -118,8 +118,8 @@ public:
TS_ASSERT_EQUALS(tie.asString(&mfun), "f1.sig=f2.sig^2+f0.a+1");
TS_ASSERT_DELTA(tie.eval(), 5.8, 0.00001);
TS_ASSERT_EQUALS(tie.getFunction(), g1.get());
TS_ASSERT_EQUALS(tie.getIndex(), 2);
TS_ASSERT_EQUALS(tie.getLocalFunction(), g1.get());
TS_ASSERT_EQUALS(tie.getLocalIndex(), 2);
TS_ASSERT_THROWS(mustThrow1(&mfun), std::invalid_argument);
TS_ASSERT_THROWS(mustThrow2(&mfun), std::invalid_argument);
......@@ -144,8 +144,8 @@ public:
TS_ASSERT_EQUALS(tie.asString(&mfun), "f0.b=f3.sig^2+f1.a+1");
TS_ASSERT_DELTA(tie.eval(), 2, 0.00001);
TS_ASSERT_EQUALS(tie.getFunction(), bk1.get());
TS_ASSERT_EQUALS(tie.getIndex(), 1);
TS_ASSERT_EQUALS(tie.getLocalFunction(), bk1.get());
TS_ASSERT_EQUALS(tie.getLocalIndex(), 1);
mfun.removeFunction(2);
TS_ASSERT_EQUALS(tie.asString(&mfun), "f0.b=f2.sig^2+f1.a+1");
......@@ -213,7 +213,7 @@ public:
ParameterTie tie(&bk, "b", "2*a-1");
TS_ASSERT_EQUALS(tie.getIndex(), 1);
TS_ASSERT_EQUALS(tie.getLocalIndex(), 1);
TS_ASSERT_DELTA(tie.eval(), 0.6, 0.00001);
TS_ASSERT_THROWS(mustThrow4(&bk), std::invalid_argument);
TS_ASSERT_THROWS(mustThrow5(&bk), std::invalid_argument);
......
......@@ -109,7 +109,7 @@ public:
}
/// Get parameter name
std::string getParameterName() const { return m_parameterName; }
// std::string getParameterName() const { return m_parameterName; }
/// overwrite IConstraint base class methods
double check() override;
......@@ -123,7 +123,7 @@ private:
double m_penaltyFactor;
/// name of parameter you want to constraint
std::string m_parameterName;
//std::string m_parameterName;
/// has a lower bound set true/false
bool m_hasLowerBound;
......
......@@ -25,14 +25,14 @@ using namespace API;
/// Default constructor
BoundaryConstraint::BoundaryConstraint()
: API::IConstraint(), m_penaltyFactor(1000.0), m_parameterName(""),
: API::IConstraint(), m_penaltyFactor(1000.0),
m_hasLowerBound(false), m_hasUpperBound(false), m_lowerBound(DBL_MAX),
m_upperBound(-DBL_MAX) {}
/// Constructor with no boundary arguments
/// @param paramName :: The parameter name
BoundaryConstraint::BoundaryConstraint(const std::string &paramName)
: API::IConstraint(), m_penaltyFactor(1000.0), m_parameterName(paramName),
: API::IConstraint(), m_penaltyFactor(1000.0),
m_hasLowerBound(false), m_hasUpperBound(false) {}
/** Constructor with boundary arguments
......@@ -48,19 +48,19 @@ BoundaryConstraint::BoundaryConstraint(API::IFunction *fun,
const std::string paramName,
const double lowerBound,
const double upperBound, bool isDefault)
: m_penaltyFactor(1000.0), m_parameterName(paramName),
: m_penaltyFactor(1000.0),
m_hasLowerBound(true), m_hasUpperBound(true), m_lowerBound(lowerBound),
m_upperBound(upperBound) {
//reset(fun, fun->parameterIndex(paramName), isDefault);
reset(fun, fun->parameterIndex(paramName), isDefault);
}
BoundaryConstraint::BoundaryConstraint(API::IFunction *fun,
const std::string paramName,
const double lowerBound, bool isDefault)
: m_penaltyFactor(1000.0), m_parameterName(paramName),
: m_penaltyFactor(1000.0),
m_hasLowerBound(true), m_hasUpperBound(false), m_lowerBound(lowerBound),
m_upperBound(-DBL_MAX) {
//reset(fun, fun->parameterIndex(paramName), isDefault);
reset(fun, fun->parameterIndex(paramName), isDefault);
}
/** Initialize the constraint from an expression.
......@@ -127,7 +127,6 @@ void BoundaryConstraint::initialize(API::IFunction *fun,
try {
size_t i = fun->parameterIndex(parName);
reset(fun, i, isDefault);
m_parameterName = parName;
} catch (...) {
g_log.error() << "Parameter " << parName << " not found in function "
<< fun->name() << '\n';
......@@ -160,31 +159,31 @@ void BoundaryConstraint::setParamToSatisfyConstraint() {
if (!(m_hasLowerBound || m_hasUpperBound)) {
g_log.warning()
<< "No bounds have been set on BoundaryConstraint for parameter "
<< m_parameterName << ". Therefore"
<< parameterName() << ". Therefore"
<< " this constraint serves no purpose!";
return;
}
double paramValue = getFunction()->getParameter(getIndex());
double paramValue = getParameter();
if (m_hasLowerBound)
if (paramValue < m_lowerBound)
getFunction()->setParameter(getIndex(), m_lowerBound, false);
setParameter(m_lowerBound, false);
if (m_hasUpperBound)
if (paramValue > m_upperBound)
getFunction()->setParameter(getIndex(), m_upperBound, false);
setParameter(m_upperBound, false);
}
double BoundaryConstraint::check() {
if (!(m_hasLowerBound || m_hasUpperBound)) {
g_log.warning()
<< "No bounds have been set on BoundaryConstraint for parameter "
<< m_parameterName << ". Therefore"
<< parameterName() << ". Therefore"
<< " this constraint serves no purpose!";
return 0.0;
}
double paramValue = getFunction()->getParameter(getIndex());
double paramValue = getParameter();
double penalty = 0.0;
......@@ -212,7 +211,7 @@ double BoundaryConstraint::checkDeriv() {
return penalty;
}
double paramValue = getFunction()->getParameter(getIndex());
double paramValue = getParameter();
if (m_hasLowerBound)
if (paramValue < m_lowerBound) {
......@@ -238,7 +237,7 @@ double BoundaryConstraint::checkDeriv2() {
return penalty;
}
double paramValue = getFunction()->getParameter(getIndex());
double paramValue = getParameter();
if (m_hasLowerBound)
if (paramValue < m_lowerBound)
......@@ -255,7 +254,7 @@ std::string BoundaryConstraint::asString() const {
if (m_hasLowerBound) {
ostr << m_lowerBound << '<';
}
ostr << getFunction()->parameterName(getIndex());
ostr << parameterName();
if (m_hasUpperBound) {
ostr << '<' << m_upperBound;
}
......
......@@ -158,8 +158,8 @@ void FunctionGenerator::unfix(size_t i) {
/// Return parameter index from a parameter reference.
size_t
FunctionGenerator::getParameterIndex(const ParameterReference &ref) const {
if (ref.getFunction() == this) {
auto index = ref.getIndex();
if (ref.getLocalFunction() == this) {
auto index = ref.getLocalIndex();
auto np = nParams();
if (index < np) {
return index;
......
......@@ -22,39 +22,39 @@ using namespace Mantid::CurveFitting::Constraints;
class BoundaryConstraintTest : public CxxTest::TestSuite {
public:
void test1() {
// set up fitting function
Gaussian gaus;
gaus.initialize();
gaus.setCentre(11.2);
gaus.setHeight(100.7);
gaus.setParameter("Sigma", 1.1);
//void test1() {
// // set up fitting function
// Gaussian gaus;
// gaus.initialize();
// gaus.setCentre(11.2);
// gaus.setHeight(100.7);
// gaus.setParameter("Sigma", 1.1);
BoundaryConstraint bc;
bc.reset(&gaus, 2);
// BoundaryConstraint bc;
// bc.reset(&gaus, 2);
TS_ASSERT(!bc.hasLower());
TS_ASSERT(!bc.hasUpper());
// TS_ASSERT(!bc.hasLower());
// TS_ASSERT(!bc.hasUpper());
bc.setLower(1.0);
bc.setUpper(2.0);
// bc.setLower(1.0);
// bc.setUpper(2.0);
TS_ASSERT(bc.hasLower());
TS_ASSERT(bc.hasUpper());
// TS_ASSERT(bc.hasLower());
// TS_ASSERT(bc.hasUpper());
BoundaryConstraint bc2;
// BoundaryConstraint bc2;
bc2.reset(&gaus, 2);
bc2.setBounds(10, 20);
// bc2.reset(&gaus, 2);
// bc2.setBounds(10, 20);
TS_ASSERT_DELTA(bc2.lower(), 10, 0.0001);
TS_ASSERT_DELTA(bc2.upper(), 20, 0.0001);
// TS_ASSERT_DELTA(bc2.lower(), 10, 0.0001);
// TS_ASSERT_DELTA(bc2.upper(), 20, 0.0001);
TS_ASSERT_DELTA(gaus.getParameter("Sigma"), 1.1, 0.0001);
// TS_ASSERT_DELTA(gaus.getParameter("Sigma"), 1.1, 0.0001);
bc2.setParamToSatisfyConstraint();
TS_ASSERT_DELTA(gaus.getParameter("Sigma"), 10.0, 0.0001);
}
// bc2.setParamToSatisfyConstraint();
// TS_ASSERT_DELTA(gaus.getParameter("Sigma"), 10.0, 0.0001);
//}
void testInitialize1() {
Gaussian gaus;
......@@ -64,7 +64,7 @@ public:
expr.parse("10<Sigma<20");
bc.initialize(&gaus, expr, false);
TS_ASSERT_EQUALS(bc.getParameterName(), "Sigma");
TS_ASSERT_EQUALS(bc.parameterName(), "Sigma");
TS_ASSERT_DELTA(bc.lower(), 10, 0.0001);
TS_ASSERT_DELTA(bc.upper(), 20, 0.0001);
}
......@@ -77,7 +77,7 @@ public:
expr.parse("20>Sigma>10");
bc.initialize(&gaus, expr, false);
TS_ASSERT_EQUALS(bc.getParameterName(), "Sigma");
TS_ASSERT_EQUALS(bc.parameterName(), "Sigma");
TS_ASSERT_DELTA(bc.lower(), 10, 0.0001);
TS_ASSERT_DELTA(bc.upper(), 20, 0.0001);
}
......@@ -90,7 +90,7 @@ public:
expr.parse("10<Sigma");
bc.initialize(&gaus, expr, false);
TS_ASSERT_EQUALS(bc.getParameterName(), "Sigma");
TS_ASSERT_EQUALS(bc.parameterName(), "Sigma");
TS_ASSERT_DELTA(bc.lower(), 10, 0.0001);
TS_ASSERT(!bc.hasUpper());
}
......@@ -103,7 +103,7 @@ public:
expr.parse("Sigma<20");
bc.initialize(&gaus, expr, false);
TS_ASSERT_EQUALS(bc.getParameterName(), "Sigma");
TS_ASSERT_EQUALS(bc.parameterName(), "Sigma");
TS_ASSERT_DELTA(bc.upper(), 20, 0.0001);
TS_ASSERT(!bc.hasLower());
}
......@@ -134,8 +134,8 @@ public:
TS_ASSERT(bc.hasLower());
TS_ASSERT(!bc.hasUpper());
TS_ASSERT_EQUALS(bc.lower(), 0.0);
TS_ASSERT_EQUALS(bc.getParameterName(), "Sigma");
TS_ASSERT_EQUALS(bc.getFunction(), &gaus);
TS_ASSERT_EQUALS(bc.parameterName(), "Sigma");
TS_ASSERT_EQUALS(bc.getLocalFunction(), &gaus);