Re: [ROOT] TMatrix Invert Mult

From: sdean (sdean@fnal.gov)
Date: Thu May 01 2003 - 15:59:38 MEST


Hi Eddy,

Thanks, it works now. Not sure why though, when I did:

> TMatrix b(2,2);
> b=a.Invert();

and inspected b, it did contain the correct numbers. I had assumed it was
a problem with Mult(), but obviously not!

Thanks again,

Simon

On Thu, 1 May 2003, Eddy Offermann wrote:

> Hi Dean,
>
> I will look into it.
>
> For the moment replace:
>
> TMatrix b(2,2);
> b=a.Invert();
>
> by
>
> TMatrix b(TMatrix::kInverted,a)
>
> Best Regards,
> Eddy
>
> > X-Authentication-Warning: pcroot.cern.ch: majordomo set sender to
> owner-roottalk@root.cern.ch using -f
> > X-External: Man_on_the_moon
> > Date: Thu, 01 May 2003 07:27:30 -0500 (CDT)
> > From: sdean <sdean@fnal.gov>
> > Subject: [ROOT] TMatrix Invert Mult
> > To: roottalk@pcroot.cern.ch
> > MIME-version: 1.0
> > Content-transfer-encoding: 7BIT
> >
> > Hi there,
> >
> > Please inspect the following piece of code which attempts to perform one
> > of the most basic matrix operations, that of multiplying a matrix by its
> > inverse to obtain the unit matrix:
> >
> > root [0] TMatrix a(2,2)
> > root [1] a(0,0)=1.0;
> > root [2] a(1,0)=2.0;
> > root [3] a(0,1)=3.0;
> > root [4] a(1,1)=4.0;
> > root [5] TMatrix b(2,2)
> > root [6] b=a.Invert();
> > root [7] TMatrix c(2,2)
> > root [8] c.Mult(b,a)
> > root [9] c(0,0)
> > (Real_t)5.50000000000000000e+00
> > root [10] c(1,0)
> > (Real_t)(-2.50000000000000000e+00)
> > root [11] c(0,1)
> > (Real_t)(-3.75000000000000000e+00)
> > root [12] c(1,1)
> > (Real_t)1.75000000000000000e+00
> >
> > The results look much too precise for this to be a conversion error. Can
> > anyone see where I'm going wrong?
> >
> > cheers,
> >
> > Simon
> >
>
> Eddy A.J.M. Offermann
> Renaissance Technologies Corp.
> Route 25A, East Setauket NY 11733
> e-mail: eddy@rentec.com
> http://www.rentec.com
>
>



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:11 MET