Dear Pasha,
"Pasha Murat (630)840-8237 FNAL (630)859-3463 home" wrote:
>
> hi Thorsten, you're certainly making very good points. I just want to comment that
> if one doesn't care too much about the "design" issues and, understanding the
> difficulties faced by the compiler, tries to help it, in most [important practically]
> cases he can get around rather easily without using templates:
>
> - case of the Kalman filter: one needs specialized 3x3, 5x3 and 5x5 matrix classes
> which wouldn't do memory allocation dynamically (I'd also add specialized 2x2
> class)
> - matrix operations: methods like Matrix::Add(const Matrix& m1, Matrix& m2)
> and such would do the job pretty efficiently. In general it is quite clear
> that one should AND CAN stay away from creating new matrices on the fly and
> returning them by value.
these "template avoiding" strategies have as a consequence that you are
back to
the low-level programming as we all practiced it in FORTRAN/C. This is
not very helpful
if you are thinking of an all-purpose Matrix/Vector library which
doesn't know about
special applications (but this is what you finally have to provide in
ROOT).
> At the same time I really think that if we forget the issues related to the
> interpreting of the C++ code, matrix/vector operations with templated dimensions
> give us one of the very few examples where using templates [in HEP] is justified...
Well, with a bit of fantasy you will see a lot of applications in HEP
which can benefit from
templates. Just an example: a vertexing class where the number of tracks
in the
vertex are given by a template parameter has a very high potential for
optimizations
compared to a non-templated vertex class.
Goodbye,
Thorsten
---------------------------------------------------------
Dr. Thorsten Glebe <T.Glebe@mpi-hd.mpg.de>
Max-Planck-Institut für Kernphysik
Saupfercheckweg 1 Tel: +49/(0)6221/516-631
D-69117 Heidelberg Fax: +49/(0)6221/516-603
---------------------------------------------------------
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:46 MET