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
Jason Chemin
curves
Commits
68e68954
Commit
68e68954
authored
Aug 01, 2019
by
JasonChmn
Committed by
Pierre Fernbach
Sep 03, 2019
Browse files
[all] Fix warnings
parent
19da603c
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/curves/cubic_hermite_spline.h
View file @
68e68954
...
...
@@ -47,12 +47,10 @@ struct cubic_hermite_spline : public curve_abc<Time, Numeric, Safe, Point>
///
template
<
typename
In
>
cubic_hermite_spline
(
In
PairsBegin
,
In
PairsEnd
,
const
vector_time_t
&
time_control_points
)
:
degree_
(
3
)
:
size_
(
std
::
distance
(
PairsBegin
,
PairsEnd
)),
degree_
(
3
)
{
// Check size of pairs container.
std
::
size_t
const
size
(
std
::
distance
(
PairsBegin
,
PairsEnd
));
size_
=
size
;
if
(
Safe
&&
size
<
1
)
if
(
Safe
&&
size_
<
1
)
{
throw
std
::
length_error
(
"can not create cubic_hermite_spline, number of pairs is inferior to 2."
);
}
...
...
@@ -65,11 +63,13 @@ struct cubic_hermite_spline : public curve_abc<Time, Numeric, Safe, Point>
setTime
(
time_control_points
);
}
cubic_hermite_spline
(
const
cubic_hermite_spline
&
other
)
:
t_min_
(
other
.
t_min_
),
t_max_
(
other
.
t_max_
),
size_
(
other
.
size_
),
degree_
(
other
.
degree
_
),
control_po
in
t
s_
(
other
.
control_po
in
t
s_
),
t
ime_control_points_
(
other
.
time_control_points
_
),
duration_splines_
(
other
.
duration_splines
_
)
:
control_points_
(
other
.
control_points_
),
time_control_points_
(
other
.
time_control_points
_
),
duration_spl
in
e
s_
(
other
.
duration_spl
in
e
s_
),
t
_min_
(
other
.
t_min_
),
t_max_
(
other
.
t_max
_
),
size_
(
other
.
size_
),
degree_
(
other
.
degree
_
)
{}
/// \brief Destructor.
virtual
~
cubic_hermite_spline
(){}
...
...
include/curves/piecewise_curve.h
View file @
68e68954
...
...
@@ -190,7 +190,7 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point>
throw
std
::
invalid_argument
(
"piecewise_curve -> convert_discrete_points_to_polynomial, Error, less than 2 discrete points"
);
}
typedef
piecewise_curve
<
Time
,
Numeric
,
Dim
,
Safe
,
Point
,
T_Point
,
Polynomial
>
piecewise_curve_out_t
;
Time
discretization_step
=
(
T_max
-
T_min
)
/
(
points
.
size
()
-
1
);
Time
discretization_step
=
(
T_max
-
T_min
)
/
Time
(
points
.
size
()
-
1
);
Time
time_actual
=
T_min
;
// Initialization at first points
point_t
actual_point
=
points
[
0
];
...
...
@@ -204,7 +204,7 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point>
piecewise_curve_out_t
ppc
(
pol
);
time_actual
+=
discretization_step
;
// Other points
for
(
in
t
i
=
1
;
i
<
points
.
size
()
-
2
;
i
++
)
for
(
std
::
size_
t
i
=
1
;
i
<
points
.
size
()
-
2
;
i
++
)
{
coeffs
.
clear
();
actual_point
=
points
[
i
];
...
...
tests/Main.cpp
View file @
68e68954
...
...
@@ -1407,7 +1407,7 @@ void piecewiseCurveConversionFromDiscretePointsTest(bool& error)
points
.
push_back
(
p3
);
double
T_min
=
1.0
;
double
T_max
=
3.0
;
double
timestep
=
(
T_max
-
T_min
)
/
(
points
.
size
()
-
1
);
double
timestep
=
(
T_max
-
T_min
)
/
double
(
points
.
size
()
-
1
);
piecewise_polynomial_curve_t
ppc
=
piecewise_polynomial_curve_t
::
convert_discrete_points_to_polynomial
<
polynomial_t
>
(
points
,
T_min
,
T_max
);
if
(
!
ppc
.
is_continuous
(
0
))
...
...
Write
Preview
Supports
Markdown
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