Boost logo

Boost :

Subject: Re: [boost] different matrix library?
From: Edward Grace (ej.grace_at_[hidden])
Date: 2009-08-15 06:30:46


>> till now i actually don't see any critical flaws in the design
>> implementation will be altered in any way of course
>>
> Well, the problem is not the design per itself. What usually happens
> with such lib is that you have tons of different user types
> that all want disjoint set of features.

Amen!

I'm off on a bit of a rant here, glaze over... One thing that bugs me
a little is the lack of communication between the C++ (or indeed CS)
community and the scientific community, both sides are at fault
here. For example:

        A | B
     C++ world | Science world -
   ------------------+--------------------
     std::complex | Ok, finally at long last but seriously HOW
LONG DID THAT TAKE!?
    std::vector | Huh? That's not a vector dammit!
    std::valarray | Huh? What only 1D - not much of an array.
    std::transform | Err, map? What you mean to apply something
to every element in an
                     | array I've got to write a whole new function?
(yes I know about lambdas)
      ? [still] | Matrices such a fundamentally useful thing
                     | that simply isn't native to the language and
keeps people
                     | tied to F90.
                     |
      int/int=int | What do you mean I can divide an integer by an
integer? Integers are not
                     | closed under division - this makes no sense,
I'm going to the pub.

Obviously there are good reasons column A is what it is, but if one's
ignorant of that it looks odd when viewed from column B.

I still maintain that doing scientific computing in C++ is an uphill
struggle. Some may argue that C++ is not about the library its about
the language. In practice the pragmatic pick a language because of
the library. The STL (and Boost of course) bridges that gap
somewhat, but a ratified SSTL (Scientific Standard Template Library)
would be a massive boon to C++ for science.

> Matrix lib always looks easy to do. Except they are not.

The plethora of rarely used half finished C++ linear algebra
libraries on the web are a testament to that.

> I can toss you
> tons of questions : will you support openMP, threading, MPI, SIMD
> extensions, will you embed loop level optimization based on expression
> introspection ?

Joel, as an aside - have people (e.g. you) started looking at using C+
+ metadata to carry out code transformations that span abstractions -
potentially very useful for parallelising? For example being able to
concretely make certain guarantees about the dependence of various
variables (e.g. regarding aliasing) in a program could allow higher-
level optimisations to be performed.

> Will you interface looks like matlab, maple or
> mathematica ? etc ... Not even counting the things we barely scratched
> like storage mode, allocation mode etc...
>
> That's why I'm avoiding to comment your code cause I'm developing
> something similar but for a somehow different audience than yours
> and my
> view will prolly be radically different than yours.
>
> I can also only reiterate the fact that I have a somehow large code
> base
> for such a thing that's maybe worth reusing. Three heads are better
> than
> two I think.

One thing I would certainly be keen on seeing would be a 'best of
breed' linear algebra / tensor and scientific computing library. The
obvious place this should live would be Boost.

That said, I think the amount of work involved here should not be
underestimated. My bet is that there are so many of these 'matrix'
libraries out there because people discover object orientation, then
template metaprogramming and plough on to write their own library.
When it gets good enough for what they want they stop - the full
problem as I think Joel is eluding to is huge and very very hard indeed.

Ideally a project like this should get some sort of sponsorship. If
a team of (say) 4 C++ experts could be put together with a team of
other stakeholders (mathematicians, physicists and engineers) and
FORTRAN90 HPC experts - who will have a wealth of experience, with
some industry support (e.g. NVIDIA) truly great things could happen.

Oh, I forgot, after probably 10 years of development.

-ed


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