
"Martin Slater" <mslater@netspace.net.au> wrote in message news:4514AB08.5020406@netspace.net.au...
Olivier Grant wrote:
Well due to the fact that floats are represented on 4 bytes, there shouldn't be any padding involved. Padding normally occures when certain member variables of a structure require certain alignment constraints or just for efficiency, but this shouldn't occur with a vector class (at least that is my understanding).
Why assume the type's will be floats ? There's a number of situations where doubles, fixed point or some lossless representation would be preferable, any solution that doesn't allow this isn't a serious vector library imo. Typedefs though should be provided for all the common cases (floats / doubles) for ease of use.
FWIW a boost::array is a valid fusion sequence, as OTOH is a tuple making Fusion: http://spirit.sourceforge.net/dl_more/fusion_v2/libs/fusion/doc/html/index.h... a good choice as a basis for working with vectors and matrices of arbitrary types. With a boost::array as the element type of a matrix it is relatively trivial to access a fusion style matrix via the familiar matrix[R][C] syntax. Fusion also provides very powerful compile time ( and run time) facilities and is well worth investigating for anyone contemplating a state of the art linear algebra library. regards Andy Little