BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
IChiSquaredModule.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Device/Instrument/IChiSquaredModule.cpp
6 //! @brief Implements class IChiSquaredModule.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************** //
14 
18 
20 
22 {
23  return m_variance_function.get();
24 }
25 
27 {
28  if (other.m_variance_function)
29  m_variance_function.reset(other.m_variance_function->clone());
30 
31  if (other.mp_intensity_function)
32  mp_intensity_function.reset(other.mp_intensity_function->clone());
33 }
34 
36 
38 {
39  m_variance_function.reset(variance_function.clone());
40 }
41 
43 {
44  return mp_intensity_function.get();
45 }
46 
48 {
49  mp_intensity_function.reset(intensity_function.clone());
50 }
Defines class IChiSquaredModule.
Defines and implements the interface class IIntensityFunction and its child classes IntensityFunction...
Defines IVarianceFunction classes.
Interface residual calculations.
const IVarianceFunction * varianceFunction() const
Returns squared function.
std::unique_ptr< IIntensityFunction > mp_intensity_function
std::unique_ptr< IVarianceFunction > m_variance_function
void setVarianceFunction(const IVarianceFunction &variance_function)
Sets squared function.
virtual const IIntensityFunction * getIntensityFunction() const
Returns data rescaler.
virtual ~IChiSquaredModule()
virtual void setIntensityFunction(const IIntensityFunction &intensity_function)
Sets data rescaler.
Interface for polymorphic classes that should not be copied, except by explicit cloning.
Definition: ICloneable.h:25
Interface for applying arbitrary function to the measured intensity.
virtual IIntensityFunction * clone() const =0
Variance function interface.
virtual IVarianceFunction * clone() const =0
Returns max(sim, epsilon)