Fixed size vectors

#include <gandalf/linalg/3vector.h>for double precision, or

#include <gandalf/linalg/3vectorf.h>for single precision 3-vectors. A double precision 3-vector is defined as

typedef struct Gan_Vector3 { double x, y, z; } Gan_Vector3, Gan_Vector3_dand a single precision 3-vector as

typedef struct Gan_Vector3_f { float x, y, z; } Gan_Vector3_f;

Most of the routines below return a pointer to the result vector/matrix. This may be used as an argument to another routine, although care must be taken with macros as regards multiple evaluation. The routines are very safe, because everything using fixed size vectors & matrices can be written to involve only automatic variables with no dynamic allocation, and the only failure modes are arithmetic overflow (Gandalf does not check for this). The few exceptions are noted in the text.

- Creating and accessing fixed size vectors
- Fixed size vector addition
- Fixed size vector subtraction
- Rescaling a fixed size vector
- Fixed size vector products
- Fixed size vector file I/O
- Conversion from general to fixed size vector
- Single precision fixed size vectors
- Other types of fixed size vector
- Other sizes of fixed size vector
- Setting/extracting parts of fixed size vectors

2006-03-17