Loading [MathJax]/extensions/tex2jax.js
OGS
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
v
w
Typedefs
b
c
e
f
h
j
k
l
m
n
p
q
r
s
t
v
w
x
Enumerations
b
c
d
e
f
g
i
l
m
n
o
p
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
l
m
n
p
r
s
t
v
y
Classes
Class List
Class Index
Class Hierarchy
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
x
Functions
a
c
d
e
f
g
i
m
o
p
r
s
t
v
w
x
Variables
Typedefs
Enumerations
Macros
a
b
c
e
g
h
i
l
m
n
o
p
r
s
t
v
w
x
LinearIntervalInterpolation.h
Go to the documentation of this file.
1
15
#pragma once
16
17
#include "
BaseLib/Error.h
"
18
19
namespace
MathLib
{
20
31
template
<
typename
NUMERIC_TYPE>
32
class
LinearIntervalInterpolation
{
33
public
:
43
LinearIntervalInterpolation
(NUMERIC_TYPE a, NUMERIC_TYPE b, NUMERIC_TYPE
c
, NUMERIC_TYPE d);
49
inline
NUMERIC_TYPE
operator()
(NUMERIC_TYPE x)
const
;
50
51
private
:
55
NUMERIC_TYPE
m_
;
59
NUMERIC_TYPE
n_
;
60
};
61
62
template
<
typename
NUMERIC_TYPE>
63
LinearIntervalInterpolation<NUMERIC_TYPE>::LinearIntervalInterpolation
(
64
NUMERIC_TYPE a, NUMERIC_TYPE b, NUMERIC_TYPE
c
, NUMERIC_TYPE d)
65
: m_(d -
c
), n_(0.0)
66
{
67
if
(b == a) {
68
OGS_FATAL
(
"LinearIntervalInterpolation::LinearIntervalInterpolation: a == b, empty interval"
);
69
}
70
m_
/= (b - a);
71
n_
=
c
-
m_
* a;
72
}
73
74
template
<
typename
NUMERIC_TYPE>
75
inline
NUMERIC_TYPE
LinearIntervalInterpolation<NUMERIC_TYPE>::operator()
(NUMERIC_TYPE x)
const
76
{
77
return
m_ * x + n_;
78
}
79
80
}
// end namespace MathLib
Error.h
OGS_FATAL
#define OGS_FATAL(...)
Definition:
Error.h:26
MathLib::LinearIntervalInterpolation
Class (template) LinearIntervalInterpolation is a functional object performing an interval mapping .
Definition:
LinearIntervalInterpolation.h:32
MathLib::LinearIntervalInterpolation::m_
NUMERIC_TYPE m_
Definition:
LinearIntervalInterpolation.h:55
MathLib::LinearIntervalInterpolation::LinearIntervalInterpolation
LinearIntervalInterpolation(NUMERIC_TYPE a, NUMERIC_TYPE b, NUMERIC_TYPE c, NUMERIC_TYPE d)
Definition:
LinearIntervalInterpolation.h:63
MathLib::LinearIntervalInterpolation::operator()
NUMERIC_TYPE operator()(NUMERIC_TYPE x) const
Definition:
LinearIntervalInterpolation.h:75
MathLib::LinearIntervalInterpolation::n_
NUMERIC_TYPE n_
Definition:
LinearIntervalInterpolation.h:59
MaterialPropertyLib::c
constexpr std::array c
Definition:
WaterVapourLatentHeatWithCriticalTemperature.cpp:30
MathLib
MathLib
InterpolationAlgorithms
LinearIntervalInterpolation.h
Generated by
1.9.1