Boost logo

Ublas :

Subject: Re: [ublas] novice question. how to use ublas bindings
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2009-08-21 06:09:33

Luca Sbardella wrote:
> I went to bindings/traits/ublas_matrix.hpp and in the struct matrix_detail_traits the uplo_type is not defined.
> Am I missing something?

uplo_type is used to indicate which part of a symmetric or hermitian matrix is stored. It should be either upper_t or lower_t. The file matrix_traits.hpp contains the following:

  // upper/lower non-unit/unit triangular type tags
  struct upper_t {};
  struct lower_t {};
  struct unit_upper_t {};
  struct unit_lower_t {};

I have to admit that I'm not aware of any special triangular matrix types, but there are special matrix types for symmetric and hermitian matrix types. So it's possible that including traits/ublas_symmetric.hpp and traits/ublas_hermitian.hpp will solve your problem.

The uplo_type is only meaningful for symmetric, hermitian or triangular matrix types. I believe that only symmetric and hermitian matrix types are directly supported by ublas, so these type tags are only used for symmetric and hermitian matrices. So including traits/ublas_symmetric.hpp and traits/ublas_hermitian.hpp in the "client" code (i.e. the test case) and using the corresponding symmetric/hermitian matrix classes or matrix class adaptors from ublas should help with this problem.