Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eigenpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
Stack Of Tasks
eigenpy
Commits
a29f6f85
Verified
Commit
a29f6f85
authored
5 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
python: use original signature of is_approx
parent
b620c5b3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/eigenpy/utils/is-approx.hpp
+7
-6
7 additions, 6 deletions
include/eigenpy/utils/is-approx.hpp
python/main.cpp
+4
-2
4 additions, 2 deletions
python/main.cpp
with
11 additions
and
8 deletions
include/eigenpy/utils/is-approx.hpp
+
7
−
6
View file @
a29f6f85
/*
/*
* Copyright 2020 INRIA
* Copyright 2020 INRIA
*/
*/
#ifndef __eigenpy_utils_scalar_is_approx_hpp__
#ifndef __eigenpy_utils_scalar_is_approx_hpp__
#define __eigenpy_utils_scalar_is_approx_hpp__
#define __eigenpy_utils_scalar_is_approx_hpp__
...
@@ -10,15 +10,16 @@
...
@@ -10,15 +10,16 @@
namespace
eigenpy
namespace
eigenpy
{
{
template
<
typename
MatrixType1
,
typename
MatrixType2
>
template
<
typename
MatrixType1
,
typename
MatrixType2
>
inline
EIGEN_DONT_INLINE
bool
is_approx
(
const
MatrixType1
&
mat1
,
inline
EIGEN_DONT_INLINE
bool
is_approx
(
const
Eigen
::
MatrixBase
<
MatrixType1
>
&
mat1
,
const
MatrixType2
&
mat2
,
const
Eigen
::
MatrixBase
<
MatrixType2
>
&
mat2
,
const
typename
MatrixType1
::
Scalar
&
prec
)
const
typename
MatrixType1
::
Scalar
&
prec
)
{
{
return
mat1
.
derived
().
isApprox
(
mat2
.
derived
()
,
prec
);
return
mat1
.
isApprox
(
mat2
,
prec
);
}
}
template
<
typename
MatrixType1
,
typename
MatrixType2
>
template
<
typename
MatrixType1
,
typename
MatrixType2
>
inline
bool
is_approx
(
const
MatrixType1
&
mat1
,
const
MatrixType2
&
mat2
)
inline
EIGEN_DONT_INLINE
bool
is_approx
(
const
Eigen
::
MatrixBase
<
MatrixType1
>
&
mat1
,
const
Eigen
::
MatrixBase
<
MatrixType2
>
&
mat2
)
{
{
return
is_approx
(
mat1
,
mat2
,
Eigen
::
NumTraits
<
typename
MatrixType1
::
Scalar
>::
dummy_precision
());
return
is_approx
(
mat1
,
mat2
,
Eigen
::
NumTraits
<
typename
MatrixType1
::
Scalar
>::
dummy_precision
());
}
}
...
...
This diff is collapsed.
Click to expand it.
python/main.cpp
+
4
−
2
View file @
a29f6f85
...
@@ -46,10 +46,12 @@ BOOST_PYTHON_MODULE(eigenpy)
...
@@ -46,10 +46,12 @@ BOOST_PYTHON_MODULE(eigenpy)
{
{
using
namespace
Eigen
;
using
namespace
Eigen
;
bp
::
def
(
"is_approx"
,(
bool
(
*
)(
const
MatrixXd
&
,
const
MatrixXd
&
,
const
double
&
))
&
is_approx
<
MatrixXd
,
MatrixXd
>
,
bp
::
def
(
"is_approx"
,(
bool
(
*
)(
const
Eigen
::
MatrixBase
<
MatrixXd
>
&
,
const
Eigen
::
MatrixBase
<
MatrixXd
>
&
,
const
double
&
))
&
is_approx
<
MatrixXd
,
MatrixXd
>
,
bp
::
args
(
"A"
,
"B"
,
"prec"
),
bp
::
args
(
"A"
,
"B"
,
"prec"
),
"Returns True if A is approximately equal to B, within the precision determined by prec."
);
"Returns True if A is approximately equal to B, within the precision determined by prec."
);
bp
::
def
(
"is_approx"
,(
bool
(
*
)(
const
MatrixXd
&
,
const
MatrixXd
&
))
&
is_approx
<
MatrixXd
,
MatrixXd
>
,
bp
::
def
(
"is_approx"
,(
bool
(
*
)(
const
Eigen
::
MatrixBase
<
MatrixXd
>
&
,
const
Eigen
::
MatrixBase
<
MatrixXd
>
&
))
&
is_approx
<
MatrixXd
,
MatrixXd
>
,
bp
::
args
(
"A"
,
"B"
),
bp
::
args
(
"A"
,
"B"
),
"Returns True if A is approximately equal to B."
);
"Returns True if A is approximately equal to B."
);
}
}
...
...
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