Mantid
Loading...
Searching...
No Matches
IFunction1DAdapter.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//-----------------------------------------------------------------------------
10// Includes
11//-----------------------------------------------------------------------------
15
16#include <boost/python/object.hpp>
17
18namespace Mantid {
19namespace PythonInterface {
20
28#if defined(_MSC_VER) && _MSC_VER >= 1900
29// All Python tests segfault on MSVC 2015 if the virtual specifiers are included
30// The segault happens on initializing this constructor. Conversely on all other
31// compilers it won't even compile without the virtual specifier.
32class IFunction1DAdapter : public API::ParamFunction, public API::IFunction1D, public IFunctionAdapter {
33#else
34class IFunction1DAdapter : public virtual API::ParamFunction, public virtual API::IFunction1D, public IFunctionAdapter {
35#endif
36public:
37 // Convenience type def
39
41 IFunction1DAdapter(PyObject *self);
42
46
49
53 void function1D(double *out, const double *xValues, const size_t nData) const override;
55 boost::python::object function1D(const boost::python::object &xvals) const;
56
58 void functionDeriv1D(API::Jacobian *out, const double *xValues, const size_t nData) override;
60};
61} // namespace PythonInterface
62} // namespace Mantid
This is a specialization of IFunction for functions of one real argument.
Definition: IFunction1D.h:43
Represents the Jacobian in IFitFunction::functionDeriv.
Definition: Jacobian.h:22
Implements the part of IFunction interface dealing with parameters.
Definition: ParamFunction.h:33
Provides a layer class for boost::python to allow C++ virtual functions to be overridden in a Python ...
IFunction1DAdapter & operator=(const IFunction1DAdapter &)=delete
Disable assignment operator.
IFunction1DAdapter(const IFunction1DAdapter &)=delete
Disable copy operator - The PyObject must be supplied to construct the object.
void functionDeriv1D(API::Jacobian *out, const double *xValues, const size_t nData) override
Derivatives of function with respect to active parameters (C++ override)
void function1D(double *out, const double *xValues, const size_t nData) const override
Translates between the C++ signature & the Python signature called by Fit.
Provides a layer to hook into the protected functions of IFunction.
Helper class which provides the Collimation Length for SANS instruments.