-
Notifications
You must be signed in to change notification settings - Fork 122
/
ExponentialMD.cpp
44 lines (34 loc) · 1.66 KB
/
ExponentialMD.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "MantidMDAlgorithms/ExponentialMD.h"
#include "MantidKernel/System.h"
using namespace Mantid::Kernel;
using namespace Mantid::API;
namespace Mantid {
namespace MDAlgorithms {
// Register the algorithm into the AlgorithmFactory
DECLARE_ALGORITHM(ExponentialMD)
//----------------------------------------------------------------------------------------------
/// Algorithm's name for identification. @see Algorithm::name
const std::string ExponentialMD::name() const { return "ExponentialMD"; }
/// Algorithm's version for identification. @see Algorithm::version
int ExponentialMD::version() const { return 1; }
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
/// Check the inputs and throw if the algorithm cannot be run
void ExponentialMD::checkInputs() {
if (!m_in_histo)
throw std::runtime_error(this->name() +
" can only be run on a MDHistoWorkspace.");
}
//----------------------------------------------------------------------------------------------
/// Run the algorithm on a MDEventWorkspace
void ExponentialMD::execEvent(Mantid::API::IMDEventWorkspace_sptr /*out*/) {
throw std::runtime_error(this->name() +
" can only be run on a MDHistoWorkspace.");
}
//----------------------------------------------------------------------------------------------
/// ExponentialMD::Run the algorithm with a MDHistoWorkspace
void ExponentialMD::execHisto(Mantid::DataObjects::MDHistoWorkspace_sptr out) {
out->exp();
}
} // namespace Mantid
} // namespace MDAlgorithms