Re: Direct product of matrices.

From: Arthur E. Snyder <snyder_at_slac.stanford.edu>
Date: Fri, 2 Feb 2007 11:49:51 -0800 (PST)


This used to work in HepMatrix -- I guess precendence was different -- but I can see that even there is was dangerous. You ended up with your original matrix transposed; in the application I had I didn't use the matrix again, but if I had I would have been bitten by this feature. It's prob. better the way it is, even if your code doesn't have the nice feature of looking like your algebra.

There could be a transpose function -- Transpose(A) -- but it doesn't really add much. One just needs to learn how to do it right.

-Art S.

A.E. Snyder, Group EC                        \!c*p?/
SLAC Mail Stop #95                          ((.   .))
Box 4349                                        |
Stanford, Ca, USA, 94309                      '\|/`
e-mail:snyder_at_slac.stanford.edu                 o
phone:650-926-2701                              _
http://www.slac.stanford.edu/~snyder          BaBar
FAX:650-926-2657                          Collaboration



On Fri, 2 Feb 2007, Victor Perevoztchikov wrote:

> Hi Art,
> unfortunatelly method T(),change the matrix, not only return transposed.
> So when multiplication started "both" matrices are transposed.
> You need to copy matrix and transpose. Which is not convenient, I agree.
>
> Victor
>
>
> Victor M. Perevoztchikov perev_at_bnl.gov
> Brookhaven National Laboratory MS 510A PO Box 5000 Upton NY 11973-5000
> tel office : 631-344-7894; fax 631-344-4206;
>
> ----- Original Message -----
> From: "Arthur E. Snyder" <snyder_at_slac.stanford.edu>
> To: "Rene Brun" <Rene.Brun_at_cern.ch>
> Cc: "'roottalk (Mailing list discussing all aspects of the ROOT system)'"
> <roottalk_at_cern.ch>
> Sent: Tuesday, January 30, 2007 5:54 PM
> Subject: [ROOT] Direct product of matrices.
>
>
> > Hi Rene et al.,
> >
> >
> > Direct product of matrices which worked with HepMatrix does seem to work
> > for TMatrix.
> >
> > That is if I do
> >
> > TMatrixD A(n,1);
> > then set a to some falues
> >
> > TMatrixD B(n,n);
> > B=A*A.T()
> >
> > it fails. Error message if about rows and columns not matching.
> >
> > This worked with HepMatrix and is useful, for example, in constructing
> > array of derivatives that enters some fits.
> >
> > Is this a bug or a feature? Or am I doing something wrong?
> >
> > It not hard to write my own direct product function but it looks ugly...
> >
> > -Art S.
> >
> >
> >
> > A.E. Snyder, Group EC \!c*p?/
> > SLAC Mail Stop #95 ((. .))
> > Box 4349 |
> > Stanford, Ca, USA, 94309 '\|/`
> > e-mail:snyder_at_slac.stanford.edu o
> > phone:650-926-2701 _
> > http://www.slac.stanford.edu/~snyder BaBar
> > FAX:650-926-2657 Collaboration
> >
> >
> >
>
>
Received on Fri Feb 02 2007 - 20:50:06 CET

This archive was generated by hypermail 2.2.0 : Fri Feb 02 2007 - 23:50:01 CET