Re: [ROOT] matrix inversion class; comments please

From: George A. Heintzelman (gah@bnl.gov)
Date: Tue Dec 12 2000 - 17:08:38 MET


> Hi George,
> 
> The efficiency issue (TArrayD vs. Double_t *) will be resolved quickly later
> this week by some profiling. I do remember from similar checks that
> the difference was noticable, in particular the boundary checking. Anyhow,
> I will try to get more quantitative.

If you use operator[] or At() in the inner loop, you could definitely 
see something, particularly in a less-optimized compilation mode (a 
good optimizer will probably be able to observe that the value of size 
is not changing in the loop and do the check only once or twice at the 
edge conditions). I note that while ROOT does not provide the 
equivalent of an UncheckedAt() function for the TArrayD (would probably 
be a nice addition), it's not all THAT hard to evade the checks, since 
TArrayD does give you unfettered access to its internals with 
GetArray() (1). So if you need efficiency in your inner loop, just grab 
the array afterwards and index off that.

(1) Could ROOT at least change the overloading of this operator so that 
GetArray() const returns a const Double_t *, not a Double_t *, as well 
as having Double_t * GetArray()?

George Heintzelman
gah@bnl.gov



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