imate
C++/CUDA Reference
exponential.cpp
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu>
3
* SPDX-License-Identifier: BSD-3-Clause
4
* SPDX-FileType: SOURCE
5
*
6
* This program is free software: you can redistribute it and/or modify it
7
* under the terms of the license found in the LICENSE.txt file in the root
8
* directory of this source tree.
9
*/
10
11
12
// =======
13
// Headers
14
// =======
15
16
#include <cmath>
// exp
17
#include "
./exponential.h
"
18
19
20
// ===========
21
// Exponential
22
// ===========
23
26
27
Exponential::Exponential
(
double
coeff_)
28
{
29
this->
coeff
= coeff_;
30
}
31
32
33
// ====================
34
// Exponential function (float)
35
// ====================
36
40
41
float
Exponential::function
(
const
float
lambda_)
const
42
{
43
return
exp(lambda_ *
static_cast<
float
>
(this->
coeff
));
44
}
45
46
47
// ====================
48
// Exponential function (double)
49
// ====================
50
54
55
double
Exponential::function
(
const
double
lambda_)
const
56
{
57
return
exp(lambda_ *
static_cast<
double
>
(this->
coeff
));
58
}
59
60
61
// ====================
62
// Exponential function (long double)
63
// ====================
64
68
69
long
double
Exponential::function
(
const
long
double
lambda_)
const
70
{
71
return
exp(lambda_ *
static_cast<
long
double
>
(this->
coeff
));
72
}
Exponential::Exponential
Exponential(double coeff_)
Sets the default for the parameter coeff to 1.0.
Definition:
exponential.cpp:27
Exponential::function
virtual float function(const float lambda_) const
Definition:
exponential.cpp:41
Exponential::coeff
double coeff
Definition:
exponential.h:47
exponential.h
imate
functions
exponential.cpp
Generated on Mon Jan 22 2024 00:04:57 for imate by
1.9.1