Skip to content

Commit

Permalink
Refs #6315. Handling W matrix the right way in test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Reuter committed Apr 26, 2013
1 parent bf4e3fa commit 51dfeaf
Showing 1 changed file with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "MantidAPI/ExperimentInfo.h"
#include "MantidAPI/IMDEventWorkspace.h"
#include "MantidKernel/Matrix.h"
#include "MantidKernel/PropertyWithValue.h"
#include "MantidMDEvents/CoordTransformAffine.h"
#include "MantidTestHelpers/MDEventsTestHelper.h"

Expand Down Expand Up @@ -94,28 +95,29 @@ class vtkDataSetToNonOrthogonalDataSetTest : public CxxTest::TestSuite
ws->setTransformToOriginal(affMat.clone(), 0);

// Create the transform (W) matrix
DblMatrix wMat;
// Need it as a vector
std::vector<double> wMat;
if (!nonUnityTransform)
{
DblMatrix temp(3, 3, true);
wMat = temp;
wMat = temp.getVector();
}
else
{
std::vector<double> trans;
trans.push_back(1);
trans.push_back(1);
trans.push_back(0);
trans.push_back(1);
trans.push_back(-1);
trans.push_back(0);
trans.push_back(0);
trans.push_back(0);
trans.push_back(1);
DblMatrix temp(trans);
wMat = temp;
wMat.push_back(1);
wMat.push_back(1);
wMat.push_back(0);
wMat.push_back(1);
wMat.push_back(-1);
wMat.push_back(0);
wMat.push_back(0);
wMat.push_back(0);
wMat.push_back(1);
}
ws->setWTransf(wMat);
// Create property for W matrix and add it as log to run object
PropertyWithValue<std::vector<double> > *p;
p = new PropertyWithValue<std::vector<double> >("W_MATRIX", wMat);
ws->getExperimentInfo(0)->mutableRun().addProperty(p, true);

return wsName;
}
Expand Down

0 comments on commit 51dfeaf

Please sign in to comment.