Subject: Re: [ublas] Test results for getri and getrf
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2009-03-08 16:59:03
Rutger ter Borg wrote:
> I think it is, indeed. The expression
> std::max( 1, traits::matrix_num_columns(a) );
> is failing because of a comparison of std::ptrdiff_t and int. On my
> platform, integer_t is int, which causes a
> std::max( static_cast<integer_t>(1), traits::matrix_num_columns(a) );
> to fail as well.
You could write it as
std::max<integer_t>( 1, traits::matrix_num_columns(a) );
if you want to have the result to have the type integer_t. If you want to have std::ptrdiff_t as result, you can write
std::max<std::ptrdiff_t>( 1, traits::matrix_num_columns(a) );
> I see std::ptrdiff_t is hardcoded in matrix_traits.
> Shouldn't these functions return integer_t instead of std::ptrdiff_t?
No, std::ptrdiff_t is a very good type in this case. The type integer_t is just the type that the user told FORTRAN to use for integer. So umfpack and other a c-libraries would not be happy when integer_t occurs in their interface.