TMatrixD - delete rows and columns

Hi Folks,

I have a vector of integers. Then I have a TMatrixD.
I would like to delete rows and columns whose the index is present in the above mentioned vector.
Does a function exist?
Otherwise how can I do?

thanks a lot for your help.

Stefano

Hi Stefano,

No that functionality is not implemented but it should be
straightforward to accomplish it with the current code.
I suggest to make and row/column sorted array that contains
the indices that should be kept:

TArrayI keepRow(…);
TMatrixD m (nRow,nCol);
for (Int_t i = 0; i < keepRow.GetSize(); i++)
  TMatrixDColumn(m,i) = TMatrixDColumn(m,keepRow[i]);
m.ResizeTo(keepRow.GetSize(),nCol);
  • Eddy