-
Notifications
You must be signed in to change notification settings - Fork 122
/
Exponential.cpp
49 lines (43 loc) · 1.51 KB
/
Exponential.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
45
46
47
48
49
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAlgorithms/Exponential.h"
#include <cmath>
using namespace Mantid::API;
using namespace Mantid::Kernel;
namespace Mantid::Algorithms {
// Register the class into the algorithm factory
DECLARE_ALGORITHM(Exponential)
Exponential::Exponential() : UnaryOperation() { this->useHistogram = true; }
void Exponential::performUnaryOperation(const double XIn, const double YIn, const double EIn, double &YOut,
double &EOut) {
(void)XIn; // Avoid compiler warning
// Multiply the data and error by the correction factor
YOut = exp(YIn);
EOut = EIn * YOut;
}
/*
void Exponential::setOutputUnits(const API::MatrixWorkspace_const_sptr
lhs,API::MatrixWorkspace_sptr out)
{
// If Y has not units, then the output will be dimensionless, but not a
distribution
if ( lhs->YUnit().empty() )
{
out->setYUnit("");
out->setDistribution(false); // might be, maybe not?
}
// Else units are questionable...
else
{
out->setYUnit("exp(" + lhs->YUnit()+ ")");
}
}
*/
} // namespace Mantid::Algorithms