20#include "MantidHistogramData/Histogram.h"
21#include "MantidHistogramData/HistogramBuilder.h"
22#include "MantidHistogramData/LinearGenerator.h"
29#include <gsl/gsl_linalg.h>
34using Mantid::HistogramData::LinearGenerator;
35using Mantid::HistogramData::Points;
38using namespace Kernel;
53std::map<std::string, std::string> inverseCaption = {
54 {
"Time",
"Frequency"}, {
"Frequency",
"Time"}, {
"d-Spacing",
"q"}, {
"q",
"d-Spacing"}};
56std::map<std::string, std::string> inverseLabel = {{
"s",
"Hz"},
57 {
"microsecond",
"MHz"},
59 {
"MHz",
"microsecond"},
60 {
"Angstrom",
"Angstrom^-1"},
61 {
"Angstrom^-1",
"Angstrom"}};
63const double THRESHOLD = 1E-6;
65const double BIN_WIDTH_ERROR_LEVEL = 0.5;
75 const std::string &yLabel) {
77 ws->setYUnitLabel(yLabel);
78 ws->getAxis(0)->unit() = UnitFactory::Instance().create(
"Label");
80 std::shared_ptr<Units::Label> label = std::dynamic_pointer_cast<Units::Label>(unit);
81 label->setLabel(
"Number of Iterations",
"");
83 const size_t nspec = ws->getNumberHistograms();
84 if (itCount.empty()) {
87 for (
size_t spec = 0; spec < nspec; spec++) {
89 ws->resizeHistogram(spec, itCount[spec]);
108 return "Runs Maximum Entropy method on every spectrum of an input workspace. "
109 "It currently works for the case where data and image are related by a"
110 " 1D Fourier transform.";
121 std::make_shared<EqualBinSizesValidator>(BIN_WIDTH_ERROR_LEVEL)),
122 "An input workspace.");
125 "If true, the input data is assumed to be complex and the "
126 "input workspace is expected to have an even number of "
127 "histograms (2N). Spectrum numbers S and S+N are assumed to "
128 "be the real and imaginary part of the complex signal "
132 "If true, the algorithm will use complex images for the "
133 "calculations. This is the recommended option when there is "
134 "no prior knowledge about the image. If the image is known "
135 "to be real, this option can be set to false and the "
136 "algorithm will only consider the real part for "
140 "If true, the reconstructed image is only allowed to take "
141 "positive values. It can take negative values otherwise. "
142 "This option defines the entropy formula that will be used "
143 "for the calculations (see next section for more details).");
146 "Automatically calculate and apply phase shift. Zero on the "
147 "X axis is assumed to be in the first bin. If it is not, "
148 "setting this property will automatically correct for this.");
150 auto mustBePositive = std::make_shared<BoundedValidator<size_t>>();
151 mustBePositive->setLower(0);
153 "An integer number indicating the factor by which the number "
154 "of points will be increased in the image and reconstructed "
157 auto mustBeNonNegative = std::make_shared<BoundedValidator<double>>();
158 mustBeNonNegative->setLower(1E-12);
160 "A maximum entropy constant. This algorithm was first developed for the "
161 "ISIS muon group where the default 0.4 was found to give good "
163 "In general the user will need to experiment with this value. Choosing a "
164 "small value may lead to unphysical spiky reconstructions and choosing "
165 "an increasingly large "
166 "value the reconstruction will start to resamble that of a direct "
168 "transform reconstruction. However, where the data contain a "
169 "zero Fourier data point with a small error the "
170 "reconstruction will be insensitive to the choice "
171 "of this property (and increasing so the more well determined "
172 "this data point is).");
176 "Target value of Chi-square divided by the number of data points (N)");
179 "Required precision for Chi-square");
183 "Distance penalty applied to the current image at each iteration.");
186 "Maximum degree of non-parallelism between S (the entropy) and C "
187 "(chi-squared). These needs to be parallel. Chosing a smaller "
188 "shouldn't change the output. However, if you find this is the "
189 "case please let the Mantid team know since this indicates that "
190 "the default value of this proporty may need changing or "
191 "other changes to this implementation are required.");
193 mustBePositive = std::make_shared<BoundedValidator<size_t>>();
194 mustBePositive->setLower(1);
196 "Maximum number of iterations.");
200 "Maximum number of iterations in alpha chop.");
203 std::make_shared<EqualBinSizesValidator>(BIN_WIDTH_ERROR_LEVEL)),
204 "Adjusts the calculated data by multiplying each value by the "
205 "corresponding Y value of this workspace. "
206 "The data in this workspace is complex in the same manner as complex "
210 std::make_shared<EqualBinSizesValidator>(BIN_WIDTH_ERROR_LEVEL)),
211 "Adjusts the calculated data by adding to each value the corresponding Y "
212 "value of this workspace. "
213 "If DataLinearAdj is also specified, this addition is done after its "
215 "See equation in documentation for how DataLinearAdj and DataConstAdj "
217 "The data in this workspace is complex in the same manner as complex "
220 "Reconstruction is done independently on each spectrum. "
221 "If false, all the spectra use one image and the reconstructions "
222 "differ only through their adjustments. "
223 "ComplexData must be set true, when this is false.");
226 "Output workspace containing the evolution of Chi-sq.");
228 "Output workspace containing the evolution of "
229 "non-paralellism between S and C.");
231 "The output workspace containing the reconstructed image.");
233 "The output workspace containing the reconstructed data.");
240 const double warningLevel = 0.01;
245 const std::string binError = binChecker.
validate();
246 if (!binError.empty()) {
247 messages[wsName] = binError;
257 std::map<std::string, std::string> result;
265 size_t nHistograms = 0;
270 nHistograms = inWS->getNumberHistograms();
272 if (complex && (nHistograms % 2))
273 result[
"InputWorkspace"] =
"The number of histograms in the input "
274 "workspace must be even for complex data";
284 size_t nAHistograms = 0;
286 nAHistograms = linAdj->getNumberHistograms();
287 if (nAHistograms % 2)
288 result[
"DataLinearAdj"] =
"The number of histograms in the linear "
289 "adjustments workspace must be even, because they are complex data";
290 else if (nAHistograms > 0 && nAHistograms < nHistograms)
291 result[
"DataLinearAdj"] =
"The number of histograms in the linear "
292 "adjustments workspace is insufficient for the input workspace";
300 nAHistograms = constAdj->getNumberHistograms();
301 if (nAHistograms % 2)
302 result[
"DataConstAdj"] =
"The number of histograms in the constant "
303 "adjustments workspace must be even, because they are complex data";
304 else if (nAHistograms > 0 && nAHistograms < nHistograms)
305 result[
"DataConstAdj"] =
"The number of histograms in the constant "
306 "adjustments workspace is insufficient for the input workspace";
318 const bool complexData =
getProperty(
"ComplexData");
320 const bool complexImage =
getProperty(
"ComplexImage");
322 const bool positiveImage =
getProperty(
"PositiveImage");
326 const size_t resolutionFactor =
getProperty(
"ResolutionFactor");
330 const double ChiTargetOverN =
getProperty(
"ChiTargetOverN");
336 const double distEps =
getProperty(
"DistancePenalty");
340 const size_t alphaIter =
getProperty(
"AlphaChopIterations");
345 size_t nHist = inWS->getNumberHistograms();
348 size_t npoints = inWS->blocksize() * resolutionFactor;
350 const size_t npointsX = inWS->isHistogramData() ? npoints + 1 : npoints;
356 const bool perSpectrumReconstruction =
getProperty(
"PerSpectrumReconstruction");
360 for (
size_t s = 0; s < nHist; s++) {
361 const auto &errors = inWS->e(s);
362 if (std::any_of(errors.cbegin(), errors.cend(), [](
const auto error) { return error <= 0.; })) {
363 throw std::invalid_argument(
"Input data must have all errors non-zero.");
370 dataSpace = std::make_shared<MaxentSpaceComplex>();
372 dataSpace = std::make_shared<MaxentSpaceReal>();
377 imageSpace = std::make_shared<MaxentSpaceComplex>();
379 imageSpace = std::make_shared<MaxentSpaceReal>();
384 if (perSpectrumReconstruction) {
385 transform = std::make_shared<MaxentTransformFourier>(dataSpace, imageSpace);
387 auto complexDataSpace = std::make_shared<MaxentSpaceComplex>();
388 transform = std::make_shared<MaxentTransformMultiFourier>(complexDataSpace, imageSpace, nHist / 2);
395 entropy = std::make_shared<MaxentEntropyPositiveValues>();
397 entropy = std::make_shared<MaxentEntropyNegativeValues>();
409 size_t nDataSpec = complexData ? nHist / 2 : nHist;
410 size_t nImageSpec = nDataSpec;
411 size_t nSpecConcat = 1;
412 if (!perSpectrumReconstruction) {
413 nSpecConcat = nImageSpec;
416 outImageWS = create<MatrixWorkspace>(*inWS, 2 * nImageSpec, Points(npoints));
417 for (
size_t i = 0; i < outImageWS->getNumberHistograms(); ++i)
418 outImageWS->getSpectrum(i).setDetectorID(
static_cast<detid_t>(i + 1));
419 HistogramBuilder builder;
420 builder.setX(npointsX);
421 builder.setY(npoints);
422 builder.setDistribution(inWS->isDistribution());
423 outDataWS = create<MatrixWorkspace>(*inWS, 2 * nDataSpec, builder.build());
425 for (
size_t i = 0; i < outDataWS->getNumberHistograms(); ++i)
426 outDataWS->getSpectrum(i).setDetectorID(
static_cast<detid_t>(i + 1));
427 outEvolChi = create<MatrixWorkspace>(*inWS, nImageSpec, Points(nIter));
428 outEvolTest = create<MatrixWorkspace>(*inWS, nImageSpec, Points(nIter));
430 npoints = complexImage ? npoints * 2 : npoints;
431 std::vector<size_t> iterationCounts;
432 iterationCounts.reserve(nImageSpec);
433 outEvolChi->setPoints(0, Points(nIter, LinearGenerator(0.0, 1.0)));
435 size_t dataLength = complexData ? 2 * inWS->y(0).size() : inWS->y(0).size();
436 dataLength *= nSpecConcat;
438 for (
size_t spec = 0; spec < nImageSpec; spec++) {
441 std::vector<double> image(npoints,
background);
443 std::vector<double> data(dataLength, 0.0);
444 std::vector<double> errors(dataLength, 0.0);
447 !perSpectrumReconstruction);
449 !perSpectrumReconstruction);
451 if (!perSpectrumReconstruction) {
452 throw std::invalid_argument(
"ComplexData must be true, if PerSpectrumReconstruction is false.");
454 data = inWS->y(spec).rawData();
455 errors = inWS->e(spec).rawData();
459 std::vector<double> linearAdjustments;
460 std::vector<double> constAdjustments;
462 linearAdjustments =
toComplex(dataLinearAdj, spec,
false, !perSpectrumReconstruction);
465 constAdjustments =
toComplex(dataConstAdj, spec,
false, !perSpectrumReconstruction);
469 std::vector<double> evolChi(nIter, 0.);
470 std::vector<double> evolTest(nIter, 0.);
476 bool converged =
false;
477 for (
size_t it = 0; it < nIter; it++) {
481 maxentCalculator.
iterate(data, errors, image,
background, linearAdjustments, constAdjustments);
484 double currChisq = maxentCalculator.
getChisq();
486 auto delta =
move(coeffs, ChiTargetOverN / currChisq, chiEps, alphaIter);
496 double currAngle = maxentCalculator.
getAngle();
497 evolChi[it] = currChisq;
498 evolTest[it] = currAngle;
501 if ((std::abs(currChisq / ChiTargetOverN - 1.) < chiEps) && (currAngle < angle)) {
504 g_log.
information() <<
"Converged after " << it + 1 <<
" iterations" << std::endl;
505 iterationCounts.emplace_back(it + 1);
521 iterationCounts.emplace_back(nIter);
526 auto solImage = maxentCalculator.
getImage();
529 populateDataWS(inWS, spec, nDataSpec, solData, !perSpectrumReconstruction, complexData, outDataWS);
530 populateImageWS(inWS, spec, nImageSpec, solImage, complexImage, outImageWS, autoShift);
534 outEvolChi->setSharedX(spec, outEvolChi->sharedX(0));
535 outEvolTest->setSharedX(spec, outEvolChi->sharedX(0));
538 outEvolChi->setCounts(spec, std::move(evolChi));
539 outEvolTest->setCounts(spec, std::move(evolTest));
543 setProperty(
"EvolChi", removeZeros(outEvolChi, iterationCounts,
"Chi squared"));
544 setProperty(
"EvolAngle", removeZeros(outEvolTest, iterationCounts,
"Maximum Angle"));
562 const size_t numBins = inWS->y(0).size();
563 size_t nSpec = inWS->getNumberHistograms() / 2;
564 std::vector<double> result;
565 result.reserve(2 * numBins);
567 if (inWS->getNumberHistograms() % 2)
568 throw std::invalid_argument(
"Cannot convert input workspace to complex data");
570 size_t nSpecOfInterest = (concatSpec ? nSpec : 1);
571 size_t firstSpecOfInterest = (concatSpec ? 0 : spec);
573 for (
size_t s = firstSpecOfInterest; s < firstSpecOfInterest + nSpecOfInterest; s++) {
575 for (
size_t i = 0; i < numBins; i++) {
576 result.emplace_back(inWS->y(s)[i]);
577 result.emplace_back(inWS->y(s + nSpec)[i]);
580 for (
size_t i = 0; i < numBins; i++) {
581 result.emplace_back(inWS->e(s)[i]);
582 result.emplace_back(inWS->e(s + nSpec)[i]);
606 size_t dim = coeffs.
c2.
size().first;
608 std::vector<double> deltaMin(dim, 0);
609 std::vector<double> deltaMax(dim, 0);
614 double dchiMin = chiMin - ChiTargetOverN;
615 double dchiMax = chiMax - ChiTargetOverN;
617 if (dchiMin * dchiMax > 0) {
620 if (
fabs(dchiMin) <
fabs(dchiMax)) {
629 double eps = 2. * chiEps;
634 std::vector<double>
delta(dim, 0);
636 while ((
fabs(eps / ChiTargetOverN) > chiEps) && (iter < alphaIter)) {
638 double aMid = 0.5 * (aMin + aMax);
641 eps = chiMid - ChiTargetOverN;
643 if (dchiMin * eps > 0) {
648 if (dchiMax * eps > 0) {
657 if ((
fabs(eps / ChiTargetOverN) > chiEps) || (iter > alphaIter)) {
658 throw std::runtime_error(
"Error encountered when calculating solution "
659 "image. No convergence in alpha chop.\n");
674 size_t dim = coeffs.
c2.
size().first;
683 for (
size_t k = 0; k < dim; k++) {
684 for (
size_t l = 0; l < dim; l++) {
685 A[k][l] = bx * coeffs.
c2[k][l] - ax * coeffs.
s2[k][l];
687 B[k][0] = -bx * coeffs.
c1[k][0] + ax * coeffs.
s1[k][0];
700 for (
size_t k = 0; k < dim; k++) {
702 for (
size_t l = 0; l < dim; l++) {
703 z += coeffs.
c2[k][l] * b[l];
705 ww += b[k] * (coeffs.
c1[k][0] + 0.5 *
z);
719 size_t dim = A.
size().first;
721 auto a = gsl_matrix_view_array(A[0], dim, dim);
722 auto b = gsl_vector_const_view_array(B[0], dim);
724 std::vector<double> vVec(dim * dim), sVec(dim), wVec(dim),
delta(dim);
726 auto v = gsl_matrix_view_array(vVec.data(), dim, dim);
727 auto s = gsl_vector_view_array(sVec.data(), dim);
728 auto w = gsl_vector_view_array(wVec.data(), dim);
729 auto x = gsl_vector_view_array(
delta.data(), dim);
732 gsl_linalg_SV_decomp(&a.matrix, &v.matrix, &s.vector, &w.vector);
739 double max = *std::max_element(sVec.begin(), sVec.end());
742 double threshold = THRESHOLD * max;
743 std::transform(sVec.begin(), sVec.end(), sVec.begin(), [&threshold](
double el) { return el > threshold ? el : 0.0; });
746 gsl_linalg_SV_solve(&a.matrix, &v.matrix, &s.vector, &b.vector, &
x.vector);
760 const std::vector<double> &image,
double background,
double distEps) {
762 const double pointSum = std::accumulate(image.cbegin(), image.cend(), 0.,
763 [](
const auto sum,
const auto point) { return sum + std::abs(point); });
765 const size_t dim = coeffs.
s2.
size().first;
769 for (
size_t k = 0; k < dim; k++) {
771 for (
size_t l = 0; l < dim; l++)
772 sum -= coeffs.
s2[k][l] *
delta[l];
773 dist +=
delta[k] * sum;
777 auto newDelta =
delta;
778 for (
size_t k = 0; k <
delta.size(); k++) {
779 newDelta[k] *= sqrt(distEps * pointSum / dist /
background);
795 const std::vector<std::vector<double>> &dirs) {
797 if (image.empty() || dirs.empty() || (
delta.size() != dirs.size())) {
798 throw std::runtime_error(
"Cannot calculate new image");
801 std::vector<double> newImage = image;
804 for (
size_t i = 0; i < image.size(); i++) {
805 for (
size_t k = 0; k <
delta.size(); k++) {
806 newImage[i] +=
delta[k] * dirs[k][i];
827 if (complex && result.size() % 2)
828 throw std::invalid_argument(
"Cannot write image results to output workspaces");
830 int npoints = complex ?
static_cast<int>(result.size() / 2) :
static_cast<int>(result.size());
836 auto dataPoints = inWS->points(spec);
837 double x0 = dataPoints[0];
838 double dx = dataPoints[1] - x0;
840 double delta = 1. / dx / npoints;
841 const int isOdd = (inWS->y(0).size() % 2) ? 1 : 0;
843 double shift = x0 * 2. * M_PI;
848 for (
int i = 0; i < npoints; i++) {
849 X[i] =
delta * (-npoints / 2 + i);
854 for (
int i = 0; i < npoints; i++) {
855 int j = (npoints / 2 + i + isOdd) % npoints;
856 double xShift =
X[i] * shift;
857 double c = cos(xShift);
858 double s = sin(xShift);
859 YR[i] = result[2 * j] * c - result[2 * j + 1] * s;
860 YI[i] = result[2 * j] * s + result[2 * j + 1] * c;
865 for (
int i = 0; i < npoints; i++) {
866 int j = (npoints / 2 + i + isOdd) % npoints;
867 double xShift =
X[i] * shift;
868 double c = cos(xShift);
869 double s = sin(xShift);
870 YR[i] = result[j] * c;
871 YI[i] = result[j] * s;
878 auto inputUnit = inWS->getAxis(0)->unit();
880 std::shared_ptr<Kernel::Units::Label> lblUnit =
881 std::dynamic_pointer_cast<Kernel::Units::Label>(UnitFactory::Instance().
create(
"Label"));
884 lblUnit->setLabel(inverseCaption[inWS->getAxis(0)->unit()->caption()],
885 inverseLabel[inWS->getAxis(0)->unit()->label().ascii()]);
886 outWS->getAxis(0)->unit() = lblUnit;
890 outWS->mutableX(spec) =
X;
891 outWS->mutableY(spec) = YR;
892 outWS->mutableE(spec) = E;
893 outWS->setSharedX(nspec + spec, outWS->sharedX(spec));
894 outWS->mutableY(nspec + spec) = YI;
895 outWS->setSharedE(nspec + spec, outWS->sharedE(spec));
910 const std::vector<double> &result,
bool concatenated,
bool complex,
913 if (complex && result.size() % 2)
914 throw std::invalid_argument(
"Cannot write data results to output workspaces");
915 if (concatenated && !complex)
916 throw std::invalid_argument(
"Concatenated data results must be complex");
917 if (concatenated && result.size() % (nspec * 2))
918 throw std::invalid_argument(
"Cannot write complex concatenated data results to output workspaces");
919 if (concatenated && spec != 0)
920 throw std::invalid_argument(
"Cannot write concatenated data results to "
921 "output workspaces from non-first spectrum");
923 int resultLength = complex ?
static_cast<int>(result.size() / 2) :
static_cast<int>(result.size());
924 size_t spectrumLength = (concatenated ? resultLength / nspec : resultLength);
925 size_t spectrumLengthX = inWS->isHistogramData() ? spectrumLength + 1 : spectrumLength;
926 size_t nSpecAnalyzed = (concatenated ? nspec : 1);
929 double x0 = inWS->x(spec)[0];
930 double dx = inWS->x(spec)[1] - x0;
933 for (
size_t specA = spec; specA < spec + nSpecAnalyzed; specA++) {
941 for (
size_t i = 0; i < spectrumLengthX; i++) {
942 X[i] = x0 +
static_cast<double>(i) * dx;
949 for (
size_t i = 0; i < spectrumLength; i++) {
950 YR[i] = result[2 * i + 2 * specA * spectrumLength];
951 YI[i] = result[2 * i + 1 + 2 * specA * spectrumLength];
954 for (
size_t i = 0; i < spectrumLength; i++) {
955 YR[i] = result[2 * i];
956 YI[i] = result[2 * i + 1];
960 for (
size_t i = 0; i < spectrumLength; i++) {
966 outWS->mutableX(specA) =
X;
967 outWS->mutableY(specA) = YR;
968 outWS->mutableE(specA) = E;
969 outWS->mutableY(nspec + specA) = YI;
970 outWS->setSharedX(nspec + specA, outWS->sharedX(spec));
971 outWS->setSharedE(nspec + specA, outWS->sharedE(spec));
#define DECLARE_ALGORITHM(classname)
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
void progress(double p, const std::string &msg="", double estimatedTime=0.0, int progressPrecision=0)
Sends ProgressNotification.
void interruption_point()
This is called during long-running operations, and check if the algorithm has requested that it be ca...
Helper class for reporting progress from algorithms.
A property class for workspaces.
void populateImageWS(API::MatrixWorkspace_const_sptr &inWS, size_t spec, size_t nspec, const std::vector< double > &result, bool complex, API::MatrixWorkspace_sptr &outWS, bool autoShift)
Populates the output workspace containing the reconstructed image.
std::map< std::string, std::string > validateInputs() override
Validate the input properties.
int version() const override
Algorithm's version.
std::vector< double > solveSVD(Kernel::DblMatrix &A, const Kernel::DblMatrix &B)
Solves A*x = B using SVD.
std::vector< double > updateImage(const std::vector< double > &image, const std::vector< double > &delta, const std::vector< std::vector< double > > &dirs)
Updates the image.
std::vector< double > toComplex(API::MatrixWorkspace_const_sptr &inWS, size_t spec, bool errors, bool concatenatedSpectra)
Returns spectrum 'spec' as a complex vector.
const std::string category() const override
Algorithm's category.
double calculateChi(const QuadraticCoefficients &coeffs, double a, std::vector< double > &beta)
Calculates Chi given the quadratic coefficients and an alpha value by solving the matrix equation A*b...
void validateBinEdges(const std::string &wsName, std::map< std::string, std::string > &messages)
Checks the bin spacing is equal.
void init() override
Initialise the algorithm's properties.
const std::string summary() const override
Algorithm's summary.
std::vector< double > applyDistancePenalty(const std::vector< double > &beta, const QuadraticCoefficients &coeffs, const std::vector< double > &image, double background, double distEps)
Applies a distance penalty.
const std::string name() const override
Algorithm's name.
void populateDataWS(API::MatrixWorkspace_const_sptr &inWS, size_t spec, size_t nspec, const std::vector< double > &result, bool concatenatedSpectra, bool complex, API::MatrixWorkspace_sptr &outWS)
Populates the output workspace containing the reconstructed data.
void exec() override
Run the algorithm.
std::vector< double > move(const QuadraticCoefficients &coeffs, double ChiTargetOverN, double chiEps, size_t alphaIter)
Moves the system one step closer towards the solution.
MaxentCalculator : This class performs one maxent iteration and calculates chi-sq,...
std::vector< std::vector< double > > getSearchDirections() const
Returns the search directions (in image space)
double getAngle() const
Returns the angle between the gradient of chi-square and the gradient of the entropy (calculated and ...
std::vector< double > getReconstructedData() const
Returns the reconstructed (calculated) data.
QuadraticCoefficients getQuadraticCoefficients() const
Returns the quadratic coefficients.
void iterate(const std::vector< double > &data, const std::vector< double > &errors, const std::vector< double > &image, double background, const std::vector< double > &linearAdjustments, const std::vector< double > &constAdjustments)
Performs an iteration and calculates everything: search directions (SB.
double getChisq()
Returns chi-square.
std::vector< double > getImage() const
Returns the (reconstructed) image.
EqualBinsChecker : Checks for evenly spaced bins.
virtual std::string validate() const
Perform validation of the given X array.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void information(const std::string &msg)
Logs at information level.
std::pair< size_t, size_t > size() const
Access matrix sizes.
The concrete, templated class for properties.
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< MaxentTransform > MaxentTransform_sptr
std::shared_ptr< MaxentEntropy > MaxentEntropy_sptr
std::shared_ptr< MaxentSpace > MaxentSpace_sptr
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.
std::shared_ptr< Unit > Unit_sptr
Shared pointer to the Unit base class.
int32_t detid_t
Typedef for a detector ID.
std::vector< double > MantidVec
typedef for the data storage used in Mantid matrix workspaces
@ Input
An input workspace.
@ Output
An output workspace.
Mantid::Kernel::DblMatrix s2
Mantid::Kernel::DblMatrix s1
Mantid::Kernel::DblMatrix c1
Mantid::Kernel::DblMatrix c2