Skip to content
Snippets Groups Projects
Commit 4ad73191 authored by Michael Wedel's avatar Michael Wedel
Browse files

Refs #11043. Implementing function

parent 492aff6d
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,6 @@
#include "MantidKernel/System.h"
#include "MantidAPI/CompositeFunction.h"
#include "MantidAPI/FunctionParameterDecorator.h"
#include "MantidAPI/IFunction1D.h"
#include "MantidAPI/IPeakFunction.h"
#include "MantidAPI/ParamFunction.h"
......@@ -92,8 +91,7 @@ typedef boost::shared_ptr<PawleyParameterFunction> PawleyParameterFunction_sptr;
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class PawleyFunction : public API::IFunction1D,
public API::FunctionParameterDecorator {
class PawleyFunction : public API::FunctionParameterDecorator {
public:
PawleyFunction();
virtual ~PawleyFunction() {}
......@@ -103,9 +101,8 @@ public:
void setCrystalSystem(const std::string &crystalSystem);
void setProfileFunction(const std::string &profileFunction);
void function1D(double *out, const double *xValues, const size_t nData) const;
void functionDeriv1D(API::Jacobian *out, const double *xValues,
const size_t nData);
void function(const API::FunctionDomain &domain,
API::FunctionValues &values) const;
void functionDeriv(const API::FunctionDomain &domain,
API::Jacobian &jacobian) {
calNumericalDeriv(domain, jacobian);
......
......@@ -184,6 +184,8 @@ void PawleyParameterFunction::setCenterParameterNameFromFunction(
}
}
DECLARE_FUNCTION(PawleyFunction)
PawleyFunction::PawleyFunction()
: FunctionParameterDecorator(), m_compositeFunction(),
m_pawleyParameterFunction(), m_peakProfileComposite(), m_hkls() {}
......@@ -216,18 +218,19 @@ void PawleyFunction::setProfileFunction(const std::string &profileFunction) {
m_compositeFunction->checkFunction();
}
void PawleyFunction::function1D(double *out, const double *xValues,
const size_t nData) const {
UNUSED_ARG(out);
UNUSED_ARG(xValues);
UNUSED_ARG(nData);
}
void PawleyFunction::function(const FunctionDomain &domain,
FunctionValues &values) const {
UnitCell cell = m_pawleyParameterFunction->getUnitCellFromParameters();
double zeroShift = m_pawleyParameterFunction->getParameter("ZeroShift");
for (size_t i = 0; i < m_hkls.size(); ++i) {
double d = cell.d(m_hkls[i]) + zeroShift;
m_peakProfileComposite->getFunction(i)->setParameter(
m_pawleyParameterFunction->getProfileFunctionCenterParameterName(),
d + zeroShift);
}
void PawleyFunction::functionDeriv1D(API::Jacobian *out, const double *xValues,
const size_t nData) {
UNUSED_ARG(out);
UNUSED_ARG(xValues);
UNUSED_ARG(nData);
m_peakProfileComposite->function(domain, values);
}
void PawleyFunction::addPeak(const Kernel::V3D &hkl, double centre, double fwhm,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment