
Ublas : 
From: Gunter Winkler (guwi17_at_[hidden])
Date: 20060517 05:12:02
On Wednesday 17 May 2006 05:26, Dan Elliott wrote:
> Hello,
>
> I fear that my ignorance about that guts of uBLAS will be made glaringly
> obvious by this question...
so, so ;)
> I see that the lu.hpp file has a data type permutation_matrix which
> inherits from the vector type. However, I would like to discuss the merits
> of creating a matrix permutation matrix type that would behave more like a
> matrix (e.g. matrix operators for right and left had operations).
> Permutation matrices could even fall under a larger family of
> transformation matrices!
It would be very convenient to have a transformation matrix that behaves like
a matrix. But for the simple task of solving linear equations the current
permutation_matrix is sufficient. The permutation_matrix class does not store
the mapping (old index) > (new index) but a list of swap operations needed
for inplace reordering of vectors (or matrices). Therefore we should keep
this class  maybe with a better name.
> Operations of other types against this type could have specialized
> algorithms which take advantage of their particular structure. For
> example, if T were a permutation matrix, and S were diagonal, the operation
> transpose(T) * S * T has a predictable structure as it goes from left to
> right.
This would be a very interesting extension because symmetric products are
repeatedly requested on this list. I think a new matrix_ternary_expression
class can cover all products of this type and can be dispatched to
specialized algorithms. However, I am not sure if this should be part of
ublas or at a higher level of abstraction (e.g. some glas frontend).
btw. I never used products of 3 matrices except for small (3 by 3 upto 5 by 5)
matrices. And here we could write a new class for fixed size matrices and
vectors that removes all unused load from bounded_matrix and bounded_vector.
mfg
Gunter