Re: TMatrix as vector

From: Victor Perevoztchikov (perev@bnl.gov)
Date: Fri Mar 03 2000 - 19:30:33 MET


Hi Nicolas,

> In some operation, I need to access very often a big TMatrix as if it
> was a vector of size GetNoElements.

to provide such method you will broke encapsulation. Your code
must not be dependent of matrix implementation inside a class.
Let say, TMatrix will be improved and sparce matrices will be added.
Then your method becomes unavailable, what leads to vialation of encapsulation.

Victor

Nicolas Produit wrote:
> 
> In some operation, I need to access very often a big TMatrix as if it
> was a vector of size GetNoElements.
> 
> In fact many operation on matrices dont really depend on the 2D
> nature of the matrix:
> -finding Maximum element of a matrix
> -addition of 2 matrix
> -zeroing a matrix
> 
> My case is convoluting two matrices.
> 
> In order to access it thru operator(i,j) I have first to compute i and j
> and then operator will just undo that operation make bondary test etc...
> If it was possible to acces a TMatrix as a vector it would improve
> vastely my performances.
> 
> I see many possibilities:
> -a method GetfElements
> -an operator [] with 1 Int_t parameter
> -an operator() with 1 Int_t parameter
> 
> Any possibilites?
> 
> By the way it would help me a lot if Double_t or even
> complex matrices where existing.
> 
> Cheers
> 
> --
> Nicolas Produit
> INTEGRAL Science Data Center    Phone:  +41 22 950 91 40
> 16, Chemin d'Ecogia             Fax:    +41 22 950 91 33
> CH-1290 Versoix                 www:    http://isdc.unige.ch/

-- 
Victor M. Perevoztchikov   perev@bnl.gov  perev@vxcern.cern.ch       
Brookhaven National Laboratory MS 510A PO Box 5000 Upton NY 11973-5000
tel office : 631-344-7894; fax 631-344-4206; home 631-345-2690



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:20 MET