23 "The name of the input workspace");
25 "The name to use for the output workspace (can be the same "
26 "as the input one).");
47 if (out_work != in_work) {
48 if (in_work->id() ==
"EventWorkspace") {
52 out_work = in_work->clone();
60 const size_t numSpec = in_work->getNumberHistograms();
61 const size_t specSize = in_work->blocksize();
69 for (int64_t i = 0; i < int64_t(numSpec); ++i) {
72 out_work->setSharedX(i, in_work->sharedX(i));
76 auto &YOut = out_work->mutableY(i);
77 auto &EOut = out_work->mutableE(i);
78 const auto X = in_work->points(i);
79 const auto &
Y = in_work->y(i);
80 const auto &E = in_work->e(i);
82 for (
size_t j = 0; j < specSize; ++j) {
101 if (matrixOutputWS != matrixInputWS) {
102 matrixOutputWS = matrixInputWS->clone();
105 auto outputWS = std::dynamic_pointer_cast<EventWorkspace>(matrixOutputWS);
110 auto numHistograms =
static_cast<int64_t
>(outputWS->getNumberHistograms());
113 for (int64_t i = 0; i < numHistograms; ++i) {
117 auto &evlist = outputWS->getSpectrum(i);
118 switch (evlist.getEventType()) {
139 outputWS->clearMRU();
140 auto inputWS = std::dynamic_pointer_cast<EventWorkspace>(matrixOutputWS);
141 if (inputWS->getNumberEvents() != outputWS->getNumberEvents()) {
149 typename std::vector<T>::iterator it;
150 for (it = wevector.begin(); it < wevector.end(); ++it) {
154 it->m_weight =
static_cast<float>(yout);
155 it->m_errorSquared =
static_cast<float>(eout * eout);
#define PARALLEL_START_INTERRUPT_REGION
Begins a block to skip processing is the algorithm has been interupted Note the end of the block if n...
#define PARALLEL_END_INTERRUPT_REGION
Ends a block to skip processing is the algorithm has been interupted Note the start of the block if n...
#define PARALLEL_FOR_IF(condition)
Empty definitions - to enable set your complier to enable openMP.
#define PARALLEL_CHECK_INTERRUPT_REGION
Adds a check after a Parallel region to see if it was interupted.
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
void progress(double p, const std::string &msg="", double estimatedTime=0.0, int progressPrecision=0)
Sends ProgressNotification.
Helper class for reporting progress from algorithms.
A property class for workspaces.
bool useHistogram
flag to use histogram representation instead of events for certain algorithms
virtual void defineProperties()
A virtual function in which additional properties of an algorithm should be declared.
virtual const std::string outputPropName() const
The name of the output workspace property.
void unaryOperationEventHelper(std::vector< T > &wevector)
Helper for events, for use with different types of weighted events.
virtual void performUnaryOperation(const double XIn, const double YIn, const double EIn, double &YOut, double &EOut)=0
Carries out the Unary operation on the current 'cell'.
void exec() override
Executes the algorithm.
void init() override
Initialisation method.
virtual const std::string inputPropName() const
The name of the input workspace property.
virtual void retrieveProperties()
A virtual function in which additional properties should be retrieved into member variables.
virtual void execEvent()
Executes the algorithm for events.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void information(const std::string &msg)
Logs at information level.
void report()
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< const EventWorkspace > EventWorkspace_const_sptr
shared pointer to a const Workspace2D
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.
@ Input
An input workspace.
@ Output
An output workspace.