Mantid
Loading...
Searching...
No Matches
MaxentCalculator.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2016 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#include "MantidAlgorithms/DllConfig.h"
13
14namespace Mantid {
15namespace Algorithms {
16
24class MANTID_ALGORITHMS_DLL MaxentCalculator final {
25public:
26 // Constructor
28 // Deleted default constructor
29 MaxentCalculator() = delete;
30 // Destructor
31 virtual ~MaxentCalculator() = default;
32
33 // Runs maxent iteration
34 void iterate(const std::vector<double> &data, const std::vector<double> &errors, const std::vector<double> &image,
35 double background, const std::vector<double> &linearAdjustments,
36 const std::vector<double> &constAdjustments);
37
38 // Getters
39 // Returns the reconstructed (calculated) data
40 std::vector<double> getReconstructedData() const;
41 // Returns the image
42 std::vector<double> getImage() const;
43 // Returns the quadratic coefficients
44 QuadraticCoefficients getQuadraticCoefficients() const;
45 // Returns the search directions
46 std::vector<std::vector<double>> getSearchDirections() const;
47 // Returns the angle between Grad(S) and Grad(C)
48 double getAngle() const;
49 // Returns the chi-square
50 double getChisq();
51
52 std::vector<double> calculateData(const std::vector<double> &image) const;
53 std::vector<double> calculateImage(const std::vector<double> &data) const;
54 double calculateChiSquared(const std::vector<double> &data) const;
55
56private:
57 // Calculates the gradient of chi
58 std::vector<double> calculateChiGrad() const;
59 // Calculates chi-square
60 void calculateChisq();
61
62 // Member variables
63 // The experimental (measured) data
64 std::vector<double> m_data;
65 // The experimental (measured) errors
66 std::vector<double> m_errors;
67 // The image
68 std::vector<double> m_image;
69 // The reconstructed (calculated) data
70 std::vector<double> m_dataCalc;
71 // The background
73 // The angle between Grad(C) and Grad(S)
74 double m_angle;
75 // Chi-square
76 double m_chisq;
77 // The search directions
78 std::vector<std::vector<double>> m_directionsIm;
79 // The quadratic coefficients
81
82 // The type of entropy
84 // The type of transform
86};
87
88} // namespace Algorithms
89} // namespace Mantid
MaxentCalculator : This class performs one maxent iteration and calculates chi-sq,...
std::vector< std::vector< double > > m_directionsIm
std::shared_ptr< MaxentTransform > MaxentTransform_sptr
std::shared_ptr< MaxentEntropy > MaxentEntropy_sptr
Definition: MaxentEntropy.h:33
Helper class which provides the Collimation Length for SANS instruments.