Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LEFEBVREJP email
radix
Commits
641823c8
Commit
641823c8
authored
Jan 09, 2019
by
Purves, Murray
Browse files
WIP New base values interpolation
parent
ff4b78bf
Pipeline
#27282
failed with stages
in 6 minutes and 22 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
radixmath/interpolate.cc
View file @
641823c8
...
...
@@ -162,6 +162,12 @@ std::vector<float> interpolateToOtherBaseValues(
const
std
::
vector
<
float
>
&
valuesToInterpolate
,
const
bool
circular
,
const
float
missingValues
)
{
// First interpolate across the existing data to ensure there are no missing
std
::
vector
<
float
>
initialInterpolatedValues
=
interpolateValues
(
baseValues
,
valuesToInterpolate
,
circular
,
missingValues
);
// TODO the rest
return
std
::
vector
<
float
>
();
}
...
...
radixmath/tests/tstInterpolate.cc
View file @
641823c8
...
...
@@ -101,3 +101,21 @@ TEST(Interpolate, FillInEnd)
EXPECT_NEAR
(
expectValues1
[
i
],
testValues1
[
i
],
expectValues1
[
i
]
*
tolerance
);
}
}
TEST
(
Interpolate
,
NewBaseValues
)
{
float
missingValue
=
-
9999.
f
;
float
tolerance
=
0.0001
;
std
::
vector
<
float
>
baseValues1
{
12.
f
,
23.
f
,
100.
f
,
100.
f
};
std
::
vector
<
float
>
newBaseValues1
{
10.
f
,
20.
f
,
30.
f
,
40.
f
,
50.
f
,
60.
f
};
std
::
vector
<
float
>
interpValues1
{
103.23
,
200.2
,
missingValue
,
missingValue
};
std
::
vector
<
float
>
expectValues1
{
103.23
,
200.2
,
200.2
,
200.2
};
std
::
vector
<
float
>
testValues1
=
interpolateToOtherBaseValues
(
baseValues1
,
newBaseValues1
,
interpValues1
);
ASSERT_EQ
(
expectValues1
.
size
(),
testValues1
.
size
());
for
(
int
i
=
0
;
i
<
testValues1
.
size
();
++
i
)
{
EXPECT_NEAR
(
expectValues1
[
i
],
testValues1
[
i
],
expectValues1
[
i
]
*
tolerance
);
}
}
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