Fermi Physics Class Libraries Module: Linear Algebra


ZOOM LinearAlgebra

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.

Some design points of this package are


User's Guide (postscript)

User's Guide (pdf)

Design Notes (postscript)

Design Notes (pdf)

LinearAlgebra or CLHEP Matrix?

ZOOM supports both, and it is our policy NOT to recommend one over the other.


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.

ZOOM Home Page - Fermilab at Work - Fermilab Home

Mark Fischler
Last modified: July 23, 2001