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
1a4440ce
Commit
1a4440ce
authored
5 years ago
by
JasonChmn
Browse files
Options
Downloads
Patches
Plain Diff
[piecewise_curve] remove comparison using epsilon / merge if conditions
parent
395f9991
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/curves/piecewise_curve.h
+4
-6
4 additions, 6 deletions
include/curves/piecewise_curve.h
with
4 additions
and
6 deletions
include/curves/piecewise_curve.h
+
4
−
6
View file @
1a4440ce
...
...
@@ -85,13 +85,11 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Dim, Safe, Point>
///
void
add_curve
(
const
curve_t
&
cf
)
{
const
double
margin
=
1e-9
;
// Check time continuity : Beginning time of pol must be equal to T_max_ of actual piecewise curve.
if
(
size_
!=
0
)
if
(
size_
!=
0
&&
!
(
fabs
(
cf
.
min
()
-
T_max_
)
<
margin
)
)
{
if
(
!
(
fabs
(
cf
.
min
()
-
T_max_
)
<
std
::
numeric_limits
<
Time
>::
epsilon
()))
{
throw
std
::
invalid_argument
(
"Can not add new Polynom to PiecewiseCurve : time discontinuity between T_max_ and pol.min()"
);
}
throw
std
::
invalid_argument
(
"Can not add new Polynom to PiecewiseCurve : time discontinuity between T_max_ and pol.min()"
);
}
curves_
.
push_back
(
cf
);
size_
=
curves_
.
size
();
...
...
@@ -105,7 +103,7 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Dim, Safe, Point>
///
bool
is_continuous
(
const
std
::
size_t
order
)
{
double
margin
=
0.001
;
const
double
margin
=
1e-9
;
bool
isContinuous
=
true
;
std
::
size_t
i
=
0
;
point_t
value_end
,
value_start
;
...
...
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