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
407861cd
Verified
Commit
407861cd
authored
1 year ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
core: add has_operator_equal helper
parent
703a6fb7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#35415
passed with warnings
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/eigenpy/fwd.hpp
+20
-1
20 additions, 1 deletion
include/eigenpy/fwd.hpp
include/eigenpy/std-vector.hpp
+3
-18
3 additions, 18 deletions
include/eigenpy/std-vector.hpp
with
23 additions
and
19 deletions
include/eigenpy/fwd.hpp
+
20
−
1
View file @
407861cd
/*
* Copyright 2014-202
3
CNRS INRIA
* Copyright 2014-202
4
CNRS INRIA
*/
#ifndef __eigenpy_fwd_hpp__
...
...
@@ -73,6 +73,9 @@
#include
<boost/python.hpp>
#include
<boost/python/scope.hpp>
#include
<type_traits>
#include
<utility>
namespace
eigenpy
{
namespace
bp
=
boost
::
python
;
...
...
@@ -167,6 +170,22 @@ struct get_eigen_ref_plain_type<Eigen::TensorRef<TensorType> > {
typedef
TensorType
type
;
};
#endif
namespace
internal
{
template
<
class
T1
,
class
T2
>
struct
has_operator_equal_impl
{
template
<
class
U
,
class
V
>
static
auto
check
(
U
*
)
->
decltype
(
std
::
declval
<
U
>
()
==
std
::
declval
<
V
>
());
template
<
typename
,
typename
>
static
auto
check
(...)
->
std
::
false_type
;
using
type
=
typename
std
::
is_same
<
bool
,
decltype
(
check
<
T1
,
T2
>
(
0
))
>::
type
;
};
}
// namespace internal
template
<
class
T1
,
class
T2
=
T1
>
struct
has_operator_equal
:
internal
::
has_operator_equal_impl
<
T1
,
T2
>::
type
{};
}
// namespace eigenpy
#include
"eigenpy/alignment.hpp"
...
...
This diff is collapsed.
Click to expand it.
include/eigenpy/std-vector.hpp
+
3
−
18
View file @
407861cd
...
...
@@ -319,24 +319,9 @@ struct StdContainerFromPythonList {
namespace
internal
{
template
<
typename
T
>
struct
has_operator_equal
:
boost
::
mpl
::
if_
<
typename
boost
::
is_base_of
<
Eigen
::
EigenBase
<
T
>
,
T
>::
type
,
has_operator_equal
<
Eigen
::
EigenBase
<
T
>
>
,
boost
::
true_type
>::
type
{};
template
<
typename
T
,
class
A
>
struct
has_operator_equal
<
std
::
vector
<
T
,
A
>
>
:
has_operator_equal
<
T
>
{};
template
<
>
struct
has_operator_equal
<
bool
>
:
boost
::
true_type
{};
template
<
typename
EigenObject
>
struct
has_operator_equal
<
Eigen
::
EigenBase
<
EigenObject
>
>
:
has_operator_equal
<
typename
EigenObject
::
Scalar
>
{};
template
<
typename
T
,
bool
has_operator_equal_value
=
boost
::
is_base_of
<
boost
::
true_type
,
has_operator_equal
<
T
>
>::
value
>
template
<
typename
T
,
bool
has_operator_equal_value
=
std
::
is_base_of
<
std
::
true_type
,
has_operator_equal
<
T
>
>::
value
>
struct
contains_algo
;
template
<
typename
T
>
...
...
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