BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Holds vector of SimDataPair
s (experimental data and simulation results) for use in fitting.
More...
Public Member Functions | |
void | addSimulationAndData (simulation_builder_t builder, const OutputData< double > &data, std::unique_ptr< OutputData< double >> uncertainties, double weight=1.0) |
Constructs simulation/data pair for later fit. More... | |
template<class T > | |
void | addSimulationAndData (PyBuilderCallback &callback, const T &data, double weight=1.0) |
Constructs simulation/data pair for later fit. More... | |
template<class T > | |
void | addSimulationAndData (PyBuilderCallback &callback, const T &data, const T &uncertainties, double weight=1.0) |
Constructs simulation/data pair for later fit. More... | |
virtual double | evaluate (const Fit::Parameters ¶ms) |
virtual std::vector< double > | evaluate_residuals (const Fit::Parameters ¶ms) |
size_t | numberOfFitElements () const |
SimulationResult | simulationResult (size_t i_item=0) const |
Returns simulation result in the form of SimulationResult. | |
SimulationResult | experimentalData (size_t i_item=0) const |
Returns experimental data in the form of SimulationResult. | |
SimulationResult | uncertaintyData (size_t i_item=0) const |
Returns experimental data uncertainties in the form of SimulationResult. | |
SimulationResult | relativeDifference (size_t i_item=0) const |
Returns relative difference between simulation and experimental data in the form of SimulationResult. | |
SimulationResult | absoluteDifference (size_t i_item=0) const |
Returns absolute value of difference between simulation and experimental data in the form of SimulationResult. | |
std::vector< double > | experimental_array () const |
Returns one dimensional array representing merged experimental data. More... | |
std::vector< double > | simulation_array () const |
Returns one dimensional array representing merged simulated intensities data. More... | |
std::vector< double > | uncertainties () const |
Returns one-dimensional array representing merged data uncertainties. More... | |
std::vector< double > | weights_array () const |
Returns one-dimensional array representing merged user weights. More... | |
void | initPrint (int every_nth) |
Initializes printing to standard output on every_nth fit iteration. | |
void | initPlot (int every_nth, PyObserverCallback &callback) |
Initializes observer callback to be called on every_nth fit iteration. | |
IterationInfo | iterationInfo () const |
Fit::MinimizerResult | minimizerResult () const |
void | finalize (const Fit::MinimizerResult &result) |
Should be explicitely called on last iteration to notify all observers. | |
unsigned | fitObjectCount () const |
void | run_simulations (const Fit::Parameters ¶ms) |
void | setChiSquaredModule (const IChiSquaredModule &module) |
void | setObjectiveMetric (const std::string &metric) |
void | setObjectiveMetric (const std::string &metric, const std::string &norm) |
Sets objective metric to the FitObjective. More... | |
bool | containsUncertainties (size_t i_item) const |
Returns true if the specified DataPair element contains uncertainties. | |
bool | allPairsHaveUncertainties () const |
Returns true if all the data pairs in FitObjective instance contain uncertainties. | |
const SimDataPair & | dataPair (size_t i_item=0) const |
Returns a reference to i-th SimDataPair. | |
void | initPlot (int every_nth, fit_observer_t observer) |
bool | isCompleted () const |
void | interruptFitting () |
bool | isInterrupted () const |
bool | isFirstIteration () const |
void | setObjectiveMetric (std::unique_ptr< ObjectiveMetric > metric) |
Static Public Member Functions | |
static std::string | availableMetricOptions () |
Returns available metrics and norms. | |
Holds vector of SimDataPair
s (experimental data and simulation results) for use in fitting.
Definition at line 33 of file FitObjective.h.
void FitObjective::addSimulationAndData | ( | simulation_builder_t | builder, |
const OutputData< double > & | data, | ||
std::unique_ptr< OutputData< double >> | uncertainties, | ||
double | weight = 1.0 |
||
) |
Constructs simulation/data pair for later fit.
builder | simulation builder capable of producing simulations |
data | experimental data array |
uncertainties | data uncertainties array |
weight | weight of dataset in metric calculations |
Definition at line 76 of file FitObjective.cpp.
|
inline |
Constructs simulation/data pair for later fit.
callback | simulation builder capable of producing simulations |
data | experimental data array |
weight | weight of dataset in metric calculations |
Definition at line 51 of file FitObjective.h.
|
inline |
Constructs simulation/data pair for later fit.
callback | simulation builder capable of producing simulations |
data | experimental data array |
uncertainties | data uncertainties array |
weight | weight of dataset in metric calculations |
Definition at line 63 of file FitObjective.h.
std::vector< double > FitObjective::experimental_array | ( | ) | const |
Returns one dimensional array representing merged experimental data.
The area outside of the region of interest is not included, masked data is nullified.
Definition at line 144 of file FitObjective.cpp.
std::vector< double > FitObjective::simulation_array | ( | ) | const |
Returns one dimensional array representing merged simulated intensities data.
The area outside of the region of interest is not included, masked data is nullified.
Definition at line 151 of file FitObjective.cpp.
std::vector< double > FitObjective::uncertainties | ( | ) | const |
Returns one-dimensional array representing merged data uncertainties.
The area outside of the region of interest is not included, masked data is nullified.
Definition at line 158 of file FitObjective.cpp.
std::vector< double > FitObjective::weights_array | ( | ) | const |
Returns one-dimensional array representing merged user weights.
The area outside of the region of interest is not included, masked data is nullified.
Definition at line 165 of file FitObjective.cpp.
void FitObjective::setObjectiveMetric | ( | const std::string & | metric, |
const std::string & | norm | ||
) |
Sets objective metric to the FitObjective.
metric | metric name |
norm | metric norm name (defaults to L2-norm) |
Definition at line 266 of file FitObjective.cpp.