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
Guilhem Saurel
eigenpy
Commits
cdcfab5d
Verified
Commit
cdcfab5d
authored
3 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
core: fix definition order
parent
e402f5d1
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
include/eigenpy/numpy-type.hpp
+1
-21
1 addition, 21 deletions
include/eigenpy/numpy-type.hpp
include/eigenpy/numpy.hpp
+22
-0
22 additions, 0 deletions
include/eigenpy/numpy.hpp
include/eigenpy/register.hpp
+2
-1
2 additions, 1 deletion
include/eigenpy/register.hpp
with
25 additions
and
22 deletions
include/eigenpy/numpy-type.hpp
+
1
−
21
View file @
cdcfab5d
...
...
@@ -7,6 +7,7 @@
#include
"eigenpy/fwd.hpp"
#include
"eigenpy/scalar-conversion.hpp"
#include
"eigenpy/register.hpp"
#include
<stdexcept>
#include
<typeinfo>
...
...
@@ -16,27 +17,6 @@ namespace eigenpy
{
namespace
bp
=
boost
::
python
;
// By default, the Scalar is considered as a Python object
template
<
typename
Scalar
>
struct
NumpyEquivalentType
{
enum
{
type_code
=
NPY_USERDEF
};};
template
<
>
struct
NumpyEquivalentType
<
float
>
{
enum
{
type_code
=
NPY_FLOAT
};};
template
<
>
struct
NumpyEquivalentType
<
std
::
complex
<
float
>
>
{
enum
{
type_code
=
NPY_CFLOAT
};};
template
<
>
struct
NumpyEquivalentType
<
double
>
{
enum
{
type_code
=
NPY_DOUBLE
};};
template
<
>
struct
NumpyEquivalentType
<
std
::
complex
<
double
>
>
{
enum
{
type_code
=
NPY_CDOUBLE
};};
template
<
>
struct
NumpyEquivalentType
<
long
double
>
{
enum
{
type_code
=
NPY_LONGDOUBLE
};};
template
<
>
struct
NumpyEquivalentType
<
std
::
complex
<
long
double
>
>
{
enum
{
type_code
=
NPY_CLONGDOUBLE
};};
template
<
>
struct
NumpyEquivalentType
<
bool
>
{
enum
{
type_code
=
NPY_BOOL
};};
template
<
>
struct
NumpyEquivalentType
<
int
>
{
enum
{
type_code
=
NPY_INT
};};
template
<
>
struct
NumpyEquivalentType
<
long
>
{
enum
{
type_code
=
NPY_LONG
};};
template
<
typename
Scalar
>
bool
isNumpyNativeType
()
{
if
((
int
)
NumpyEquivalentType
<
Scalar
>::
type_code
==
NPY_USERDEF
)
return
false
;
return
true
;
}
template
<
typename
Scalar
>
bool
np_type_is_convertible_into_scalar
(
const
int
np_type
)
{
...
...
This diff is collapsed.
Click to expand it.
include/eigenpy/numpy.hpp
+
22
−
0
View file @
cdcfab5d
...
...
@@ -31,6 +31,28 @@ namespace eigenpy
{
void
EIGENPY_DLLAPI
import_numpy
();
int
EIGENPY_DLLAPI
PyArray_TypeNum
(
PyTypeObject
*
type
);
// By default, the Scalar is considered as a Python object
template
<
typename
Scalar
>
struct
NumpyEquivalentType
{
enum
{
type_code
=
NPY_USERDEF
};};
template
<
>
struct
NumpyEquivalentType
<
float
>
{
enum
{
type_code
=
NPY_FLOAT
};};
template
<
>
struct
NumpyEquivalentType
<
std
::
complex
<
float
>
>
{
enum
{
type_code
=
NPY_CFLOAT
};};
template
<
>
struct
NumpyEquivalentType
<
double
>
{
enum
{
type_code
=
NPY_DOUBLE
};};
template
<
>
struct
NumpyEquivalentType
<
std
::
complex
<
double
>
>
{
enum
{
type_code
=
NPY_CDOUBLE
};};
template
<
>
struct
NumpyEquivalentType
<
long
double
>
{
enum
{
type_code
=
NPY_LONGDOUBLE
};};
template
<
>
struct
NumpyEquivalentType
<
std
::
complex
<
long
double
>
>
{
enum
{
type_code
=
NPY_CLONGDOUBLE
};};
template
<
>
struct
NumpyEquivalentType
<
bool
>
{
enum
{
type_code
=
NPY_BOOL
};};
template
<
>
struct
NumpyEquivalentType
<
int
>
{
enum
{
type_code
=
NPY_INT
};};
template
<
>
struct
NumpyEquivalentType
<
long
>
{
enum
{
type_code
=
NPY_LONG
};};
template
<
typename
Scalar
>
bool
isNumpyNativeType
()
{
if
((
int
)
NumpyEquivalentType
<
Scalar
>::
type_code
==
NPY_USERDEF
)
return
false
;
return
true
;
}
}
#if defined _WIN32 || defined __CYGWIN__
...
...
This diff is collapsed.
Click to expand it.
include/eigenpy/register.hpp
+
2
−
1
View file @
cdcfab5d
...
...
@@ -6,7 +6,7 @@
#define __eigenpy_register_hpp__
#include
"eigenpy/fwd.hpp"
#include
"eigenpy/numpy
-type
.hpp"
#include
"eigenpy/numpy.hpp"
#include
"eigenpy/exception.hpp"
#include
<algorithm>
...
...
@@ -36,6 +36,7 @@ namespace eigenpy
template
<
typename
Scalar
>
static
PyTypeObject
*
getPyType
()
{
namespace
bp
=
boost
::
python
;
if
(
!
isNumpyNativeType
<
Scalar
>
())
{
const
PyTypeObject
*
const_py_type_ptr
=
bp
::
converter
::
registered_pytype
<
Scalar
>::
get_pytype
();
...
...
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