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
83140967
Commit
83140967
authored
5 years ago
by
Pierre Fernbach
Browse files
Options
Downloads
Patches
Plain Diff
fix piecewise::is_continuous when point_t != point_derivate_t
parent
30b6cc6c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/curves/linear_variable.h
+4
-0
4 additions, 0 deletions
include/curves/linear_variable.h
include/curves/piecewise_curve.h
+19
-10
19 additions, 10 deletions
include/curves/piecewise_curve.h
with
23 additions
and
10 deletions
include/curves/linear_variable.h
+
4
−
0
View file @
83140967
...
...
@@ -81,6 +81,10 @@ struct linear_variable : public serialization::Serializable {
Numeric
norm
()
const
{
return
isZero
()
?
0
:
(
B_
.
norm
()
+
c_
.
norm
());
}
bool
isApprox
(
const
linear_variable_t
&
other
,
const
double
prec
=
Eigen
::
NumTraits
<
Numeric
>::
dummy_precision
()){
return
(
*
this
-
other
).
norm
()
<
prec
;
}
const
matrix_x_t
&
B
()
const
{
return
B_
;
}
const
vector_x_t
&
c
()
const
{
return
c_
;
}
bool
isZero
()
const
{
return
zero
;
}
...
...
This diff is collapsed.
Click to expand it.
include/curves/piecewise_curve.h
+
19
−
10
View file @
83140967
...
...
@@ -144,21 +144,30 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point,Point_deriv
check_if_not_empty
();
bool
isContinuous
=
true
;
std
::
size_t
i
=
0
;
point_t
value_end
,
value_start
;
while
(
isContinuous
&&
i
<
(
size_
-
1
))
{
curve_t
current
=
curves_
.
at
(
i
);
curve_t
nex
t
=
curves_
.
at
(
i
+
1
);
if
(
order
==
0
)
{
if
(
order
==
0
){
point_t
value_end
,
value_start
;
while
(
isContinuous
&&
i
<
(
size_
-
1
))
{
curve_t
curren
t
=
curves_
.
at
(
i
);
curve_t
next
=
curves_
.
at
(
i
+
1
);
value_end
=
current
(
current
.
max
());
value_start
=
next
(
next
.
min
());
}
else
{
if
(
!
value_end
.
isApprox
(
value_start
,
MARGIN
))
{
isContinuous
=
false
;
}
i
++
;
}
}
else
{
point_derivate_t
value_end
,
value_start
;
while
(
isContinuous
&&
i
<
(
size_
-
1
))
{
curve_t
current
=
curves_
.
at
(
i
);
curve_t
next
=
curves_
.
at
(
i
+
1
);
value_end
=
current
.
derivate
(
current
.
max
(),
order
);
value_start
=
next
.
derivate
(
next
.
min
(),
order
);
if
(
!
value_end
.
isApprox
(
value_start
,
MARGIN
))
{
isContinuous
=
false
;
}
i
++
;
}
if
((
value_end
-
value_start
).
norm
()
>
MARGIN
)
{
isContinuous
=
false
;
}
i
++
;
}
return
isContinuous
;
}
...
...
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