David Cournapeau [EMAIL PROTECTED] writes:
Alexander Schmolck wrote:
Charles R Harris [EMAIL PROTECTED] writes:
The automatic handling of pointers for the default allocation type is also
convenient and makes it reasonable to have functions return matrices and
vectors.
Hmm, I
On 9/21/07, Alexander Schmolck [EMAIL PROTECTED] wrote:
David Cournapeau [EMAIL PROTECTED] writes:
Alexander Schmolck wrote:
Charles R Harris [EMAIL PROTECTED] writes:
The automatic handling of pointers for the default allocation type is
also
convenient and makes it reasonable to
Charles R Harris [EMAIL PROTECTED] writes:
The automatic handling of pointers for the default allocation type is also
convenient and makes it reasonable to have functions return matrices and
vectors.
Hmm, I wonder whether I missed something when I read the manual. I didn't see
anything in the
Alexander Schmolck wrote:
Charles R Harris [EMAIL PROTECTED] writes:
The automatic handling of pointers for the default allocation type is also
convenient and makes it reasonable to have functions return matrices and
vectors.
Hmm, I wonder whether I missed something when I read
On 9/17/07, David Cournapeau [EMAIL PROTECTED] wrote:
Christopher Barker wrote:
David Cournapeau wrote:
Christopher Barker wrote:
My real question is what compiler and library writers are doing -- has
anyone (OK, I guess MS and gcc are all I care about anyway) built
anything optimized
Christopher Barker wrote:
David Cournapeau wrote:
Christopher Barker wrote:
My real question is what compiler and library writers are doing -- has
anyone (OK, I guess MS and gcc are all I care about anyway) built
anything optimized for them? Are they going to dump them? Who knows?
What do
On 9/10/07, Christopher Barker [EMAIL PROTECTED] wrote:
Thanks for you input Xavier.
Xavier Gnata wrote:
std:valarray are quite strange containers because they are not well
integrated in the STL.
I always use vector when I have to deal with arrays.
ps : There are no real performance
Charles R Harris wrote:
On 9/10/07, *Christopher Barker* [EMAIL PROTECTED]
STL either, so I'm not sure there is any downside to valarray. It looks
like neither one [vector or valarray] supports any kind of view
semantics, so for the
purposes of numpy array wrapping, they really
Thanks for you input Xavier.
Xavier Gnata wrote:
std:valarray are quite strange containers because they are not well
integrated in the STL.
I always use vector when I have to deal with arrays.
ps : There are no real performance differences between vector and
valarray (in my use cases...)
Xavier Gnata wrote:
Here it is :)
Thanks, that's helpful. Am I reading it right? Are you running the
python process embedded in your C++ app? (rather than extending?)
valarray double Data (NbData);
array = PyArray_SimpleNewFromData (NbDims, Dims, PyArray_DOUBLE,
Data[0]);
OK, so
OK, so you've now got a view of the data from the valarray. Nice to know
this works, but, of course, fragile if the valarray is re-sized or
anything, so it probably won't work for us.
Unless you use a special allocator/desallocator (I don't know if the latter
is possible), I don't know how
Christopher Barker wrote:
Xavier Gnata wrote:
Here it is :)
Thanks, that's helpful. Am I reading it right? Are you running the
python process embedded in your C++ app? (rather than extending?)
Yes! The point is this way I'm able to debug my C++ code plotting the
array using
yeah! Looks good!
Thanks a lot.
Xavier
Thanks!
DG
Lisandro Dalcin wrote:
David, I'll try to show you what I do for a custom C++ class, of
course this does not solve the issue resizing (my class does not
actually support resizing, so this is fine for me):
My custom class is a
Christopher Barker wrote:
Xavier Gnata wrote:
I'm using the numpy C API (PyArray_SimpleNewFromData) to perform the
conversion but my code is written by hands.
I'd like to see that. How are you getting the pointer to pass in to
PyArray_SimpleNewFromData? It looks like you can do
Bryan Van de Ven wrote:
Christopher Barker wrote:
Does anyone know the status of support for valarrays now?
I used std::valarray to implement a variant of the example Matrix class in
Stroustrup's book (2D only) about two years ago. I was aware that is in
disuse,
by and large,
Christopher Barker [EMAIL PROTECTED] writes:
Joris De Ridder wrote:
A related question, just out of curiosity: is there a technical
reason why Numpy has been coded in C rather than C++?
There was a fair bit of discussion about this back when the numarray
project started, which was a
Bill Spotz [EMAIL PROTECTED] writes:
On Sep 5, 2007, at 11:38 AM, Christopher Barker wrote:
Of course, it should be possible to write C++ wrappers around the core
ND-array object, if anyone wants to take that on!
boost::python has done this for Numeric, but last I checked, they
have not
David, I'll try to show you what I do for a custom C++ class, of
course this does not solve the issue resizing (my class does not
actually support resizing, so this is fine for me):
My custom class is a templatized one called DTable (is like a 2d
contiguous array), but currently I only
Thanks!
DG
Lisandro Dalcin wrote:
David, I'll try to show you what I do for a custom C++ class, of
course this does not solve the issue resizing (my class does not
actually support resizing, so this is fine for me):
My custom class is a templatized one called DTable (is like a 2d
2007/9/5, Christopher Barker [EMAIL PROTECTED]:
Matthieu Brucher wrote:
Blitz++ is more or less avandoned. It uses indexes than can be
not-portable between 32bits platforms and 64bits ones.
Oh well -- that seems remarkably short sited, but would I have done
better?
Well, it's too bad
Xavier Gnata wrote:
I'm using the numpy C API (PyArray_SimpleNewFromData) to perform the
conversion but my code is written by hands.
I'd like to see that. How are you getting the pointer to pass in to
PyArray_SimpleNewFromData? It looks like you can do something like:
(VA is a
A related question, just out of curiosity: is there a technical
reason why Numpy has been coded in C rather than C++?
Joris
On 05 Sep 2007, at 02:24, David Goldsmith wrote:
Anyone have a well-tested SWIG-based C++ STL valarray = numpy.array
typemap to share? Thanks!
DG
--
I'm using the numpy C API (PyArray_SimpleNewFromData) to perform the
conversion but my code is written by hands. I would like to simplify it
using SWIG but I also would like to see a good typemap valarray =
numpy.array :)
Joris : Historical ones? Maybe also the fact that distutils has some
Have you seen this?
http://www.scipy.org/Cookbook/SWIG_and_NumPy
Also, the numpy/doc/swig directory has the simple typemaps.
Travis
On Sep 5, 2007, at 7:08 AM, Xavier Gnata wrote:
I'm using the numpy C API (PyArray_SimpleNewFromData) to perform the
conversion but my code is written by
I have been considering adding some C++ STL support to numpy/doc/swig/
numpy.i. Probably std::vectorTYPE = PyArrayObject (and some
std::complexTYPE support as well). Is this what you had in mind?
On Sep 4, 2007, at 6:24 PM, David Goldsmith wrote:
Anyone have a well-tested SWIG-based C++
Point of clarification: below well-tested = well-use-tested, not
(necessarily) well-unit-tested.
DG
David Goldsmith wrote:
Anyone have a well-tested SWIG-based C++ STL valarray = numpy.array
typemap to share? Thanks!
DG
--
ERD/ORR/NOS/NOAA
No I hadn't - thanks! (Probably should have Google-d first, huh. :-[ )
DG
Travis Vaught wrote:
Have you seen this?
http://www.scipy.org/Cookbook/SWIG_and_NumPy
Also, the numpy/doc/swig directory has the simple typemaps.
Travis
On Sep 5, 2007, at 7:08 AM, Xavier Gnata wrote:
I'm
Not presently, as the C++ code I need to wrap now is using the valarray
class template (largely at my behest), though I (and I imagine others)
might find this useful in the future.
DG
Bill Spotz wrote:
I have been considering adding some C++ STL support to
numpy/doc/swig/numpy.i. Probably
In article [EMAIL PROTECTED],
Bill Spotz [EMAIL PROTECTED] wrote:
I have been considering adding some C++ STL support to numpy/doc/swig/
numpy.i. Probably std::vectorTYPE = PyArrayObject (and some
std::complexTYPE support as well). Is this what you had in mind?
That sounds very useful,
Joris De Ridder wrote:
A related question, just out of curiosity: is there a technical
reason why Numpy has been coded in C rather than C++?
There was a fair bit of discussion about this back when the numarray
project started, which was a re-implementation of the original Numeric.
IIRC, one
On Sep 5, 2007, at 11:19 AM, Christopher Barker wrote:
Bill Spotz wrote:
I have been considering adding some C++ STL support to numpy/doc/
swig/
numpy.i. Probably std::vectorTYPE = PyArrayObject (and some
std::complexTYPE support as well). Is this what you had in mind?
well,
On Sep 5, 2007, at 11:38 AM, Christopher Barker wrote:
Of course, it should be possible to write C++ wrappers around the core
ND-array object, if anyone wants to take that on!
boost::python has done this for Numeric, but last I checked, they
have not upgraded to numpy.
** Bill Spotz
Bill Spotz wrote:
Yes, this resizing memory management issue is the main reason I haven't
tried to implement it in numpy.i yet.
thinking out loud
A possibly better solution would be to develop a class that inherits
from std::valarrayTYPE but also implements the array interface
attributes
He goes on to suggest that Blitz++ might have more of a future. (though
it looks like he's involved with the Boost project now)
Blitz++ is more or less avandoned. It uses indexes than can be not-portable
between 32bits platforms and 64bits ones.
Is there another alternative? At the moment,
On 9/6/07, Christopher Barker [EMAIL PROTECTED] wrote:
Bill Spotz wrote:
However, I'm beginning to have my doubts about valarrays. I'm reading:
Josuttis, Nicolai M. 1999. The C+= Standard Library: A Tutorial and
Reference
It's 8 years old now, but he writes:
The valarray classes were not
Matthieu Brucher wrote:
Blitz++ is more or less avandoned. It uses indexes than can be
not-portable between 32bits platforms and 64bits ones.
Oh well -- that seems remarkably short sited, but would I have done better?
The Boost.Array is a fixed-size array, determined at compile-time,
Ah, I
Christopher Barker writes:
I've seen that -- it does look like all we'd need is the header.
So, can one:
- create a Multiarray from an existing data pointer?
- get the data pointer for an existing Multiarray?
I think that's what I'd need to make the numpy array -
Philip Austin wrote:
Albert Strasheim has done some work on this:
http://thread.gmane.org/gmane.comp.python.c++/11559/focus=11560
Thanks for the pointer. Not a lot of docs, and it looks like he's using
boost::python, and I want to use SWIG, but I'm sure there's something
useful in there.
Travis Vaught wrote:
Have you seen this?
http://www.scipy.org/Cookbook/SWIG_and_NumPy
Unclear (to me): precisely what does one get from running python
numpy/docs/swig/setup.py install, and is the product necessary, and if
so, which other components rely on the product? I ask 'cause I'm
The setup.py script in numpy/doc/swig is for compiling test code for
numpy.i. It is properly invoked by the Makefile, which will first
run swig to generate the wrapper code for the test classes. All a
developer, who is using swig to interface some code with numpy in
python, needs is
Anyone have a well-tested SWIG-based C++ STL valarray = numpy.array
typemap to share? Thanks!
DG
--
ERD/ORR/NOS/NOAA http://response.restoration.noaa.gov/emergencyresponse/
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
41 matches
Mail list logo