Skip to content

Commit

Permalink
Rename to LeBailFunction. Refs #5306.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Jul 6, 2012
1 parent 51df210 commit 3c7eac6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef MANTID_CURVEFITTING_LEBAILFIT_H_
#define MANTID_CURVEFITTING_LEBAILFIT_H_
#ifndef MANTID_CURVEFITTING_LEBAILFUNCTION_H_
#define MANTID_CURVEFITTING_LEBAILFUNCTION_H_

#include "MantidKernel/System.h"
#include "MantidAPI/ParamFunction.h"
Expand All @@ -12,7 +12,7 @@ namespace Mantid
namespace CurveFitting
{

/** LeBailFit : LeBail Fit
/** LeBailFunction : LeBail Fit
*
Prototype: mainly focussed on the workflow
Expand Down Expand Up @@ -40,11 +40,11 @@ namespace CurveFitting
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport LeBailFit : public API::ParamFunction, public API::IFunction1D, public API::IFunctionMW
class DLLExport LeBailFunction : public API::ParamFunction, public API::IFunction1D, public API::IFunctionMW
{
public:
LeBailFit();
virtual ~LeBailFit();
LeBailFunction();
virtual ~LeBailFunction();

virtual std::string name() const;

Expand Down Expand Up @@ -91,4 +91,4 @@ namespace CurveFitting
} // namespace CurveFitting
} // namespace Mantid

#endif /* MANTID_CURVEFITTING_LEBAILFIT_H_ */
#endif /* MANTID_CURVEFITTING_LEBAILFUNCTION_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "MantidCurveFitting/LeBailFit.h"
#include "MantidCurveFitting/LeBailFunction.h"
#include "MantidKernel/System.h"
#include "MantidCurveFitting/ThermoNeutronBackToBackExpPV.h"
#include "MantidAPI/FunctionFactory.h"
Expand All @@ -11,15 +11,15 @@ namespace Mantid
namespace CurveFitting
{

DECLARE_FUNCTION(LeBailFit)
DECLARE_FUNCTION(LeBailFunction)

// Get a reference to the logger
Mantid::Kernel::Logger& LeBailFit::g_log = Kernel::Logger::get("LeBailFit");
Mantid::Kernel::Logger& LeBailFunction::g_log = Kernel::Logger::get("LeBailFunction");

//----------------------------------------------------------------------------------------------
/** Constructor
*/
LeBailFit::LeBailFit()
LeBailFunction::LeBailFunction()
{
mL1 = 1.0;
mL2 = 0.0;
Expand All @@ -31,16 +31,16 @@ namespace CurveFitting
//----------------------------------------------------------------------------------------------
/** Destructor
*/
LeBailFit::~LeBailFit()
LeBailFunction::~LeBailFunction()
{
}

std::string LeBailFit::name() const
std::string LeBailFunction::name() const
{
return "LeBailFit";
return "LeBailFunction";
}

void LeBailFit::init()
void LeBailFunction::init()
{
declareParameter("Dtt1", 1.0);
declareParameter("Dtt2", 1.0);
Expand Down Expand Up @@ -73,7 +73,7 @@ namespace CurveFitting
return;
}

void LeBailFit::calPeakParametersForD(double dh, double& alpha, double& beta, double &Tof_h,
void LeBailFunction::calPeakParametersForD(double dh, double& alpha, double& beta, double &Tof_h,
double &sigma_g2, double &gamma_l, std::map<std::string, double>& parmap) const
{
// 1. Get some parameters
Expand Down Expand Up @@ -110,7 +110,7 @@ namespace CurveFitting
return;
}

void LeBailFit::function1D(double *out, const double *xValues, size_t nData) const
void LeBailFunction::function1D(double *out, const double *xValues, size_t nData) const
{
// 1. Get parameters (class)
Alph0 = getParameter("Alph0");
Expand Down Expand Up @@ -168,7 +168,7 @@ namespace CurveFitting
return;
}

void LeBailFit::functionDeriv(const API::FunctionDomain &domain, API::Jacobian &jacobian)
void LeBailFunction::functionDeriv(const API::FunctionDomain &domain, API::Jacobian &jacobian)
{
calNumericalDeriv(domain, jacobian);
return;
Expand All @@ -177,15 +177,15 @@ namespace CurveFitting
/*
* Analytical
*/
void LeBailFit::functionDeriv1D(API::Jacobian *out, const double* xValues, const size_t nData)
void LeBailFunction::functionDeriv1D(API::Jacobian *out, const double* xValues, const size_t nData)
{
throw std::runtime_error("LeBailFit does not support analytical derivative. ");
throw std::runtime_error("LeBailFunction does not support analytical derivative. ");
}

/*
* Add a peak with its d-value
*/
void LeBailFit::setPeak(double dh, double height)
void LeBailFunction::setPeak(double dh, double height)
{
dvalues.push_back(dh);
heights.push_back(height);
Expand All @@ -198,14 +198,14 @@ namespace CurveFitting
/*
* A public function API for function1D
*/
void LeBailFit::calPeaks(double* out, const double* xValues, const size_t nData)
void LeBailFunction::calPeaks(double* out, const double* xValues, const size_t nData)
{
this->function1D(out, xValues, nData);

return;
}

double LeBailFit::getPeakParameter(size_t index, std::string parname) const
double LeBailFunction::getPeakParameter(size_t index, std::string parname) const
{
if (index >= mPeakParameters.size())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
#include <iomanip>
#include <fstream>

#include "MantidCurveFitting/LeBailFit.h"
#include "MantidCurveFitting/LeBailFunction.h"

using namespace Mantid;
using namespace Mantid::CurveFitting;
using namespace Mantid::API;

class LeBailFitTest : public CxxTest::TestSuite
class LeBailFunctionTest : public CxxTest::TestSuite
{
public:
// This pair of boilerplate methods prevent the suite being created statically
// This means the constructor isn't called when running other tests
static LeBailFitTest *createSuite() { return new LeBailFitTest(); }
static void destroySuite( LeBailFitTest *suite ) { delete suite; }
static LeBailFunctionTest *createSuite() { return new LeBailFunctionTest(); }
static void destroySuite( LeBailFunctionTest *suite ) { delete suite; }


void test_Something()
Expand All @@ -29,7 +29,7 @@ class LeBailFitTest : public CxxTest::TestSuite
}

/*
* Goal: test function1D() of LeBailFit by plotting 2 adjacent peaks
* Goal: test function1D() of LeBailFunction by plotting 2 adjacent peaks
* Input
* (1) Instrument geometry parameters Dtt1, Dtt1t, Zero, ... from .prf file;
* (2) Base peak parameters Alph0, Alph1, ... from .prf file
Expand All @@ -45,7 +45,7 @@ class LeBailFitTest : public CxxTest::TestSuite
*/
void test_Plot2Peaks()
{
LeBailFit fitalg;
LeBailFunction fitalg;
fitalg.initialize();

// 1. Set up parameters
Expand Down

0 comments on commit 3c7eac6

Please sign in to comment.