Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pierre Fernbach
curves
Commits
4c833c98
Commit
4c833c98
authored
May 05, 2020
by
Pierre Fernbach
Browse files
cubic_hermite_spline: correctly check the dimension of each control points
parent
c7a9b3db
Pipeline
#9451
passed with stage
in 5 minutes and 4 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/curves/cubic_hermite_spline.h
View file @
4c833c98
...
...
@@ -58,15 +58,15 @@ struct cubic_hermite_spline : public curve_abc<Time, Numeric, Safe, Point> {
if
(
Safe
&&
size_
<
1
)
{
throw
std
::
length_error
(
"can not create cubic_hermite_spline, number of pairs is inferior to 2."
);
}
// Set dimension according to size of points
dim_
=
PairsBegin
->
first
.
size
();
// Push all pairs in controlPoints
In
it
(
PairsBegin
);
for
(;
it
!=
PairsEnd
;
++
it
)
{
if
(
Safe
&&
(
static_cast
<
size_t
>
(
it
->
first
.
size
())
!=
dim_
||
static_cast
<
size_t
>
(
it
->
second
.
size
())
!=
dim_
))
throw
std
::
invalid_argument
(
"All the control points and their derivatives must have the same dimension."
);
control_points_
.
push_back
(
*
it
);
}
// Set dimension according to size of points
if
(
control_points_
.
size
()
!=
0
)
{
dim_
=
control_points_
[
0
].
first
.
size
();
}
// Set time
setTime
(
time_control_points
);
}
...
...
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