|
Ublas : |
Subject: Re: [ublas] bounded_vector redundant storage of size. (is this a bug?)
From: Gunter Winkler (guwi17_at_[hidden])
Date: 2008-10-26 15:42:10
Am Freitag, 24. Oktober 2008 17:09 schrieb johanngoetz:
> for small vectors (geometry vectors is what I have in mind) the
> bounded_vector and bounded_matrix look promising. Indeed, if I was
> only dealing with a handful of vectors at a time, this would be
> ideal. However, I am creating a fieldmap (of a magnetic field, say)
> which maps 3D vectors (position) to 3D vectors (the field).
Actually - uBlas is not the best choice if you are looking for (small)
fixed size vectors and matrices. uBlas is optimized for dynamic sizes.
Thus bounded_storage provides a limited but still dynamic storage on
the stack. In order to efficiently support fixed size object we need a
fixed_storage class and real fixed_vector and fixed_matrix.
Note: In order to store a lot of 3D-vectors you should use a 3-column
row major matrix. Thus you can easily express mappings as matrix vector
operations.
btw. you should have a look at tvmet:
http://tvmet.sourceforge.net/
mfg
Gunter