hey, i have an algorithm that computes two matrices like that:
A(i,k) = (x(i,k) + y(i,k))/norm
B(i,k) = (x(i,k) - y(i,k))/norm
it would be convenient to have the method like that:
A, B = mod.meth(C, prob=.95)
is ith possible to return two arrays?
best regards
+ Peter ---+
On Fri, Jul 29, 2011 at 9:52 AM, Yoshi Rokuko yo...@rokuko.net wrote:
hey, i have an algorithm that computes two matrices like that:
A(i,k) = (x(i,k) + y(i,k))/norm
B(i,k) = (x(i,k) - y(i,k))/norm
it would
+-- Pauli Virtanen ---+
Fri, 29 Jul 2011 10:52:12 +0200, Yoshi Rokuko wrote:
[clip]
A, B = mod.meth(C, prob=.95)
is it possible to return two arrays?
The way to do this in Python is to build a tuple with
Py_BuildValue(OO, A, B) and return
thank you for pointing that out!
so how do you change your numpy related c code now, would you like to share?
best regards, yoshi
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
+ Mark Wiebe ---+
One way to deal with this is to use PyArray_FromAny with the
NPY_C_CONTIGUOUS flag to ensure you have a C-aligned array. If you need to
write to the array, you should also use the NPY_UPDATEIFCOPY flag. Here's
how
+ Mark Wiebe ---+
I believe what you may want is PyArray_ContiguousFromAny instead of
PyArray_ContiguousFromObject.
are you sure that there is a difference? i think its just the new
name for the same thing right?
best regards, yoshi
hey,
i'm writing my first python module in c using numpy/arrayobject.h
and i have some problems with different platforms (both linux but
really different setup) so i suspect my array handling is not cor-
rect.
i'm used to c arrays and want to access large numpy arrays from
within my c module