Skip to content
Snippets Groups Projects
Commit 3c021300 authored by Nick Draper's avatar Nick Draper Committed by GitHub
Browse files

Merge pull request #20710 from mantidproject/MaxEnt_performance_regression

Fix performance regression in MaxEnt performance test
parents cc269a20 71b5a5e5
No related branches found
No related tags found
No related merge requests found
......@@ -19,13 +19,8 @@
namespace Mantid {
namespace Algorithms {
using Mantid::Kernel::Direction;
using Mantid::API::WorkspaceProperty;
using Mantid::HistogramData::Points;
using Mantid::HistogramData::BinEdges;
using Mantid::HistogramData::Counts;
using Mantid::HistogramData::CountStandardDeviations;
using Mantid::HistogramData::LinearGenerator;
using Mantid::HistogramData::Points;
using namespace API;
using namespace Kernel;
......@@ -227,7 +222,8 @@ void MaxEnt::exec() {
MatrixWorkspace_const_sptr inWS = getProperty("InputWorkspace");
// Number of spectra
size_t nspec = inWS->getNumberHistograms();
// Number of data points
// Number of data points - assumed to be constant between spectra or
// this will throw an exception
size_t npoints = inWS->blocksize() * resolutionFactor;
// Number of X bins
const size_t npointsX = inWS->isHistogramData() ? npoints + 1 : npoints;
......@@ -378,7 +374,7 @@ void MaxEnt::exec() {
*/
std::vector<double> MaxEnt::toComplex(API::MatrixWorkspace_const_sptr &inWS,
size_t spec, bool errors) {
const size_t numBins = inWS->blocksize();
const size_t numBins = inWS->y(0).size();
std::vector<double> result(numBins * 2);
if (inWS->getNumberHistograms() % 2)
......@@ -687,11 +683,11 @@ void MaxEnt::populateImageWS(MatrixWorkspace_const_sptr &inWS, size_t spec,
double dx = dataPoints[1] - x0;
double delta = 1. / dx / npoints;
int isOdd = (inWS->blocksize() % 2) ? 1 : 0;
const int isOdd = (inWS->y(0).size() % 2) ? 1 : 0;
double shift = x0 * 2 * M_PI;
double shift = x0 * 2. * M_PI;
if (!autoShift)
shift = 0;
shift = 0.;
// X values
for (int i = 0; i < npoints; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment