Boost logo

Ublas :

From: Michael Stevens (mail_at_[hidden])
Date: 2005-07-08 14:44:59

On Friday 08 July 2005 09:54, Gunter Winkler wrote:
> I'd like to guess, what the problem is without running the compiler:
> You tried to do a debug build of a matrix containing integers. There is a
> type_traits missing that defines 'real_type' for any integer type, but this
> trait is needed by some debug checks (Should we add this?).
> As a quick&dirty fix you can uncomment the lines 64-65:
> typedef T real_type;
> typedef T precision_type;
> in traits.hpp.

The type_traits thing is rather ugly. At the moment you need to define the
type_traits yourself for ANY type other then float and complex types.

In would be nice to provide a general default for all types. This cannot be
done correctly for all types. There are two problems.

1. precision_type, there is no way of knowing what the correct precision_type
is for a given type. precision_type is only used by prec_prod to whole
intermidiate calculations. I think this is a design mistake. The type used by
prec_prod should be given as a template argument. This would be more

2. the norms (norm_X) are dependant on the type. In particular complex types
have different definitions.

However it does seem possible to provide a default definition for simple
types. This should cover all the integer type. In this case the
precision_type would be the real_type, but that would not be so bad.

I would like to try this (on HEAD) ASAP so we can get some wider testing. I
know it was avoided originally as it caused some compiler problems.

> On Friday 08 July 2005 09:13, M.Deij_at_[hidden] wrote:
> > Hello,
> >
> > I've got a problem compiling the next example:
> >
> > sparse_matrix<unsigned> *m, *n, *r;
> > m = new sparse_matrix<unsigned>(3,3);
> > n = new sparse_matrix<unsigned>(3,3);
> > r = new sparse_matrix<unsigned>(3,3);
> sparse_matrix was recently renamed to mapped_matrix. You should try the CVS
> version of ublas.
> > I'm not sure if it's a 64-bit problem (P4 vs Opteron) or a gcc version
> > problem. Anybody got any ideas? The errors I get are listed below:

I can't see how it could compile with GCC 3.2.3. This would only be possible
is the build configuration was different so BOOST_UBLAS_STRICT_MATRIX_SPARSE
was not set.


Michael Stevens Systems Engineering
34128 Kassel, Germany
Phone/Fax: +49 561 5218038
Navigation Systems, Estimation  and
                 Bayesian Filtering