Re: OON: RE: alpha release of MET, C++ matrix with expression templates

From: Masakatsu ITO (mito@masa.ims.ac.jp)
Date: Sat Feb 17 2001 - 04:37:43 EST


From: "Michael L. Hall" <Hall@lanl.gov>

> Masakatsu ITO <mito@masa.ims.ac.jp> writes:
> > I had always wanted to simplify the fortran codes for linear algebraic
> > expressions. Consider u = M*v + w, where u,v and w are vectors and
> > M is matrix. Fortran requires multiple loops or subroutine calls with
> > complicated argument list.
>
> As of Fortran 90, this expression may be written:
>
> u = matmul(M, v) + w

I see, f90 is not so bad as f77. If polymorphic operator *
was used instead of matmul(,) , that notational convenience
would be perfect. ( What if M is scalar or a diagonal matrix? )

> Also, it will work for array sections,
> like this:
>
> u(3:7) = matmul(M(3:7,:), v(:)) + w(3:7)
>
> which just calculates the third through seventh rows of the equation.

MET also work for slices of matrix and vector.

        Range i(2,6); RowRange r(2,6); ColRange c(2,6);
        u(i) = m(r,c) * v(i) ;

Masakatsu Ito
Computer Center of Institute for Molecular Science
E-mail mito@ims.ac.jp

--------------------- Object Oriented Numerics List --------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/oon/
* If this doesn't work, please send a note to owner-oon-list@oonumerics.org



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:15 EST