[q] usage of TmatrixDSym

Hello,

I’m confused with symmetric matrix class, following
code gave me unexpected result, is this a feature?
Then, how can I get expected symmetric matrix?

Thanks,
Chul Su Park

PS–

  • root version == 4.01/02
  • on linux

{
gROOT->Reset();
TMatrixDSym m(2);
m(0,1) = 1;
m.Print();

cout << m.(1,0) << endl;
}

Hi Chul Su,

It is a known issue with the symmetric matrix class TMatrixDSym
that operations with [] () and the matrix views
TMatrixDColumn TMatrixDRow, TMatrixDFlat and TMatrixDSub
are not “symmetric” safe (yet) .

So in your case you will have to do m(1,0) = m(0,1) = 1;

Eddy