Skip to content

Commit

Permalink
Refs #6670 Fixed out-of-bound error
Browse files Browse the repository at this point in the history
  • Loading branch information
jmborr committed May 23, 2013
1 parent 16b33cd commit 42ad9a8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Code/Mantid/Framework/Algorithms/test/ModeratorTzeroTest.h
Expand Up @@ -25,12 +25,10 @@ static ModeratorTzeroTest *createSuite() { return new ModeratorTzeroTest(); }
static void destroySuite( ModeratorTzeroTest *suite ) { delete suite; }


/*
ModeratorTzeroTest()
{
FrameworkManager::Instance(); // Load plugins
}
*/

void TestInit()
{
Expand Down Expand Up @@ -141,13 +139,13 @@ MatrixWorkspace_sptr CreateHistogramWorkspace()
MantidVecPtr xdata;
xdata.access().resize(numBins+1);
const double peakHeight(1000), peakCentre(7000.), sigmaSq(1000*1000.);
for(int ibin=0; ibin<=numBins; ++ibin)
for(int ibin=0; ibin<numBins; ++ibin)
{
const double xValue=4*ibin;
testWS->dataY(0)[ibin]=peakHeight*exp(-0.5*pow(xValue-peakCentre, 2.)/sigmaSq);
// do we add data for the monitor spectra, too?
xdata.access()[ibin] = xValue;
}
xdata.access()[numBins] = 4*numBins;
for( int ihist=0; ihist<numHists; ihist++)
testWS->setX(ihist, xdata);
return testWS;
Expand Down

0 comments on commit 42ad9a8

Please sign in to comment.