Boost logo

Ublas :

From: Nico Galoppo (nico_at_[hidden])
Date: 2006-11-21 11:45:39


Hi,

Often, I want to pass the triangular_type and layout_type to functions, based on
a templated matrix type, as such:

template < class TYPE, class MATRIX >
ublas::symmetric_adaptor<const MATRIX, TYPE>
symmetric(const MATRIX & A, const TYPE& uplo = TYPE())
{
   return ublas::symmetric_adaptor<const MATRIX, TYPE>(A);
}

template <typename matrix_type>
void foo(matrix_type & A)
{
        symmetric(A, matrix_type::triangular_type);
}

The above obviously doesn't work, because matrix_type::triangular_type is
private. Is there a traits mechanism available that enables such code?

--nico

-- 
nico galoppo von borries     |  address: 119 fidelity st., carrboro
comp. graphics phd. student  |           north carolina, 27510 USA
UNC, chapel hill             |  phone: +1 (919) 962-1898 (office)
                              |         +1 (919) 942-4388 (home)
                              |  email: nico at cs dot unc dot edu
                              |  homepage: http://www.ngaloppo.org