10#include "MantidIndexing/IndexInfo.h"
22 "Name to use for the output workspace");
23 declareProperty(
"DataValue", 0.0,
"The value to place in the workspace");
24 auto mustBePositive = std::make_shared<BoundedValidator<double>>();
25 mustBePositive->setLower(0.0);
26 declareProperty(
"ErrorValue", 0.0, mustBePositive,
"The error value to place in the workspace (default 0.0)");
33 Indexing::IndexInfo indexInfo(1, Parallel::StorageMode::Cloned,
communicator());
34 auto singleValued = DataObjects::create<DataObjects::WorkspaceSingleValue>(indexInfo, HistogramData::Points(1));
36 singleValued->mutableX(0)[0] = 0.0;
37 singleValued->mutableY(0)[0] = dataValue;
38 singleValued->mutableE(0)[0] = errorValue;
40 setProperty(
"OutputWorkspace", std::move(singleValued));
44 const std::map<std::string, Parallel::StorageMode> &storageModes)
const {
45 static_cast<void>(storageModes);
46 return Parallel::ExecutionMode::Identical;
#define DECLARE_ALGORITHM(classname)
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
const Parallel::Communicator & communicator() const
Returns a const reference to the (MPI) communicator of the algorithm.
A property class for workspaces.
void exec() override
Execution code.
Parallel::ExecutionMode getParallelExecutionMode(const std::map< std::string, Parallel::StorageMode > &storageModes) const override
Get correct execution mode based on input storage modes for an MPI run.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
@ Output
An output workspace.