Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dg
dg
Commits
2ba453e9
Commit
2ba453e9
authored
Sep 13, 2017
by
Jonathan Lambrechts
Browse files
ensure that a numpy array is of type float before using it as a fullmatrix
parent
205a6fdd
Pipeline
#2406
failed with stage
in 31 minutes and 32 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tools/dgtypemaps.i
View file @
2ba453e9
...
...
@@ -61,7 +61,7 @@
return
fm
;
%
#
ifdef
HAVE_NUMPY
PyArrayObject
*
array
=
(
PyArrayObject
*
)
obj
;
if
(
PyArray_Check
(
array
)
&
&
PyArray_ISFARRAY_RO(array)
&
&
PyArray_NDIM(array)
==
2
)
{
if
(
PyArray_Check
(
array
)
&
&
PyArray_ISFARRAY_RO(array)
&
&
PyArray_NDIM(array)
==
2
&
&
PyArray_ISFLOAT(array)
)
{
newMatrix
=
true
;
return
new
fullMatrix
<
double
>
((
double
*
)
PyArray_DATA
(
array
),
PyArray_DIM
(
array
,
0
),
PyArray_DIM
(
array
,
1
))
;
}
...
...
@@ -84,7 +84,7 @@
return
fm
;
%
#
ifdef
HAVE_NUMPY
PyArrayObject
*
array
=
(
PyArrayObject
*
)
obj
;
if
(
PyArray_Check
(
array
)
&
&
PyArray_ISFARRAY(array)
&
&
PyArray_NDIM(array)
==
2
)
{
if
(
PyArray_Check
(
array
)
&
&
PyArray_ISFARRAY(array)
&
&
PyArray_NDIM(array)
==
2
&
&
PyArray_ISFLOAT(array)
)
{
newMatrix
=
true
;
return
new
fullMatrix
<
double
>
((
double
*
)
PyArray_DATA
(
array
),
PyArray_DIM
(
array
,
0
),
PyArray_DIM
(
array
,
1
))
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment