BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
RQ4Metric Class Reference

Implementation of relative difference metric. More...

+ Inheritance diagram for RQ4Metric:

Public Member Functions

RQ4Metricclone () const override
 
double compute (const SimDataPair &data_pair, bool use_weights) const override
 Computes metric value from SimDataPair object. More...
 
- Public Member Functions inherited from Chi2Metric
double computeFromArrays (std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > uncertainties, std::vector< double > weight_factors) const override
 Computes metric value from data arrays. More...
 
double computeFromArrays (std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > weight_factors) const override
 Computes metric value from data arrays. More...
 
- Public Member Functions inherited from ObjectiveMetric
 ObjectiveMetric (std::function< double(double)> norm)
 
void setNorm (std::function< double(double)> norm)
 
auto norm () const
 Returns a copy of the normalization function used.
 
- Public Member Functions inherited from ICloneable
 ICloneable (const ICloneable &)=delete
 
 ICloneable (ICloneable &&)=default
 
virtual void transferToCPP ()
 Used for Python overriding of clone (see swig/tweaks.py)
 

Detailed Description

Implementation of relative difference metric.

With default L2 norm and weighting off corresponds to the formula

\[Result = \sum (I \cdot Q^4 - D \cdot Q^4)^2\]

where $Q$ is the scattering vector magnitude. If weighting is on, coincides with the metric provided by Chi2Metric class.

Definition at line 191 of file ObjectiveMetric.h.

Member Function Documentation

◆ compute()

double RQ4Metric::compute ( const SimDataPair data_pair,
bool  use_weights 
) const
overridevirtual

Computes metric value from SimDataPair object.

Calls computeFromArrays internally.

Parameters
data_pairSimDataPair object. Can optionally contain data uncertainties
use_weightsboolean, defines if data uncertainties should be taken into account

Reimplemented from ObjectiveMetric.

Definition at line 231 of file ObjectiveMetric.cpp.


The documentation for this class was generated from the following files: