Mantid
Loading...
Searching...
No Matches
SeqDomain.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 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//----------------------------------------------------------------------
17#include "MantidCurveFitting/DllConfig.h"
18
19#include <algorithm>
20#include <stdexcept>
21#include <vector>
22
23namespace Mantid {
24namespace CurveFitting {
30class MANTID_CURVEFITTING_DLL SeqDomain : public API::FunctionDomain {
31public:
32 SeqDomain() : API::FunctionDomain(), m_currentIndex(0) {}
34 size_t size() const override;
36 virtual size_t getNDomains() const;
38 virtual void getDomainAndValues(size_t i, API::FunctionDomain_sptr &domain, API::FunctionValues_sptr &values) const;
40 void addCreator(const API::IDomainCreator_sptr &creator);
42 virtual void additiveCostFunctionVal(const CostFunctions::CostFuncFitting &costFunction);
45 virtual void additiveCostFunctionValDerivHessian(const CostFunctions::CostFuncFitting &costFunction, bool evalDeriv,
46 bool evalHessian);
48 void rwpVal(const CostFunctions::CostFuncRwp &rwp);
50 void rwpValDerivHessian(const CostFunctions::CostFuncRwp &rwp, bool evalDeriv, bool evalHessian);
51
56
57protected:
59 mutable size_t m_currentIndex;
61 mutable std::vector<API::FunctionDomain_sptr> m_domain;
63 mutable std::vector<API::FunctionValues_sptr> m_values;
65 std::vector<std::shared_ptr<API::IDomainCreator>> m_creators;
66};
67
68} // namespace CurveFitting
69} // namespace Mantid
Base class that represents the domain of a function.
DomainType
Type of domain to create.
A semi-abstract class for a cost function for fitting functions.
Cost function for Rwp = (sum_i (( obs_i - cal_i )/sigma_i)**2 ) / (sum_i (obs_i/sigma_i)**2)
Definition: CostFuncRwp.h:52
An implementation of CompositeDomain.
Definition: SeqDomain.h:30
std::vector< API::FunctionDomain_sptr > m_domain
Currently active domain.
Definition: SeqDomain.h:61
size_t m_currentIndex
Current index.
Definition: SeqDomain.h:59
std::vector< API::FunctionValues_sptr > m_values
Currently active values.
Definition: SeqDomain.h:63
std::vector< std::shared_ptr< API::IDomainCreator > > m_creators
Domain creators.
Definition: SeqDomain.h:65
std::shared_ptr< FunctionValues > FunctionValues_sptr
typedef for a shared pointer
std::shared_ptr< IDomainCreator > IDomainCreator_sptr
Typedef for a shared pointer to IDomainCreator.
std::shared_ptr< FunctionDomain > FunctionDomain_sptr
typedef for a shared pointer
std::unique_ptr< T > create(const P &parent, const IndexArg &indexArg, const HistArg &histArg)
This is the create() method that all the other create() methods call.
Helper class which provides the Collimation Length for SANS instruments.