本文整理汇总了C++中api::MatrixWorkspace_sptr::readE方法的典型用法代码示例。如果您正苦于以下问题:C++ MatrixWorkspace_sptr::readE方法的具体用法?C++ MatrixWorkspace_sptr::readE怎么用?C++ MatrixWorkspace_sptr::readE使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类api::MatrixWorkspace_sptr
的用法示例。
在下文中一共展示了MatrixWorkspace_sptr::readE方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: invalid_argument
/** Returns a given spectrum as a complex number
* @param inWS :: [input] The input workspace containing all the spectra
* @param spec :: [input] The spectrum of interest
* @param errors :: [input] If true, returns the errors, otherwise returns the
* counts
* @return : Spectrum 'spec' as a complex vector
*/
std::vector<double> MaxEnt::toComplex(const API::MatrixWorkspace_sptr &inWS,
size_t spec, bool errors) {
std::vector<double> result(inWS->blocksize() * 2);
if (inWS->getNumberHistograms() % 2)
throw std::invalid_argument(
"Cannot convert input workspace to complex data");
size_t nspec = inWS->getNumberHistograms() / 2;
if (!errors) {
for (size_t i = 0; i < inWS->blocksize(); i++) {
result[2 * i] = inWS->readY(spec)[i];
result[2 * i + 1] = inWS->readY(spec + nspec)[i];
}
} else {
for (size_t i = 0; i < inWS->blocksize(); i++) {
result[2 * i] = inWS->readE(spec)[i];
result[2 * i + 1] = inWS->readE(spec + nspec)[i];
}
}
return result;
}
示例2: normaliseBinByBin
/** Carries out the bin-by-bin normalisation
* @param inputWorkspace The input workspace
* @param outputWorkspace The result workspace
*/
void NormaliseToMonitor::normaliseBinByBin(API::MatrixWorkspace_sptr inputWorkspace,
API::MatrixWorkspace_sptr& outputWorkspace)
{
EventWorkspace_sptr inputEvent = boost::dynamic_pointer_cast<EventWorkspace>(inputWorkspace);
EventWorkspace_sptr outputEvent;
// Only create output workspace if different to input one
if (outputWorkspace != inputWorkspace )
{
if (inputEvent)
{
//Make a brand new EventWorkspace
outputEvent = boost::dynamic_pointer_cast<EventWorkspace>(
API::WorkspaceFactory::Instance().create("EventWorkspace", inputEvent->getNumberHistograms(), 2, 1));
//Copy geometry and data
API::WorkspaceFactory::Instance().initializeFromParent(inputEvent, outputEvent, false);
outputEvent->copyDataFrom( (*inputEvent) );
outputWorkspace = boost::dynamic_pointer_cast<MatrixWorkspace>(outputEvent);
}
else
outputWorkspace = WorkspaceFactory::Instance().create(inputWorkspace);
}
// Get hold of the monitor spectrum
const MantidVec& monX = m_monitor->readX(0);
MantidVec& monY = m_monitor->dataY(0);
MantidVec& monE = m_monitor->dataE(0);
// Calculate the overall normalisation just the once if bins are all matching
if (m_commonBins) this->normalisationFactor(m_monitor->readX(0),&monY,&monE);
const size_t numHists = inputWorkspace->getNumberHistograms();
MantidVec::size_type specLength = inputWorkspace->blocksize();
Progress prog(this,0.0,1.0,numHists);
// Loop over spectra
PARALLEL_FOR3(inputWorkspace,outputWorkspace,m_monitor)
for (int64_t i = 0; i < int64_t(numHists); ++i)
{
PARALLEL_START_INTERUPT_REGION
prog.report();
const MantidVec& X = inputWorkspace->readX(i);
// If not rebinning, just point to our monitor spectra, otherwise create new vectors
MantidVec* Y = ( m_commonBins ? &monY : new MantidVec(specLength) );
MantidVec* E = ( m_commonBins ? &monE : new MantidVec(specLength) );
if (!m_commonBins)
{
// ConvertUnits can give X vectors of all zeroes - skip these, they cause problems
if (X.back() == 0.0 && X.front() == 0.0) continue;
// Rebin the monitor spectrum to match the binning of the current data spectrum
VectorHelper::rebinHistogram(monX,monY,monE,X,*Y,*E,false);
// Recalculate the overall normalisation factor
this->normalisationFactor(X,Y,E);
}
if (inputEvent)
{
// ----------------------------------- EventWorkspace ---------------------------------------
EventList & outEL = outputEvent->getEventList(i);
outEL.divide(X, *Y, *E);
}
else
{
// ----------------------------------- Workspace2D ---------------------------------------
const MantidVec& inY = inputWorkspace->readY(i);
const MantidVec& inE = inputWorkspace->readE(i);
MantidVec& YOut = outputWorkspace->dataY(i);
MantidVec& EOut = outputWorkspace->dataE(i);
outputWorkspace->dataX(i) = inputWorkspace->readX(i);
// The code below comes more or less straight out of Divide.cpp
for (MantidVec::size_type k = 0; k < specLength; ++k)
{
// Get references to the input Y's
const double& leftY = inY[k];
const double& rightY = (*Y)[k];
// Calculate result and store in local variable to avoid overwriting original data if
// output workspace is same as one of the input ones
const double newY = leftY/rightY;
if (fabs(rightY)>1.0e-12 && fabs(newY)>1.0e-12)
{
const double lhsFactor = (inE[k]<1.0e-12|| fabs(leftY)<1.0e-12) ? 0.0 : pow((inE[k]/leftY),2);
const double rhsFactor = (*E)[k]<1.0e-12 ? 0.0 : pow(((*E)[k]/rightY),2);
EOut[k] = std::abs(newY) * sqrt(lhsFactor+rhsFactor);
}
// Now store the result
YOut[k] = newY;
} // end Workspace2D case
} // end loop over current spectrum
if (!m_commonBins) { delete Y; delete E; }
PARALLEL_END_INTERUPT_REGION
} // end loop over spectra
//.........这里部分代码省略.........
示例3: exec
/** Executes the algorithm
*
*/
void SplineBackground::exec()
{
API::MatrixWorkspace_sptr inWS = getProperty("InputWorkspace");
int spec = getProperty("WorkspaceIndex");
if (spec > static_cast<int>(inWS->getNumberHistograms()))
throw std::out_of_range("WorkspaceIndex is out of range.");
const MantidVec& X = inWS->readX(spec);
const MantidVec& Y = inWS->readY(spec);
const MantidVec& E = inWS->readE(spec);
const bool isHistogram = inWS->isHistogramData();
const int ncoeffs = getProperty("NCoeff");
const int k = 4; // order of the spline + 1 (cubic)
const int nbreak = ncoeffs - (k - 2);
if (nbreak <= 0)
throw std::out_of_range("Too low NCoeff");
gsl_bspline_workspace *bw;
gsl_vector *B;
gsl_vector *c, *w, *x, *y;
gsl_matrix *Z, *cov;
gsl_multifit_linear_workspace *mw;
double chisq;
int n = static_cast<int>(Y.size());
bool isMasked = inWS->hasMaskedBins(spec);
std::vector<int> masked(Y.size());
if (isMasked)
{
for(API::MatrixWorkspace::MaskList::const_iterator it=inWS->maskedBins(spec).begin();it!=inWS->maskedBins(spec).end();++it)
masked[it->first] = 1;
n -= static_cast<int>(inWS->maskedBins(spec).size());
}
if (n < ncoeffs)
{
g_log.error("Too many basis functions (NCoeff)");
throw std::out_of_range("Too many basis functions (NCoeff)");
}
/* allocate a cubic bspline workspace (k = 4) */
bw = gsl_bspline_alloc(k, nbreak);
B = gsl_vector_alloc(ncoeffs);
x = gsl_vector_alloc(n);
y = gsl_vector_alloc(n);
Z = gsl_matrix_alloc(n, ncoeffs);
c = gsl_vector_alloc(ncoeffs);
w = gsl_vector_alloc(n);
cov = gsl_matrix_alloc(ncoeffs, ncoeffs);
mw = gsl_multifit_linear_alloc(n, ncoeffs);
/* this is the data to be fitted */
int j = 0;
for (MantidVec::size_type i = 0; i < Y.size(); ++i)
{
if (isMasked && masked[i]) continue;
gsl_vector_set(x, j, (isHistogram ? (0.5*(X[i]+X[i+1])) : X[i])); // Middle of the bins, if a histogram
gsl_vector_set(y, j, Y[i]);
gsl_vector_set(w, j, E[i]>0.?1./(E[i]*E[i]):0.);
++j;
}
if (n != j)
{
gsl_bspline_free(bw);
gsl_vector_free(B);
gsl_vector_free(x);
gsl_vector_free(y);
gsl_matrix_free(Z);
gsl_vector_free(c);
gsl_vector_free(w);
gsl_matrix_free(cov);
gsl_multifit_linear_free(mw);
throw std::runtime_error("Assertion failed: n != j");
}
double xStart = X.front();
double xEnd = X.back();
/* use uniform breakpoints */
gsl_bspline_knots_uniform(xStart, xEnd, bw);
/* construct the fit matrix X */
for (int i = 0; i < n; ++i)
{
double xi=gsl_vector_get(x, i);
/* compute B_j(xi) for all j */
gsl_bspline_eval(xi, B, bw);
//.........这里部分代码省略.........
示例4: doDetectorTests
/**
* Takes a single valued histogram workspace and assesses which histograms are within the limits.
* Those that are not are masked on the input workspace.
* @param countsWS :: Input/Output Integrated workspace to diagnose.
* @param medianvec The median value calculated from the current counts.
* @param indexmap Index map.
* @param maskWS :: A mask workspace to apply.
* @return The number of detectors that failed the tests, not including those skipped.
*/
int MedianDetectorTest::doDetectorTests(const API::MatrixWorkspace_sptr countsWS, const std::vector<double> medianvec,
std::vector<std::vector<size_t> > indexmap, API::MatrixWorkspace_sptr maskWS)
{
g_log.debug("Applying the criteria to find failing detectors");
// A spectra can't fail if the statistics show its value is consistent with the mean value,
// check the error and how many errorbars we are away
const double minSigma = getProperty("SignificanceTest");
// prepare to report progress
const int numSpec(m_maxSpec - m_minSpec);
const int progStep = static_cast<int>(ceil(numSpec/30.0));
int steps(0);
const double deadValue(1.0);
int numFailed(0);
bool checkForMask = false;
Geometry::Instrument_const_sptr instrument = countsWS->getInstrument();
if (instrument != NULL)
{
checkForMask = ((instrument->getSource() != NULL) && (instrument->getSample() != NULL));
}
PARALLEL_FOR2(countsWS, maskWS)
for (int j=0;j<static_cast<int>(indexmap.size());++j)
{
std::vector<size_t> hists=indexmap.at(j);
double median=medianvec.at(j);
const size_t nhist = hists.size();
g_log.debug() << "new component with " <<nhist <<" spectra.\n";
for (size_t i = 0; i < nhist; ++i)
{
g_log.debug() << "Counts workspace index=" << i
<< ", Mask workspace index=" << hists.at(i) << std::endl;
PARALLEL_START_INTERUPT_REGION
++steps;
// update the progressbar information
if (steps % progStep == 0)
{
progress(advanceProgress(progStep*static_cast<double>(RTMarkDetects)/numSpec));
}
if (checkForMask)
{
const std::set<detid_t>& detids = countsWS->getSpectrum(i)->getDetectorIDs();
if (instrument->isDetectorMasked(detids))
{
maskWS->dataY(hists.at(i))[0] = deadValue;
continue;
}
if (instrument->isMonitor(detids))
{
// Don't include in calculation but don't mask it
continue;
}
}
const double signal = countsWS->dataY(hists.at(i))[0];
// Mask out NaN and infinite
if( boost::math::isinf(signal) || boost::math::isnan(signal) )
{
maskWS->dataY(hists.at(i))[0] = deadValue;
PARALLEL_ATOMIC
++numFailed;
continue;
}
const double error = minSigma*countsWS->readE(hists.at(i))[0];
if( (signal < median*m_loFrac && (signal-median < -error)) ||
(signal > median*m_hiFrac && (signal-median > error)) )
{
maskWS->dataY(hists.at(i))[0] = deadValue;
PARALLEL_ATOMIC
++numFailed;
}
PARALLEL_END_INTERUPT_REGION
}
PARALLEL_CHECK_INTERUPT_REGION
// Log finds
g_log.information() << numFailed << " spectra failed the median tests.\n";
}
return numFailed;
}
示例5: exec
/** Executes the algorithm
* @throw Exception::FileError If the calibration file cannot be opened and
* read successfully
* @throw Exception::InstrumentDefinitionError If unable to obtain the
* source-sample distance
*/
void AlignDetectors::exec() {
// Get the input workspace
MatrixWorkspace_sptr inputWS = getProperty("InputWorkspace");
this->getCalibrationWS(inputWS);
// Initialise the progress reporting object
m_numberOfSpectra = static_cast<int64_t>(inputWS->getNumberHistograms());
// Check if its an event workspace
EventWorkspace_const_sptr eventW =
boost::dynamic_pointer_cast<const EventWorkspace>(inputWS);
if (eventW != nullptr) {
this->execEvent();
return;
}
API::MatrixWorkspace_sptr outputWS = getProperty("OutputWorkspace");
// If input and output workspaces are not the same, create a new workspace for
// the output
if (outputWS != inputWS) {
outputWS = WorkspaceFactory::Instance().create(inputWS);
setProperty("OutputWorkspace", outputWS);
}
// Set the final unit that our output workspace will have
setXAxisUnits(outputWS);
ConversionFactors converter = ConversionFactors(m_calibrationWS);
Progress progress(this, 0.0, 1.0, m_numberOfSpectra);
// Loop over the histograms (detector spectra)
PARALLEL_FOR2(inputWS, outputWS)
for (int64_t i = 0; i < m_numberOfSpectra; ++i) {
PARALLEL_START_INTERUPT_REGION
try {
// Get the input spectrum number at this workspace index
auto inSpec = inputWS->getSpectrum(size_t(i));
auto toDspacing = converter.getConversionFunc(inSpec->getDetectorIDs());
// Get references to the x data
MantidVec &xOut = outputWS->dataX(i);
// Make sure reference to input X vector is obtained after output one
// because in the case
// where the input & output workspaces are the same, it might move if the
// vectors were shared.
const MantidVec &xIn = inSpec->readX();
std::transform(xIn.begin(), xIn.end(), xOut.begin(), toDspacing);
// Copy the Y&E data
outputWS->dataY(i) = inSpec->readY();
outputWS->dataE(i) = inSpec->readE();
} catch (Exception::NotFoundError &) {
// Zero the data in this case
outputWS->dataX(i).assign(outputWS->readX(i).size(), 0.0);
outputWS->dataY(i).assign(outputWS->readY(i).size(), 0.0);
outputWS->dataE(i).assign(outputWS->readE(i).size(), 0.0);
}
progress.report();
PARALLEL_END_INTERUPT_REGION
}
PARALLEL_CHECK_INTERUPT_REGION
}
示例6: copyInput
/**
* Execute smoothing of a single spectrum.
* @param inputWS :: A workspace to pick a spectrum from.
* @param wsIndex :: An index of a spectrum to smooth.
* @return :: A single-spectrum workspace with the smoothed data.
*/
API::MatrixWorkspace_sptr
WienerSmooth::smoothSingleSpectrum(API::MatrixWorkspace_sptr inputWS,
size_t wsIndex) {
size_t dataSize = inputWS->blocksize();
// it won't work for very small workspaces
if (dataSize < 4) {
g_log.debug() << "No smoothing, spectrum copied." << std::endl;
return copyInput(inputWS, wsIndex);
}
// Due to the way RealFFT works the input should be even-sized
const bool isOddSize = dataSize % 2 != 0;
if (isOddSize) {
// add a fake value to the end to make size even
inputWS = copyInput(inputWS, wsIndex);
wsIndex = 0;
auto &X = inputWS->dataX(wsIndex);
auto &Y = inputWS->dataY(wsIndex);
auto &E = inputWS->dataE(wsIndex);
double dx = X[dataSize - 1] - X[dataSize - 2];
X.push_back(X.back() + dx);
Y.push_back(Y.back());
E.push_back(E.back());
}
// the input vectors
auto &X = inputWS->readX(wsIndex);
auto &Y = inputWS->readY(wsIndex);
auto &E = inputWS->readE(wsIndex);
// Digital fourier transform works best for data oscillating around 0.
// Fit a spline with a small number of break points to the data.
// Make sure that the spline passes through the first and the last points
// of the data.
// The fitted spline will be subtracted from the data and the difference
// will be smoothed with the Wiener filter. After that the spline will be
// added to the smoothed data to produce the output.
// number of spline break points, must be smaller than the data size but
// between 2 and 10
size_t nbreak = 10;
if (nbreak * 3 > dataSize)
nbreak = dataSize / 3;
// NB. The spline mustn't fit too well to the data. If it does smoothing
// doesn't happen.
// TODO: it's possible that the spline is unnecessary and a simple linear
// function will
// do a better job.
g_log.debug() << "Spline break points " << nbreak << std::endl;
// define the spline
API::IFunction_sptr spline =
API::FunctionFactory::Instance().createFunction("BSpline");
auto xInterval = getStartEnd(X, inputWS->isHistogramData());
spline->setAttributeValue("StartX", xInterval.first);
spline->setAttributeValue("EndX", xInterval.second);
spline->setAttributeValue("NBreak", static_cast<int>(nbreak));
// fix the first and last parameters to the first and last data values
spline->setParameter(0, Y.front());
spline->fix(0);
size_t lastParamIndex = spline->nParams() - 1;
spline->setParameter(lastParamIndex, Y.back());
spline->fix(lastParamIndex);
// fit the spline to the data
auto fit = createChildAlgorithm("Fit");
fit->initialize();
fit->setProperty("Function", spline);
fit->setProperty("InputWorkspace", inputWS);
fit->setProperty("WorkspaceIndex", static_cast<int>(wsIndex));
fit->setProperty("CreateOutput", true);
fit->execute();
// get the fit output workspace; spectrum 2 contains the difference that is to
// be smoothed
API::MatrixWorkspace_sptr fitOut = fit->getProperty("OutputWorkspace");
// Fourier transform the difference spectrum
auto fourier = createChildAlgorithm("RealFFT");
fourier->initialize();
fourier->setProperty("InputWorkspace", fitOut);
fourier->setProperty("WorkspaceIndex", 2);
// we don't require bin linearity as we don't need the exact transform
fourier->setProperty("IgnoreXBins", true);
fourier->execute();
API::MatrixWorkspace_sptr fourierOut =
fourier->getProperty("OutputWorkspace");
// spectrum 2 of the transformed workspace has the transform modulus which is
// a square
//.........这里部分代码省略.........
示例7: calcIntAsymmetry
/** Calculate the integral asymmetry for a workspace.
* The calculation is done by MuonAsymmetryCalc and SimpleIntegration algorithms.
* @param ws :: The workspace
* @param Y :: Reference to a variable receiving the value of asymmetry
* @param E :: Reference to a variable receiving the value of the error
*/
void PlotAsymmetryByLogValue::calcIntAsymmetry(API::MatrixWorkspace_sptr ws, double& Y, double& E)
{
Property* startXprop = getProperty("TimeMin");
Property* endXprop = getProperty("TimeMax");
bool setX = !startXprop->isDefault() && !endXprop->isDefault();
double startX(0.0),endX(0.0);
if (setX)
{
startX = getProperty("TimeMin");
endX = getProperty("TimeMax");
}
if (!m_int)
{ // "Differential asymmetry"
IAlgorithm_sptr asym = createChildAlgorithm("AsymmetryCalc");
asym->initialize();
asym->setProperty("InputWorkspace",ws);
asym->setPropertyValue("OutputWorkspace","tmp");
if ( !m_autogroup )
{
asym->setProperty("ForwardSpectra",m_forward_list);
asym->setProperty("BackwardSpectra",m_backward_list);
}
asym->execute();
MatrixWorkspace_sptr asymWS = asym->getProperty("OutputWorkspace");
IAlgorithm_sptr integr = createChildAlgorithm("Integration");
integr->setProperty("InputWorkspace",asymWS);
integr->setPropertyValue("OutputWorkspace","tmp");
if (setX)
{
integr->setProperty("RangeLower",startX);
integr->setProperty("RangeUpper",endX);
}
integr->execute();
API::MatrixWorkspace_sptr out = integr->getProperty("OutputWorkspace");
Y = out->readY(0)[0];
E = out->readE(0)[0];
}
else
{
// "Integral asymmetry"
IAlgorithm_sptr integr = createChildAlgorithm("Integration");
integr->setProperty("InputWorkspace", ws);
integr->setPropertyValue("OutputWorkspace","tmp");
if (setX)
{
integr->setProperty("RangeLower",startX);
integr->setProperty("RangeUpper",endX);
}
integr->execute();
API::MatrixWorkspace_sptr intWS = integr->getProperty("OutputWorkspace");
IAlgorithm_sptr asym = createChildAlgorithm("AsymmetryCalc");
asym->initialize();
asym->setProperty("InputWorkspace",intWS);
asym->setPropertyValue("OutputWorkspace","tmp");
if ( !m_autogroup )
{
asym->setProperty("ForwardSpectra",m_forward_list);
asym->setProperty("BackwardSpectra",m_backward_list);
}
asym->execute();
MatrixWorkspace_sptr out = asym->getProperty("OutputWorkspace");
Y = out->readY(0)[0];
E = out->readE(0)[0];
}
}
示例8: exec
/** Executes the algorithm
* @throw Exception::FileError If the calibration file cannot be opened and read successfully
* @throw Exception::InstrumentDefinitionError If unable to obtain the source-sample distance
*/
void AlignDetectors::exec()
{
// Get the input workspace
MatrixWorkspace_sptr inputWS = getProperty("InputWorkspace");
// Read in the calibration data
const std::string calFileName = getProperty("CalibrationFile");
OffsetsWorkspace_sptr offsetsWS = getProperty("OffsetsWorkspace");
progress(0.0,"Reading calibration file");
if (offsetsWS && !calFileName.empty())
throw std::invalid_argument("You must specify either CalibrationFile or OffsetsWorkspace but not both.");
if (!offsetsWS && calFileName.empty())
throw std::invalid_argument("You must specify either CalibrationFile or OffsetsWorkspace.");
if (!calFileName.empty())
{
// Load the .cal file
IAlgorithm_sptr alg = createChildAlgorithm("LoadCalFile");
alg->setPropertyValue("CalFilename", calFileName);
alg->setProperty("InputWorkspace", inputWS);
alg->setProperty<bool>("MakeGroupingWorkspace", false);
alg->setProperty<bool>("MakeOffsetsWorkspace", true);
alg->setProperty<bool>("MakeMaskWorkspace", false);
alg->setPropertyValue("WorkspaceName", "temp");
alg->executeAsChildAlg();
offsetsWS = alg->getProperty("OutputOffsetsWorkspace");
}
const int64_t numberOfSpectra = inputWS->getNumberHistograms();
// generate map of the tof->d conversion factors
this->tofToDmap = calcTofToD_ConversionMap(inputWS, offsetsWS);
//Check if its an event workspace
EventWorkspace_const_sptr eventW = boost::dynamic_pointer_cast<const EventWorkspace>(inputWS);
if (eventW != NULL)
{
this->execEvent();
return;
}
API::MatrixWorkspace_sptr outputWS = getProperty("OutputWorkspace");
// If input and output workspaces are not the same, create a new workspace for the output
if (outputWS != inputWS )
{
outputWS = WorkspaceFactory::Instance().create(inputWS);
setProperty("OutputWorkspace",outputWS);
}
// Set the final unit that our output workspace will have
outputWS->getAxis(0)->unit() = UnitFactory::Instance().create("dSpacing");
// Initialise the progress reporting object
Progress progress(this,0.0,1.0,numberOfSpectra);
// Loop over the histograms (detector spectra)
PARALLEL_FOR2(inputWS,outputWS)
for (int64_t i = 0; i < int64_t(numberOfSpectra); ++i)
{
PARALLEL_START_INTERUPT_REGION
try {
// Get the input spectrum number at this workspace index
const ISpectrum * inSpec = inputWS->getSpectrum(size_t(i));
const double factor = calcConversionFromMap(this->tofToDmap, inSpec->getDetectorIDs());
// Get references to the x data
MantidVec& xOut = outputWS->dataX(i);
// Make sure reference to input X vector is obtained after output one because in the case
// where the input & output workspaces are the same, it might move if the vectors were shared.
const MantidVec& xIn = inSpec->readX();
//std::transform( xIn.begin(), xIn.end(), xOut.begin(), std::bind2nd(std::multiplies<double>(), factor) );
// the above transform creates wrong output in parallel in debug in Visual Studio
for(size_t k = 0; k < xOut.size(); ++k)
{
xOut[k] = xIn[k] * factor;
}
// Copy the Y&E data
outputWS->dataY(i) = inSpec->readY();
outputWS->dataE(i) = inSpec->readE();
} catch (Exception::NotFoundError &) {
// Zero the data in this case
outputWS->dataX(i).assign(outputWS->readX(i).size(),0.0);
outputWS->dataY(i).assign(outputWS->readY(i).size(),0.0);
outputWS->dataE(i).assign(outputWS->readE(i).size(),0.0);
}
progress.report();
PARALLEL_END_INTERUPT_REGION
}
PARALLEL_CHECK_INTERUPT_REGION
}