Re: Structure of the TDecompSVD object

From: Vassili Maroussov <Vassili.Maroussov_at_cern.ch>
Date: Thu, 7 Feb 2008 22:18:25 +0100


Dear Edmond,

Thank you for a comprehensive answer.

Have a good one,

Vassili  

Edmond Offermann wrote:
> Hi Vassili,
>
> The memory allocations depend only on the size of the matrix to be
> decomposed:
>
> // A = fU fSig fV^T
> TMatrixD fU; // orthogonal matrix
> TMatrixD fV; // orthogonal matrix
> TVectorD fSig; // diagonal of diagonal matrix
>
> Sizes of these three class members are set according to the size of A:
>
> fU.ResizeTo(nrows,nrows);
> fSig.ResizeTo(ncols);
> fV.ResizeTo(nrows,ncols);
>
> So if you are decomposing matrices with the same sizes in a loop, it is
> most efficient to do
>
> TDecompSVD svd(nrows,ncols) outside the loop and a SetMatrix
> in the loop . (SetMatrix checks of course whether it has to re-adjust
> the class members ).
>
> Eddy
>
> --- Vassili Maroussov <Vassili.Maroussov_at_cern.ch> wrote:
>
>
>> Dear ROOTers,
>>
>> I'm wondering whether in the current implementation the TDecompSVD
>> structure depends only on the dimensions of the matrix to decompose,
>> or
>> on the matrix content as well (I could imagine an implementation
>> where
>> all-zero rows of a matrix are removed while constructing the
>> decomposition)?.. I mean, if I'm always working with matrices of the
>> same dimension, may I with reuse of a TDecompSVD object with
>> TDecompSVD.SetMatrix(...) to avoid memory allocations/deallocations?
>> Does the reuse make a sense, doesn't TDecompSVD.Solve(...) make
>> intensive memory allocations/deallocations? Sorry for not trying to
>> dig
>> into the code by myself, I think I can get answers quicker here :)
>>
>> Regards,
>>
>> Vassili
>>
>>
>>
>
>
Received on Thu Feb 07 2008 - 22:18:30 CET

This archive was generated by hypermail 2.2.0 : Sat Feb 09 2008 - 17:50:01 CET