Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KiT-RT
KiT-RT
Commits
9bc446d3
Commit
9bc446d3
authored
Mar 22, 2021
by
jannick.wolters
Browse files
added linear extrapolation
parent
4415d734
Pipeline
#142909
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
code/src/toolboxes/interpolation.cpp
View file @
9bc446d3
...
...
@@ -63,7 +63,16 @@ double Interpolation::operator()( double x ) const {
Vector
::
ConstIterator
it
=
std
::
lower_bound
(
_x
.
begin
(),
_x
.
end
(),
x
);
// index of the lower bound to x in _x
unsigned
idx
=
static_cast
<
unsigned
>
(
std
::
max
(
int
(
it
-
_x
.
begin
()
)
-
1
,
0
)
);
unsigned
idx
=
0
;
if
(
x
>=
_x
[
0
]
&&
x
<=
_x
[
_x
.
size
()
-
1u
]
)
{
idx
=
static_cast
<
unsigned
>
(
std
::
max
(
int
(
it
-
_x
.
begin
()
)
-
1
,
0
)
);
}
else
if
(
x
<
_x
[
0
]
)
{
idx
=
0
;
}
else
if
(
x
>
_x
[
_x
.
size
()
-
1u
]
)
{
idx
=
_x
.
size
()
-
1u
;
}
// linear interpolation
if
(
_type
==
linear
||
_type
==
loglinear
)
{
...
...
jannick.wolters
@jm2154
mentioned in commit
5ad82063
·
Apr 30, 2021
mentioned in commit
5ad82063
mentioned in commit 5ad82063e343695a828fe893d5b8004ca1e19dd9
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment