Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
ndcurves
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
loco-3d
ndcurves
Commits
292598e0
Commit
292598e0
authored
5 years ago
by
Pierre Fernbach
Browse files
Options
Downloads
Patches
Plain Diff
piecewise : use dim() instead of operator().size()
parent
2f39e787
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/curves/piecewise_curve.h
+6
-6
6 additions, 6 deletions
include/curves/piecewise_curve.h
with
6 additions
and
6 deletions
include/curves/piecewise_curve.h
+
6
−
6
View file @
292598e0
...
@@ -41,17 +41,17 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point> {
...
@@ -41,17 +41,17 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point> {
/// \brief Constructor.
/// \brief Constructor.
/// Initialize a piecewise curve by giving the first curve.
/// Initialize a piecewise curve by giving the first curve.
/// \param
pol
: a
polynomial
curve.
/// \param
cf
: a curve.
///
///
piecewise_curve
(
const
curve_t
&
cf
)
{
piecewise_curve
(
const
curve_t
&
cf
)
{
dim_
=
cf
(
cf
.
min
()).
size
();
dim_
=
cf
.
dim
();
size_
=
0
;
size_
=
0
;
add_curve
(
cf
);
add_curve
(
cf
);
}
}
piecewise_curve
(
const
t_curve_t
list_curves
)
{
piecewise_curve
(
const
t_curve_t
list_curves
)
{
if
(
list_curves
.
size
()
!=
0
)
{
if
(
list_curves
.
size
()
!=
0
)
{
dim_
=
list_curves
[
0
]
(
list_curves
[
0
].
min
()).
size
();
dim_
=
list_curves
[
0
]
.
dim
();
}
}
size_
=
0
;
size_
=
0
;
for
(
std
::
size_t
i
=
0
;
i
<
list_curves
.
size
();
i
++
)
{
for
(
std
::
size_t
i
=
0
;
i
<
list_curves
.
size
();
i
++
)
{
...
@@ -111,10 +111,10 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point> {
...
@@ -111,10 +111,10 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point> {
/// \param cf : curve to add.
/// \param cf : curve to add.
///
///
void
add_curve
(
const
curve_t
&
cf
)
{
void
add_curve
(
const
curve_t
&
cf
)
{
if
(
size_
==
0
&&
dim_
==
0
)
{
if
(
size_
==
0
&&
dim_
==
0
)
{
// first curve added
dim_
=
cf
(
cf
.
min
()).
size
();
dim_
=
cf
.
dim
();
}
}
// Check time continuity : Beginning time of
pol
must be equal to T_max_ of actual piecewise curve.
// Check time continuity : Beginning time of
cf
must be equal to T_max_ of actual piecewise curve.
if
(
size_
!=
0
&&
!
(
fabs
(
cf
.
min
()
-
T_max_
)
<
MARGIN
))
{
if
(
size_
!=
0
&&
!
(
fabs
(
cf
.
min
()
-
T_max_
)
<
MARGIN
))
{
throw
std
::
invalid_argument
(
throw
std
::
invalid_argument
(
"Can not add new Polynom to PiecewiseCurve : time discontinuity between T_max_ and pol.min()"
);
"Can not add new Polynom to PiecewiseCurve : time discontinuity between T_max_ and pol.min()"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment