Re: TMatrix as vector

From: Nicolas Produit (Nicolas.Produit@obs.unige.ch)
Date: Mon Mar 06 2000 - 10:12:48 MET


Hi Victor,

> 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.

I dont think that providing overloading of 
Double_t& operator[](Int_t i)
and
Double_t operator[](Int_t i) const

on TMatrix to fetch or store a value in a 2 D matrix
at place (i/fCols,i%fCols)
would break encapsulation.

I agree that method GetfElement is, it is why I prefer [].

For Eddy,

thanks a lot for the suggestion. But I think your suggestion
is actually a fancy way of doing a copy to TArray, I would rather
have a solution not involving copying. 
Anyway I can perhaps use your trick in some case.


-- 
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/



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