Re: [Numpy-discussion] Indexing with weave

2007-01-08 Thread Barry Wark
oops. and it works in test(). sorry. my eyes aren't what they used to be :) On 1/8/07, Keith Goodman <[EMAIL PROTECTED]> wrote: > On 1/8/07, Barry Wark <[EMAIL PROTECTED]> wrote: > > I think you want > > y = x[0,i] > > I followed the weave.inline example at > > http://www.scipy.org/PerformancePyth

Re: [Numpy-discussion] Indexing with weave

2007-01-08 Thread Keith Goodman
On 1/8/07, Barry Wark <[EMAIL PROTECTED]> wrote: > I think you want > y = x[0,i] I followed the weave.inline example at http://www.scipy.org/PerformancePython which uses the C-like x(i,j) instead of the numpy x[i,j]. Changing test2 to y = x[0,i] gives "TypeError: cannot convert value to double"

Re: [Numpy-discussion] Indexing with weave

2007-01-08 Thread Barry Wark
Keith, I think you want y = x[0,i] Remember that indexing in numpy/scipy is the python way (using []), not the matlab way (using () )... I've been bitten by the distinction many times. Barry On 1/8/07, Keith Goodman <[EMAIL PROTECTED]> wrote: > My first weave attempt weaves something to be desi

[Numpy-discussion] Indexing with weave

2007-01-08 Thread Keith Goodman
My first weave attempt weaves something to be desired. test() works, but test2() doesn't. It complains about the line "y = x(0,i);" In function 'PyObject* compiled_func(PyObject*, PyObject*)': blah.cpp:667: error: no match for call to '(py::object) (int, int&)' I am no match for that error mess