Mantid
Loading...
Searching...
No Matches
CostFuncRwp.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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
16namespace Mantid {
17namespace Kernel {
18class Logger;
19}
20namespace CurveFitting {
21class SeqDomain;
22class ParDomain;
23
24namespace CostFunctions {
25
52class MANTID_CURVEFITTING_DLL CostFuncRwp : public CostFuncLeastSquares {
53public:
56
58 std::string name() const override { return "Rwp"; }
59
61 std::string shortName() const override { return "Rwp"; }
62
63private:
64 std::vector<double> getFitWeights(API::FunctionValues_sptr values) const override;
65
67 double getWeight(const API::FunctionValues_sptr &values, size_t i, double sqrtW = 1.0) const;
68
71 double calSqrtW(const API::FunctionValues_sptr &values) const;
72
75};
76
77} // namespace CostFunctions
78} // namespace CurveFitting
79} // namespace Mantid
Cost function for Rwp = (sum_i (( obs_i - cal_i )/sigma_i)**2 ) / (sum_i (obs_i/sigma_i)**2)
Definition: CostFuncRwp.h:52
std::string name() const override
Get name of minimizer.
Definition: CostFuncRwp.h:58
std::string shortName() const override
Get short name of minimizer - useful for say labels in guis.
Definition: CostFuncRwp.h:61
An implementation of SeqDomain for parallel cost function and derivatives computation.
Definition: ParDomain.h:23
An implementation of CompositeDomain.
Definition: SeqDomain.h:30
std::shared_ptr< FunctionValues > FunctionValues_sptr
typedef for a shared pointer
Helper class which provides the Collimation Length for SANS instruments.