Next: Coordinate pair ordering
Up: Conventions and style
Previous: Variable argument list functions
Contents
Another important design feature of Gandalf is the ability of many Gandalf
objects to dynamically modify themselves. Thus Gandalf matrices, vectors and
images can be redefined at any time to a new type and/or size.
This feature has many benefits, among which are:
- Results of computations may be overwritten in-place on the input
arguments, in many cases without any memory or computational overhead.
For instance, the Cholesky factorisation of a positive-definite
symmetric matrix is a lower triangular matrix factor. In Gandalf
the operation can be performed in-place on the symmetric matrix
input argument, producing a lower triangular matrix.
See the function gan_squmat_cholesky_i().
- The same structure can be used to store the results of several
computations, whether or not the sizes and types of the output
results vary. This saves many calls to malloc() and free().
2006-03-17