Re: [Numpy-discussion] Please don't use google code for hosting

2009-01-17 Thread Georg Holzmann
Hallo! Thanks, this is interesting ! Do you also know how the situation is with sourceforge/launchpad/trac... and other popular hosting systems ? Do they also have these restrictions ? LG Georg Matthew Brett schrieb: > Hi, > > I am just visiting colleagues in the Cuban Neuroscience Center, a

Re: [Numpy-discussion] swig numpy2carray converters

2007-12-01 Thread Georg Holzmann
Hallo! > * A new ARGOUTVIEW suite of typemaps is provided that allows your > wrapped function >to provide a pointer to internal data and that returns a numpy > array encapsulating >it. Thanks for integrating it ! > * New typemaps are provided that correctly handle FORTRAN ordered 2D

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-26 Thread Georg Holzmann
Hallo! > First, my plan is to add to numpy.i, typemaps for signatures like the > following: > > %typemap(argout) (double** ARGOUT_ARRAY1, int* DIM1) > > It is important to note that even though the same argument *names* are > used, this is a different typemap signature than > > %typem

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-21 Thread Georg Holzmann
Hallo! As chris said, I need to make an example: http://grh.mur.at/software/numpy2carray.tar.gz I added the following class-example: class_example.h: the C++ code class_example.i: the SWIG interface file class_example_usage.py: example usage in python And some comments: Bill Spotz schrieb: > H

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Georg Holzmann
Hallo! > OK, so the key here is the *internal* matrix. I think you need to > provide a way to extract that matrix from the C++ application as a numpy > array. Then you can provide it to your function/method as an INPLACE > array. No new memory will be allocated. [...] > The INPLACE typemaps

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Georg Holzmann
Hallo! > Is there any doc on numpy.i usage? yes there is a pdf in /numpy/doc/swig ! LG Georg ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Georg Holzmann
Hallo! > Of course : http://matt.eifelle.com/item/5 > It's a basic version of the wrapper I use in my lab (pay attention to > the constructor for instance), I hope you will be able to do something Thanks ! But this assumes that the data in my C++ library is stored in a PyArrayObject ? This is

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Georg Holzmann
Hallo! > E.g. in my algorithm I can have a very big internal matrix in C++ (say > 700 MB - in fortran style). Now I want to have this matrix in numpy to > plot some parts of it, get some data out of it ... whatever - if I again > allocate an array of the same size, I am out of memo

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Georg Holzmann
Hallo! > Really? I worked pretty hard to avoid copies when they were not > necessary. For the ARGOUT typemaps, I allocate an array of the > requested size and then pass its data buffer to your function. If Yes but this means that you again allocate an array of the same size. E.g. in my a

Re: [Numpy-discussion] swig numpy2carray converters

2007-11-20 Thread Georg Holzmann
Hallo! > How is this better/different than numpy.i in: > > numpy/doc/swig/numpy.i The problem I had with numpy.i: - it copies the arrays on output (Argout Arrays) which was not possible for my algorithms (I have some very big matrices) - it is not possible to 2D or 3D Argout Arrays (why?), in

[Numpy-discussion] swig numpy2carray converters

2007-11-16 Thread Georg Holzmann
Hallo! Because I had some troubles in wrapping my C++ library in python/numpy, I did (another) numpy2carray.i file for SWIG. With that interface file it is possible to input/output arrays with or without copying data (I also included an example for an interface to fortran style arrays). I am s

Re: [Numpy-discussion] fortran array storage question

2007-10-26 Thread Georg Holzmann
Hallo! > This depends on what you are trying to do, but generally, I find that if > you can afford it memory-wise, it is much faster to just get a C > contiguous array if you treat your C array element per element. If you Yes, but the problem is that this data is very big (up to my memory lim

Re: [Numpy-discussion] fortran array storage question

2007-10-26 Thread Georg Holzmann
Hallo! I found now a way to get the data: > Therefore I do the following (2D example): > >obj = PyArray_FromDimsAndData(2, dim0, PyArray_DOUBLE, (char*)data); >PyArrayObject *tmp = (PyArrayObject*)obj; >tmp->flags = NPY_FARRAY; if in that example I also change the strides: int s

[Numpy-discussion] fortran array storage question

2007-10-25 Thread Georg Holzmann
Hallo! I have the following problem: I get a data array in column major storage order and want to use it as numpy array without copying data. Therefore I do the following (2D example): obj = PyArray_FromDimsAndData(2, dim0, PyArray_DOUBLE, (char*)data); PyArrayObject *tmp = (PyArrayObject