imate
C++/CUDA Reference
indicator.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 "
./indicator.h
"
17
18
19
// =========
20
// Indicator
21
// =========
22
25
26
Indicator::Indicator
(
double
a_,
double
b_)
27
{
28
this->
a
= a_;
29
this->
b
= b_;
30
}
31
32
33
// ==================
34
// Indicator function (float)
35
// ==================
36
40
41
float
Indicator::function
(
const
float
lambda_)
const
42
{
43
if
((lambda_ < this->
a
) || (lambda_ > this->
b
))
44
{
45
return
0.0;
46
}
47
else
48
{
49
return
1.0;
50
}
51
}
52
53
54
// ==================
55
// Indicator function (double)
56
// ==================
57
61
62
double
Indicator::function
(
const
double
lambda_)
const
63
{
64
if
((lambda_ < this->
a
) || (lambda_ > this->
b
))
65
{
66
return
0.0;
67
}
68
else
69
{
70
return
1.0;
71
}
72
}
73
74
75
// ==================
76
// Indicator function (long double)
77
// ==================
78
82
83
long
double
Indicator::function
(
const
long
double
lambda_)
const
84
{
85
if
((lambda_ < this->
a
) || (lambda_ > this->
b
))
86
{
87
return
0.0;
88
}
89
else
90
{
91
return
1.0;
92
}
93
}
Indicator::Indicator
Indicator(double a_, double b_)
Sets the default parameters a and c.
Definition:
indicator.cpp:26
Indicator::function
virtual float function(const float lambda_) const
Definition:
indicator.cpp:41
Indicator::a
double a
Definition:
indicator.h:48
Indicator::b
double b
Definition:
indicator.h:49
indicator.h
imate
functions
indicator.cpp
Generated on Mon Jan 22 2024 00:04:58 for imate by
1.9.1