34void RebinnedOutput::init(
const std::size_t &NVectors,
const std::size_t &XLength,
const std::size_t &YLength) {
38 for (std::size_t i = 0; i < nHist; ++i) {
47 for (std::size_t i = 0; i < nHist; ++i) {
88 for (std::size_t i = 0; i < nHist; ++i) {
90 std::transform(frac.begin(), frac.end(), frac.begin(), [scale](
double x) { return scale * x; });
101 bool frac_all_zeros =
true;
102 for (
int i = 0; i < nHist; ++i) {
104 if (std::accumulate(frac.begin(), frac.end(), 0.) != 0) {
105 frac_all_zeros =
false;
109 return !frac_all_zeros;
132 for (
int i = 0; i < nHist; ++i) {
136 std::transform(err.begin(), err.end(), frac.begin(), err.begin(), std::divides<double>());
138 std::transform(err.begin(), err.end(), frac.begin(), err.begin(), std::multiplies<double>());
148 for (
int i = 0; i < nHist; ++i) {
152 std::transform(
data.begin(),
data.end(), frac.begin(),
data.begin(), std::divides<double>());
153 std::transform(err.begin(), err.end(), frac.begin(), err.begin(), std::divides<double>());
155 std::transform(err.begin(), err.end(), frac.begin(), err.begin(), std::divides<double>());
175 for (
int i = 0; i < nHist; ++i) {
179 std::transform(
data.begin(),
data.end(), frac.begin(),
data.begin(), std::multiplies<double>());
180 std::transform(err.begin(), err.end(), frac.begin(), err.begin(), std::multiplies<double>());
182 std::transform(err.begin(), err.end(), frac.begin(), err.begin(), std::multiplies<double>());
std::map< DeltaEMode::Type, std::string > index
#define PARALLEL_FOR_IF(condition)
Empty definitions - to enable set your complier to enable openMP.
#define DECLARE_WORKSPACE(classname)
virtual MantidVec & dataE(const std::size_t index)
Deprecated, use mutableE() instead. Returns the error data.
HistogramData::Histogram histogram(const size_t index) const
Returns the Histogram at the given workspace index.
virtual MantidVec & dataY(const std::size_t index)
Deprecated, use mutableY() instead. Returns the y data.
const MantidVec & readF(std::size_t const index) const
Returns a read-only (i.e. const) reference to the specified F array.
void scaleF(const double scale)
Multiply the fractional area arrays by a scale factor.
bool m_hasSqrdErrs
Flag to indiciate if the finalized data used squared errors.
virtual MantidVec & dataF(const std::size_t index)
Returns the fractional area.
void finalize(bool hasSqrdErrs=true)
Finalize to fractional area representation.
void unfinalize()
Undo fractional area representation.
bool nonZeroF() const
Returns if the fractional area is non zero.
bool m_finalized
Flag to indicate if finalize has been called, and if errors/variance used.
void setF(const std::size_t index, const MantidVecPtr &F)
Set the fractional area array for a given index.
void init(const std::size_t &NVectors, const std::size_t &XLength, const std::size_t &YLength) override
Called by initialize() in MatrixWorkspace.
std::vector< MantidVec > fracArea
A vector that holds the 1D vectors for the fractional area.
std::size_t getNumberHistograms() const override
Returns the histogram number.
std::vector< std::unique_ptr< Histogram1D > > data
A vector that holds the 1D histograms.
void init(const std::size_t &NVectors, const std::size_t &XLength, const std::size_t &YLength) override
Called by initialize()
Implements a copy on write data template.
std::enable_if< std::is_pointer< Arg >::value, bool >::type threadSafe(Arg workspace)
Thread-safety check Checks the workspace to ensure it is suitable for multithreaded access.
std::vector< double > MantidVec
typedef for the data storage used in Mantid matrix workspaces