Boost logo

Boost :

From: Kresimir Fresl (fresl_at_[hidden])
Date: 2005-03-10 11:03:45

Jason Hise <chaos_at_[hidden]> writes:

> I saw that boost already has a pretty impressive linear algebra suite,
> with many specialized types of matrices. Though these are all very
> useful, I was wondering if there might be room for one more type of
> matrix: one which makes each size of matrix a unique type (I did not
> see such a matrix in the docs, but please correct me if I overlooked
> it and it does already exist).

There are two fixed size matrix types, but unfortunately they are
not documented:

     template<class T, std::size_t M, std::size_t N, class L = row_major>
     class bounded_matrix;

     template<class T, std::size_t M, std::size_t N>
     class c_matrix;

Both are defined in matrix.hpp.

bounded_matrix uses bounded_array for storage:

     template<class T, std::size_t M, std::size_t N, class L>
     class bounded_matrix:
         public matrix<T, L, bounded_array<T, M * N> > { /* ... */ };

Therefore it can have row major and column major storage.

c_matrix wraps C array:

     template<class T, std::size_t N, std::size_t M>
     class c_matrix {
         // ...
         T data_ [N] [M];

Obviously, it must be row major.


Boost list run by bdawes at, gregod at, cpdaniel at, john at