Boost logo

Ublas :

From: Jerry Swan (pmxjs_at_[hidden])
Date: 2006-08-29 13:09:12


>This is very difficult to find out without knwoing what you try to do. >Please send a complete minimal example program that demonstrates this error. Below. Thanks, Jerry. -- snip ---------------------------------------------------------------------------------------- // using #define BOOST_UBLAS_USE_INTERVAL results in // g++ 3.2.3 objecting to line 269 of traits.hpp: // struct scalar_interval_type_traits : scalar_type_traits<T> { // In addition, it complains about the specializations of type_traits for // specific intervals (type_traits<boost::numeric::interval<float> > etc) // saying that they've already been instantiated. #define BOOST_UBLAS_USE_INTERVAL // If instead we comment out #define BOOST_UBLAS_USE_INTERVAL, then the compiler tries to // use the default version of scalar_traits, which then results in an error because there's // no std::abs or std::sqrt specialization for interval // (I guess it could be argued that the default version of // scalar_traits::abs() etc should have ::abs, rather then std::abs...). #include <boost/numeric/interval.hpp> #include <boost/numeric/interval/utility.hpp> #include <boost/numeric/ublas/matrix.hpp> #include <boost/numeric/ublas/traits.hpp> typedef boost::numeric::interval< double > scalar_type; ////////////////////////////////////////////////////////////////////// int main() { using namespace boost::numeric; /////////////////////////////// ublas::matrix< scalar_type > a( 3, 3 ); scalar_type abs_a00 = boost::numeric::ublas::scalar_traits< scalar_type >::abs( a( 0, 0 ) ); scalar_type sqrt_a00 = boost::numeric::ublas::scalar_traits< scalar_type >::sqrt( a( 0, 0 ) ); return 0; } ////////////////////////////////////////////////////////////////////// -- snip ---------------------------------------------------------------------------------------- >>> Georg.Baum_at_[hidden] 08/24/06 7:03 PM >>> Am Donnerstag, 24. August 2006 12:03 schrieb Jerry Swan: > g++ 3.2.3 chokes on line 269 of traits.hpp: > struct scalar_interval_type_traits : scalar_type_traits<T> { > > In addition, it complains about the specializations of type_traits for specific intervals > (type_traits<boost::numeric::interval<float> > etc) saying that they've already been instantiated. > > Is this likely to be a function of header file ordering, is it broken, or is there perhaps something else I'm doing wrong? This is very difficult to find out without knwoing what you try to do. Please send a complete minimal example program that demonstrates this error. Georg _______________________________________________ ublas mailing list ublas_at_[hidden] http://lists.boost.org/mailman/listinfo.cgi/ublas This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.