Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-feliks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Feliks Kiszkurno
ogs-feliks
Commits
6da2532a
Commit
6da2532a
authored
11 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[MathLib/GeoLib] Made operator== a template function.
parent
3bebd712
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
GeoLib/Point.cpp
+0
-9
0 additions, 9 deletions
GeoLib/Point.cpp
GeoLib/Point.h
+0
-3
0 additions, 3 deletions
GeoLib/Point.h
MathLib/MathTools.h
+7
-0
7 additions, 0 deletions
MathLib/MathTools.h
with
7 additions
and
12 deletions
GeoLib/Point.cpp
+
0
−
9
View file @
6da2532a
...
@@ -17,8 +17,6 @@
...
@@ -17,8 +17,6 @@
#include
"Point.h"
#include
"Point.h"
#include
"MathTools.h"
namespace
GeoLib
{
namespace
GeoLib
{
bool
operator
<=
(
const
GeoLib
::
Point
&
p0
,
const
GeoLib
::
Point
&
p1
)
bool
operator
<=
(
const
GeoLib
::
Point
&
p0
,
const
GeoLib
::
Point
&
p1
)
...
@@ -77,11 +75,4 @@ bool lessEq(const GeoLib::Point& p0, const GeoLib::Point& p1, double tol)
...
@@ -77,11 +75,4 @@ bool lessEq(const GeoLib::Point& p0, const GeoLib::Point& p1, double tol)
}
}
}
}
bool
operator
==
(
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
b
)
{
double
sqr_dist
(
MathLib
::
sqrDist
(
a
,
b
));
return
(
sqr_dist
<
sqrt
(
std
::
numeric_limits
<
double
>::
min
()));
}
}
// end namespace GeoLib
}
// end namespace GeoLib
This diff is collapsed.
Click to expand it.
GeoLib/Point.h
+
0
−
3
View file @
6da2532a
...
@@ -70,9 +70,6 @@ bool operator<= (GeoLib::Point const & p0, GeoLib::Point const & p1);
...
@@ -70,9 +70,6 @@ bool operator<= (GeoLib::Point const & p0, GeoLib::Point const & p1);
bool
lessEq
(
const
GeoLib
::
Point
&
p0
,
bool
lessEq
(
const
GeoLib
::
Point
&
p0
,
const
GeoLib
::
Point
&
p1
,
const
GeoLib
::
Point
&
p1
,
double
tol
=
std
::
numeric_limits
<
double
>::
epsilon
());
double
tol
=
std
::
numeric_limits
<
double
>::
epsilon
());
bool
operator
==
(
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
b
);
}
}
#endif
/* POINT_H_ */
#endif
/* POINT_H_ */
This diff is collapsed.
Click to expand it.
MathLib/MathTools.h
+
7
−
0
View file @
6da2532a
...
@@ -121,6 +121,13 @@ typename POINT_T::FP_T sqrDist(POINT_T const& p0, POINT_T const& p1)
...
@@ -121,6 +121,13 @@ typename POINT_T::FP_T sqrDist(POINT_T const& p0, POINT_T const& p1)
return
MathLib
::
scalarProduct
<
typename
POINT_T
::
FP_T
,
3
>
(
v
,
v
);
return
MathLib
::
scalarProduct
<
typename
POINT_T
::
FP_T
,
3
>
(
v
,
v
);
}
}
template
<
typename
POINT_T
>
bool
operator
==
(
POINT_T
const
&
a
,
POINT_T
const
&
b
)
{
typename
POINT_T
::
FP_T
const
sqr_dist
(
sqrDist
(
a
,
b
));
return
(
sqr_dist
<
pow
(
std
::
numeric_limits
<
typename
POINT_T
::
FP_T
>::
epsilon
(),
2
));
}
/** squared dist between double arrays p0 and p1 (size of arrays is 3) */
/** squared dist between double arrays p0 and p1 (size of arrays is 3) */
double
sqrDist
(
const
double
*
p0
,
const
double
*
p1
);
double
sqrDist
(
const
double
*
p0
,
const
double
*
p1
);
...
...
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