The ZOOM LinearAlgebra package is meant to provide matrix operations without undue inefficency when the matrices are moderately small. It also allows for flexible changing of matrix shapes, and supports the concept of a "model" to represent specialized matrices.

This package provides: For example, SymmetricMatrix is a model to represent symmetric matrices, taking advantage of the symmetry wherever possible.meet the needs of Run II (D0 and CDF) offline (and possibly higher-level online) code for a unified message logging and statistics facility.

- The usual matrix arithmetic operations
- INversion and solving
- Eigen-analysis
- Models for SymmetricMatrix and various small square matrices up to 6x6
- A prescription for supporters to add new matrix models (for example SymmetricMat5x5 or OrthogonalMatrix) if beneficial

Some design points of this package are

- The "data-model" concept is realized via a
*letter-envelope*idiom. The Matrix itself does not contain its data; it contains a pointer to an object that holds its data and knows how to implement matrix operations. This allows for flexibility in altering data models. - "Lazy evaluation" to avoid unnecessary operations.
- Indirect accessor methods to support a uniform element access syntax despite potentially different actual data representations.
- "Double-dispatching" for methods, which allows the implementation to take advantage of specialized properties of all the matrices in an expression.

User's Guide (postscript)

User's Guide (pdf)

Design Notes (postscript)

Design Notes (pdf)

The LinearAlgebra package overlaps in funtionallity with the CLHEP Matrix package. In fact, although the syntax in CLHEP may in some places look contrived (for instance, M[a][b] is zero-based while M(a,b) is one-based!) both packages implement all the usual (and most of the esoteric) linear algebra algortihms one is likely to need. There is littel to choose between them on that score.

Although LinearAlgebra has a number of potential optimization advantages and flexibility features, in the end -- for smallish matrices such as are used in particle tracking -- the indirection used to achieve this flexibility itslef has a speed cost. In general, the CLHEP routines are at least as fast, and in the specific case of 5x5 or 6x6 symmetric positive definite matrix inversion the ZOOM support group has tweaked CLHEP to be noticeably faster. (Specialized Symmetric55 and Symmetric66 models in the LinearAlgebra package can be created to even matters on this score, but have not been created to date.)

Overall, the choice is pretty much a matter of personal preference (or more accurately, preference of the experiment, since mixing the two within one experiment is probably poor form). However, there is one case where CLHEP should be prefered:

Code which interfaces tightly with Geant4 may prefer to use CLHEP Matrix (which Geant4 also uses) for its Matrix objects.

Mark Fischler Last modified: July 23, 2001