IMENGINE Design Notes
The class diagram below shows most of the classes in the imengine package:
- two-line border: abstract base class (at least one unimplemented virtual method)
- red border: planned but not yet implemented
- gray fill: class is in namespace imengine::models
- black arrow: "is a" relationship (public inheritance)
- blue arrow: "has a" relationship (private member data, usually via a boost shared pointer)
Classes missing from here include the string-based model parser (ModelBuilder, based on boost::spirit), error handling classes (RuntimeError, InvalidValue), and the caching support classes described below.
Flux density models distribute their expensive computations across a number of objects at runtime. In applications where the same model is used to generate images repeatedly (in a likelihood fit, for example) but with varying model parameter values, a considerable speed up can be achieved by only re-doing parts of the calculation that have changed since the last image was generated (similar to the philosophy of the GNU make program). For example, if only psf parameters are changed, then the source model FFT does not need to be re-computed. The package supports the necessary caching via two classes (Observer, ObserverDelegate) that allow automatically track parameter changes throughout the model's expression tree and only perform necessary computations each time the AbsImageEngine::generate method is called.