Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56614 - in branches/release: boost/numeric/ublas boost/numeric/ublas/detail libs/numeric/ublas
From: guwi17_at_[hidden]
Date: 2009-10-05 18:48:30


Author: guwi17
Date: 2009-10-05 18:48:29 EDT (Mon, 05 Oct 2009)
New Revision: 56614
URL: http://svn.boost.org/trac/boost/changeset/56614

Log:
fix #3499 and fix #3501:
 * added inline to free helper functions
 * added missing concept check
 * fixed broken internal checks

Properties modified:
   branches/release/boost/numeric/ublas/ (props changed)
   branches/release/libs/numeric/ublas/ (props changed)
Text files modified:
   branches/release/boost/numeric/ublas/detail/concepts.hpp | 45 ++++++++++++++++++++++++++++++---------
   1 files changed, 34 insertions(+), 11 deletions(-)

Modified: branches/release/boost/numeric/ublas/detail/concepts.hpp
==============================================================================
--- branches/release/boost/numeric/ublas/detail/concepts.hpp (original)
+++ branches/release/boost/numeric/ublas/detail/concepts.hpp 2009-10-05 18:48:29 EDT (Mon, 05 Oct 2009)
@@ -499,6 +499,7 @@
 
         void constraints () {
             function_requires< VectorConcept<vector_type> >();
+ function_requires< DefaultConstructible<vector_type> >();
             function_requires< Mutable_VectorExpressionConcept<vector_type> >();
             size_type n (0);
             value_type t = value_type ();
@@ -579,6 +580,7 @@
 
         void constraints () {
             function_requires< MatrixConcept<matrix_type> >();
+ function_requires< DefaultConstructible<matrix_type> >();
             function_requires< Mutable_MatrixExpressionConcept<matrix_type> >();
             size_type n (0);
             value_type t = value_type ();
@@ -636,61 +638,73 @@
     T
     ZeroElement (T);
     template<>
+ BOOST_UBLAS_INLINE
     float
     ZeroElement (float) {
         return 0.f;
     }
     template<>
+ BOOST_UBLAS_INLINE
     double
     ZeroElement (double) {
         return 0.;
     }
     template<>
+ BOOST_UBLAS_INLINE
     vector<float>
     ZeroElement (vector<float>) {
         return zero_vector<float> ();
     }
     template<>
+ BOOST_UBLAS_INLINE
     vector<double>
     ZeroElement (vector<double>) {
         return zero_vector<double> ();
     }
     template<>
+ BOOST_UBLAS_INLINE
     matrix<float>
     ZeroElement (matrix<float>) {
         return zero_matrix<float> ();
     }
     template<>
+ BOOST_UBLAS_INLINE
     matrix<double>
     ZeroElement (matrix<double>) {
         return zero_matrix<double> ();
     }
     template<>
+ BOOST_UBLAS_INLINE
     std::complex<float>
     ZeroElement (std::complex<float>) {
         return std::complex<float> (0.f);
     }
     template<>
+ BOOST_UBLAS_INLINE
     std::complex<double>
     ZeroElement (std::complex<double>) {
         return std::complex<double> (0.);
     }
     template<>
+ BOOST_UBLAS_INLINE
     vector<std::complex<float> >
     ZeroElement (vector<std::complex<float> >) {
         return zero_vector<std::complex<float> > ();
     }
     template<>
+ BOOST_UBLAS_INLINE
     vector<std::complex<double> >
     ZeroElement (vector<std::complex<double> >) {
         return zero_vector<std::complex<double> > ();
     }
     template<>
+ BOOST_UBLAS_INLINE
     matrix<std::complex<float> >
     ZeroElement (matrix<std::complex<float> >) {
         return zero_matrix<std::complex<float> > ();
     }
     template<>
+ BOOST_UBLAS_INLINE
     matrix<std::complex<double> >
     ZeroElement (matrix<std::complex<double> >) {
         return zero_matrix<std::complex<double> > ();
@@ -700,41 +714,49 @@
     T
     OneElement (T);
     template<>
+ BOOST_UBLAS_INLINE
     float
     OneElement (float) {
         return 1.f;
     }
     template<>
+ BOOST_UBLAS_INLINE
     double
     OneElement (double) {
         return 1.;
     }
     template<>
+ BOOST_UBLAS_INLINE
     matrix<float>
     OneElement (matrix<float>) {
         return identity_matrix<float> ();
     }
     template<>
+ BOOST_UBLAS_INLINE
     matrix<double>
     OneElement (matrix<double>) {
         return identity_matrix<double> ();
     }
     template<>
+ BOOST_UBLAS_INLINE
     std::complex<float>
     OneElement (std::complex<float>) {
         return std::complex<float> (1.f);
     }
     template<>
+ BOOST_UBLAS_INLINE
     std::complex<double>
     OneElement (std::complex<double>) {
         return std::complex<double> (1.);
     }
     template<>
+ BOOST_UBLAS_INLINE
     matrix<std::complex<float> >
     OneElement (matrix<std::complex<float> >) {
         return identity_matrix<std::complex<float> > ();
     }
     template<>
+ BOOST_UBLAS_INLINE
     matrix<std::complex<double> >
     OneElement (matrix<std::complex<double> >) {
         return identity_matrix<std::complex<double> > ();
@@ -886,6 +908,7 @@
         }
     };
 
+ BOOST_UBLAS_INLINE
     void concept_checks () {
 
         // Allow tests to be group to keep down compiler storage requirement
@@ -1402,12 +1425,12 @@
             function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
         }
 
- function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_sum<T> > > >();
- function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_norm_1<T> > > >();
- function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_norm_2<T> > > >();
- function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_norm_inf<T> > > >();
+ function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_sum<vector<T> > > > >();
+ function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_norm_1<vector<T> > > > >();
+ function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_norm_2<vector<T> > > > >();
+ function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_norm_inf<vector<T> > > > >();
 
- function_requires< ScalarExpressionConcept<vector_scalar_binary<vector<T>, vector<T>, vector_inner_prod<T, T, T> > > >();
+ function_requires< ScalarExpressionConcept<vector_scalar_binary<vector<T>, vector<T>, vector_inner_prod<vector<T>, vector<T>, T> > > >();
 #endif
 
         // Matrix Expressions
@@ -1479,29 +1502,29 @@
         }
 
         {
- typedef matrix_vector_binary1<matrix<T>, vector<T>, matrix_vector_prod1<T, T, T> > expression_model;
+ typedef matrix_vector_binary1<matrix<T>, vector<T>, matrix_vector_prod1<matrix<T>, vector<T>, T> > expression_model;
             function_requires< VectorExpressionConcept<expression_model> >();
             function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
             function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
         }
 
         {
- typedef matrix_vector_binary2<vector<T>, matrix<T>, matrix_vector_prod2<T, T, T> > expression_model;
+ typedef matrix_vector_binary2<vector<T>, matrix<T>, matrix_vector_prod2<matrix<T>, vector<T>, T > > expression_model;
             function_requires< VectorExpressionConcept<expression_model> >();
             function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
             function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
         }
 
         {
- typedef matrix_matrix_binary<matrix<T>, matrix<T>, matrix_matrix_prod<T, T, T> > expression_model;
+ typedef matrix_matrix_binary<matrix<T>, matrix<T>, matrix_matrix_prod<matrix<T>, matrix<T>, T > > expression_model;
             function_requires< MatrixExpressionConcept<expression_model> >();
             function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
             function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
         }
 
- function_requires< ScalarExpressionConcept<matrix_scalar_unary<matrix<T>, matrix_norm_1<T> > > >();
- function_requires< ScalarExpressionConcept<matrix_scalar_unary<matrix<T>, matrix_norm_frobenius<T> > > >();
- function_requires< ScalarExpressionConcept<matrix_scalar_unary<matrix<T>, matrix_norm_inf<T> > > >();
+ function_requires< ScalarExpressionConcept<matrix_scalar_unary<matrix<T>, matrix_norm_1<vector<T> > > > >();
+ function_requires< ScalarExpressionConcept<matrix_scalar_unary<matrix<T>, matrix_norm_frobenius<vector<T> > > > >();
+ function_requires< ScalarExpressionConcept<matrix_scalar_unary<matrix<T>, matrix_norm_inf<vector<T> > > > >();
 #endif
 
 #ifdef EXTERNAL


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk