On 13/10/14 01:18, Nathaniel Smith wrote:
> On Mon, Oct 13, 2014 at 12:07 AM, Pauli Virtanen wrote:
>> 12.10.2014, 22:16, Eric Firing kirjoitti:
>>> On 2014/10/12, 8:29 AM, Pauli Virtanen wrote:
12.10.2014, 20:19, Mads Ipsen kirjoitti:
> Is there any way for me to detect (on the Python si
On Mon, Oct 13, 2014 at 12:07 AM, Pauli Virtanen wrote:
> 12.10.2014, 22:16, Eric Firing kirjoitti:
>> On 2014/10/12, 8:29 AM, Pauli Virtanen wrote:
>>> 12.10.2014, 20:19, Mads Ipsen kirjoitti:
Is there any way for me to detect (on the Python side) that transpose()
has been invoked on th
12.10.2014, 22:16, Eric Firing kirjoitti:
> On 2014/10/12, 8:29 AM, Pauli Virtanen wrote:
>> 12.10.2014, 20:19, Mads Ipsen kirjoitti:
>>> Is there any way for me to detect (on the Python side) that transpose()
>>> has been invoked on the matrix, and thereby only do the copy operation
>>> when it re
On 2014/10/12, 8:29 AM, Pauli Virtanen wrote:
> 12.10.2014, 20:19, Mads Ipsen kirjoitti:
>> Is there any way for me to detect (on the Python side) that transpose()
>> has been invoked on the matrix, and thereby only do the copy operation
>> when it really is needed?
>
> The correct way to do this i
12.10.2014, 20:19, Mads Ipsen kirjoitti:
> Is there any way for me to detect (on the Python side) that transpose()
> has been invoked on the matrix, and thereby only do the copy operation
> when it really is needed?
The correct way to do this is to, either:
In your C code check PyArray_IS_C_CO
Hi,
In part of my C++ code, I often do
void foo(PyObject * matrix) {
do stuff
}
where matrix is a numpy mxn matrix created on the Python side, where
foo() eg. is invoked as
a = numpy.array([[1,2],[3,5]])
foo(a)
However, if you call transpose() on a, some care should be taken, since
numpy'