Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
ndcurves
Commits
7f8ae09c
Commit
7f8ae09c
authored
Feb 06, 2020
by
Pierre Fernbach
Browse files
[Polynomial] from boundary condition: correctly check that t_min < t_max
parent
2ada9cb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/curves/polynomial.h
View file @
7f8ae09c
...
...
@@ -106,6 +106,7 @@ struct polynomial : public curve_abc<Time, Numeric, Safe, Point> {
///
polynomial
(
const
Point
&
init
,
const
Point
&
end
,
const
time_t
min
,
const
time_t
max
)
:
dim_
(
init
.
size
()),
degree_
(
1
),
T_min_
(
min
),
T_max_
(
max
)
{
if
(
T_min_
>=
T_max_
)
throw
std
::
invalid_argument
(
"T_min must be strictly lower than T_max"
);
if
(
init
.
size
()
!=
end
.
size
())
throw
std
::
invalid_argument
(
"init and end points must have the same dimensions."
);
t_point_t
coeffs
;
coeffs
.
push_back
(
init
);
...
...
@@ -127,6 +128,7 @@ struct polynomial : public curve_abc<Time, Numeric, Safe, Point> {
polynomial
(
const
Point
&
init
,
const
Point
&
d_init
,
const
Point
&
end
,
const
Point
&
d_end
,
const
time_t
min
,
const
time_t
max
)
:
dim_
(
init
.
size
()),
degree_
(
3
),
T_min_
(
min
),
T_max_
(
max
)
{
if
(
T_min_
>=
T_max_
)
throw
std
::
invalid_argument
(
"T_min must be strictly lower than T_max"
);
if
(
init
.
size
()
!=
end
.
size
())
throw
std
::
invalid_argument
(
"init and end points must have the same dimensions."
);
if
(
init
.
size
()
!=
d_init
.
size
())
throw
std
::
invalid_argument
(
"init and d_init points must have the same dimensions."
);
...
...
@@ -170,6 +172,7 @@ struct polynomial : public curve_abc<Time, Numeric, Safe, Point> {
polynomial
(
const
Point
&
init
,
const
Point
&
d_init
,
const
Point
&
dd_init
,
const
Point
&
end
,
const
Point
&
d_end
,
const
Point
&
dd_end
,
const
time_t
min
,
const
time_t
max
)
:
dim_
(
init
.
size
()),
degree_
(
5
),
T_min_
(
min
),
T_max_
(
max
)
{
if
(
T_min_
>=
T_max_
)
throw
std
::
invalid_argument
(
"T_min must be strictly lower than T_max"
);
if
(
init
.
size
()
!=
end
.
size
())
throw
std
::
invalid_argument
(
"init and end points must have the same dimensions."
);
if
(
init
.
size
()
!=
d_init
.
size
())
throw
std
::
invalid_argument
(
"init and d_init points must have the same dimensions."
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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