15 #ifndef BORNAGAIN_CORE_FITTING_SIMDATAPAIR_H
16 #define BORNAGAIN_CORE_FITTING_SIMDATAPAIR_H
Defines common types for fitting library.
std::function< std::unique_ptr< Simulation >(const Fit::Parameters &)> simulation_builder_t
Defines class SimulationResult.
A collection of fit parameters.
Template class to store data of any type in multi-dimensional space.
Holds pair of simulation/experimental data to fit.
SimulationResult userWeights() const
Returns the user uncertainties cut to the ROI area.
SimulationResult m_sim_data
Current simulation results. Masked areas are nullified.
std::vector< double > experimental_array() const
Returns the flattened experimental data cut to the ROI area.
SimulationResult absoluteDifference() const
Returns the absolute difference between simulated and experimental data cut to the ROI area.
std::unique_ptr< OutputData< double > > m_raw_user_weights
User-defined weights.
std::vector< double > user_weights_array() const
Returns a flat array of user weights cut to the ROI area.
std::vector< double > uncertainties_array() const
Returns the flattened experimental uncertainties cut to the ROI area.
std::vector< double > simulation_array() const
Returns the flattened simulated intensities cut to the ROI area.
SimDataPair(simulation_builder_t builder, const OutputData< double > &data, std::unique_ptr< OutputData< double >> uncertainties, double user_weight=1.0)
SimulationResult uncertainties() const
Returns the data uncertainties cut to the ROI area If no uncertainties present, returns zero-filled S...
SimulationResult experimentalData() const
Returns the experimental data cut to the ROI area.
bool containsUncertainties() const
std::unique_ptr< OutputData< double > > m_raw_data
Raw experimental data as obtained from the user.
void runSimulation(const Fit::Parameters ¶ms)
std::unique_ptr< Simulation > m_simulation
Current simulation for given set of parameters.
size_t numberOfFitElements() const
Returns the number of elements in the fit area.
SimulationResult relativeDifference() const
Returns the relative difference between simulated and experimental data cut to the ROI area.
SimulationResult simulationResult() const
Returns the result of last computed simulation.
SimulationResult m_uncertainties
Weights from experimental data uncertainties. Masked areas are nullified.
SimulationResult m_exp_data
Experimental data cut to the ROI. Masked areas are nullified.
SimulationResult m_user_weights
Manually defined (user) weights. Masked areas are nullified.
std::unique_ptr< OutputData< double > > m_raw_uncertainties
Data uncertainties as provided by the user.
simulation_builder_t m_simulation_builder
Simulation builder from the user to construct simulation for given set of parameters.
Wrapper around OutputData<double> that also provides unit conversions.