Re: [Numpy-discussion] C++ Example

2012-03-06 Thread Charles R Harris
On Tue, Mar 6, 2012 at 5:39 PM, Sturla Molden wrote: > > > Den 7. mars 2012 kl. 00:43 skrev Charles R Harris < > charlesr.har...@gmail.com>: > > > > > > > I don't see generics as the main selling point of C++ for Numpy. What I > expect to be really useful is exception handling, smart pointers, an

Re: [Numpy-discussion] C++ Example

2012-03-06 Thread Sturla Molden
Den 7. mars 2012 kl. 00:43 skrev Charles R Harris : > > > I don't see generics as the main selling point of C++ for Numpy. What I > expect to be really useful is exception handling, smart pointers, and RIAA. > And maybe some carefule uses of classes and inheritance. Having a standard > inli

Re: [Numpy-discussion] C++ Example

2012-03-06 Thread Dag Sverre Seljebotn
On 03/06/2012 12:54 PM, Sturla Molden wrote: > On 06.03.2012 21:45, Matthieu Brucher wrote: > >> This is your opinion, but there are a lot of numerical code now in C++ >> and they are far more maintainable than in Fortran. And they are faster >> for exactly this reason. > > That is mostly because C

Re: [Numpy-discussion] C++ Example

2012-03-06 Thread David Cournapeau
On Tue, Mar 6, 2012 at 6:43 PM, Bryan Van de Ven wrote: > On 3/6/12 2:39 PM, Sturla Molden wrote: >> We can augment standard C with syntax suger for >> generics, or even NumPy arrays and Python types, using a Python script >> as meta-compiler. We don't need C++ for that. > I can only speak for mys

Re: [Numpy-discussion] C++ Example

2012-03-06 Thread Bryan Van de Ven
On 3/6/12 2:39 PM, Sturla Molden wrote: > We can augment standard C with syntax suger for > generics, or even NumPy arrays and Python types, using a Python script > as meta-compiler. We don't need C++ for that. I can only speak for myself. I do not want to be in the meta-compiler business, and I d

Re: [Numpy-discussion] C++ Example

2012-03-06 Thread Charles R Harris
On Tue, Mar 6, 2012 at 4:03 PM, Sturla Molden wrote: > Upcoming Cython releases will have a generics system called "fused types". > > Sturla > > Sendt fra min iPad > > Den 6. mars 2012 kl. 23:26 skrev Chris Barker : > > > On Sun, Mar 4, 2012 at 2:18 PM, Luis Pedro Coelho wrote: > >> At least las

Re: [Numpy-discussion] C++ Example

2012-03-06 Thread Sturla Molden
Upcoming Cython releases will have a generics system called "fused types". Sturla Sendt fra min iPad Den 6. mars 2012 kl. 23:26 skrev Chris Barker : > On Sun, Mar 4, 2012 at 2:18 PM, Luis Pedro Coelho wrote: >> At least last time I read up on it, cython was not able to do multi-type >> code,

Re: [Numpy-discussion] C++ Example

2012-03-06 Thread Chris Barker
On Sun, Mar 4, 2012 at 2:18 PM, Luis Pedro Coelho wrote: > At least last time I read up on it, cython was not able to do multi-type code, > i.e., have code that works on arrays of multiple types. Does it support it > now? The Bottleneck project used some sort of template system to generate multip

Re: [Numpy-discussion] C++ Example

2012-03-06 Thread Matthieu Brucher
2012/3/6 Sturla Molden > On 06.03.2012 21:45, Matthieu Brucher wrote: > > > This is your opinion, but there are a lot of numerical code now in C++ > > and they are far more maintainable than in Fortran. And they are faster > > for exactly this reason. > > That is mostly because C++ makes tasks th

Re: [Numpy-discussion] C++ Example

2012-03-06 Thread Sturla Molden
On 06.03.2012 21:45, Matthieu Brucher wrote: > This is your opinion, but there are a lot of numerical code now in C++ > and they are far more maintainable than in Fortran. And they are faster > for exactly this reason. That is mostly because C++ makes tasks that are non-numerical easier. But tha

Re: [Numpy-discussion] C++ Example

2012-03-06 Thread Matthieu Brucher
Using either for > numerical programming usually a mistake. > This is your opinion, but there are a lot of numerical code now in C++ and they are far more maintainable than in Fortran. And they are faster for exactly this reason. Matthieu -- Information System Engineer, Ph.D. Blog: http://matt.e

Re: [Numpy-discussion] C++ Example

2012-03-06 Thread Sturla Molden
On 03.03.2012 17:07, Luis Pedro Coelho wrote: > I sort of missed the big C++ discussion, but I'd like to give some examples of > how writing code can become much simpler if you are based on C++. This is from > my mahotas package, which has a thin C++ wrapper around numpy's C API Here you are usin

Re: [Numpy-discussion] C++ Example

2012-03-05 Thread David Cournapeau
On Sun, Mar 4, 2012 at 2:18 PM, Luis Pedro Coelho wrote: > On Saturday, March 03, 2012 04:38:53 PM David Cournapeau wrote: >> I don't think the code is comparable either - some of the stuff done >> in the C code is done in the C++ code your are calling. The C code >> could be significantly improve

Re: [Numpy-discussion] C++ Example

2012-03-04 Thread Jeff Whitaker
On 3/4/12 3:18 PM, Luis Pedro Coelho wrote: > On Saturday, March 03, 2012 04:38:53 PM David Cournapeau wrote: >> I don't think the code is comparable either - some of the stuff done >> in the C code is done in the C++ code your are calling. The C code >> could be significantly improved. > Actually,

Re: [Numpy-discussion] C++ Example

2012-03-04 Thread Luis Pedro Coelho
On Saturday, March 03, 2012 04:38:53 PM David Cournapeau wrote: > I don't think the code is comparable either - some of the stuff done > in the C code is done in the C++ code your are calling. The C code > could be significantly improved. Actually, that's not 100% accurate. The C code calls the sa

Re: [Numpy-discussion] C++ Example

2012-03-04 Thread Gael Varoquaux
On Sat, Mar 03, 2012 at 04:38:53PM -0800, David Cournapeau wrote: > This is really the kind of code that should be done in cython, as it is > mostly about wrapping C code into the python C API. +1 Gael ___ NumPy-Discussion mailing list NumPy-Discussion@

Re: [Numpy-discussion] C++ Example

2012-03-03 Thread David Cournapeau
On Sat, Mar 3, 2012 at 8:07 AM, Luis Pedro Coelho wrote: > Hi, > > I sort of missed the big C++ discussion, but I'd like to give some examples of > how writing code can become much simpler if you are based on C++. This is from > my mahotas package, which has a thin C++ wrapper around numpy's C API

[Numpy-discussion] C++ Example

2012-03-03 Thread Luis Pedro Coelho
Hi, I sort of missed the big C++ discussion, but I'd like to give some examples of how writing code can become much simpler if you are based on C++. This is from my mahotas package, which has a thin C++ wrapper around numpy's C API https://github.com/luispedro/mahotas/blob/master/mahotas/_morph.c