Boost logo

Boost :

Subject: Re: [boost] different matrix library?
From: Edward Grace (ej.grace_at_[hidden])
Date: 2009-08-17 08:01:37


On 17 Aug 2009, at 10:09, Rutger ter Borg wrote:

> joel wrote:
>
>> It only exists in our internal SVN server right now. We're working
>> hard
>> to get it out asap.
>> Anyway, it's the exact same set of features except it use proto and
>> better understanding of fusion/MPL
>> and provide an openMP support. Interface is the same except for
>> matrix
>> settings that use round lambda
>> instead of template class.
>
> Ok. I am looking through the documentation of version 2, there are
> things I
> like, and some things to lesser extend, mainly because it tries to
> mimic
> Matlab.

I don't quite understand why you wouldn't want a DSL like MATLAB?
After all, MATLAB remember is essentially FORTRAN with different
horse shoes, that's why so many scientific / engineering types pick
it up so fast - there is very little that's new to learn.

For example,

  alpha(2:10)=alpha(1:9)

Is the above MATLAB or FORTRAN? How would you express this in C++
(note the aliasing)? Perhaps

  alpha(range(2,10))=alpha(range(1,9));

or some-such? How about,

  vec=mat(:,4)

(Again, is that MATLAB or is it FORTRAN?)

Presumably something like:

  vec=matrix_row<matrix<double> >(mat,4); // uBlas style.

It's also one of the reasons it's become so successful - well tuned
mature libraries (like ATLAS, FFTW) all wrapped up and callable with
a simple syntax. I never really develop scientific codes in C++
anymore - it's all pain, no gain!

Being able to do

  x=A\b; % Solve Ax = b

to solve a linear algebra problem and be fairly confident that under
the hood it's chosen the right routine and is going like the clappers
should not be underestimated.

FORTRAN syntax is the way it is because of the job it's got to do
(scientific computing) - no more - no less.

> Have you considered creating a more C++-like domain-specific
> language, taking elements from various domain-specific languages?

Can you give some examples?

If you go and write a whole new paradigm (interface) for linear
algebra without at least a nod to it's heritage it will probably be
ignored by many of the people who actually *do* it for a living and
get used just by hobbyists who enjoy the process rather than the
result. (I'm guilty of that myself - hence I'm here).

In my humble opinion, for C++ to really take off in next generation
scientific applications (believe me I'd love to see it happen), the
language should keep out of the way. Ultimately application writers
just want the answer - they really don't want to have to figure out
how the minutiae of template meta-programming works.

Get 'em in the door first with an easy to use intuitive interface --
once they are on board you can break out the hard stuff, then they
will be hooked for life! ;-)

-ed


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk