[SciPy-dev] Which matrix library in C++ for scipy
Neal Becker
ndbecker2 at gmail.com
Thu Apr 26 09:44:43 EDT 2007
Fernando Perez wrote:
> On 4/26/07, Neal Becker <ndbecker2 at gmail.com> wrote:
>
>> So my approach is:
>>
>> 1. Write c++ algorithms with generic interfaces (where feasible).
>> 2. When it is not feasible to use generic container types, I use
>> boost::ublas::{vector/matrix} explicitly.
>> 3. The above c++ code is parametrized (templated) on the container types.
>> 4. Explicit instantiations of (3) are then exposed to python, normally
>> specifying ublas::{vector/matrix} as the input/output types.
>>
>> This doesn't, of course, directly interoperate with numpy. I can,
>> however, convert between numpy arrays and ublas::matrix (which currently
>> requires copying the data, unfortunately).
>
> I'm curious (being a rather primitive C++ user) as to why you don't
> like/use/prefer Blitz++ for this particular use? Blitz arrays are
> fairly numpy-like in much of their behavior, and one can be
> instantiated out of a numpy array with minimal cost (copying only the
> striding info, not the actual data). That's what weave uses both for
> weave.blitz and for weave.inline when type_converters=blitz is passed.
>
> Thanks,
>
> f
I did try to evaluate this some time back, and don't recall the reasoning -
but it may be that it appears that blitz++ development has stopped, and I
don't want to invest in something that is going to die. The last release
is Oct 2005.
More information about the SciPy-Dev
mailing list