From 48fe48d4fe235e0976181e77a123bf20a3e04aee Mon Sep 17 00:00:00 2001 From: Gunter Winkler Date: Sun, 4 Oct 2009 19:27:34 +0000 Subject: [PATCH] see #3501: Reusing concepts from different compile units yields multiple defined symbols * added BOOST_UBLAS_INLINE macros to requested locations --- .../boost/numeric/ublas/detail/concepts.hpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/boost/numeric/ublas/detail/concepts.hpp b/include/boost/numeric/ublas/detail/concepts.hpp index 0bf2ba8a..ce99744b 100644 --- a/include/boost/numeric/ublas/detail/concepts.hpp +++ b/include/boost/numeric/ublas/detail/concepts.hpp @@ -638,61 +638,73 @@ namespace boost { namespace numeric { namespace ublas { 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 ZeroElement (vector) { return zero_vector (); } template<> + BOOST_UBLAS_INLINE vector ZeroElement (vector) { return zero_vector (); } template<> + BOOST_UBLAS_INLINE matrix ZeroElement (matrix) { return zero_matrix (); } template<> + BOOST_UBLAS_INLINE matrix ZeroElement (matrix) { return zero_matrix (); } template<> + BOOST_UBLAS_INLINE std::complex ZeroElement (std::complex) { return std::complex (0.f); } template<> + BOOST_UBLAS_INLINE std::complex ZeroElement (std::complex) { return std::complex (0.); } template<> + BOOST_UBLAS_INLINE vector > ZeroElement (vector >) { return zero_vector > (); } template<> + BOOST_UBLAS_INLINE vector > ZeroElement (vector >) { return zero_vector > (); } template<> + BOOST_UBLAS_INLINE matrix > ZeroElement (matrix >) { return zero_matrix > (); } template<> + BOOST_UBLAS_INLINE matrix > ZeroElement (matrix >) { return zero_matrix > (); @@ -702,41 +714,49 @@ namespace boost { namespace numeric { namespace ublas { 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 OneElement (matrix) { return identity_matrix (); } template<> + BOOST_UBLAS_INLINE matrix OneElement (matrix) { return identity_matrix (); } template<> + BOOST_UBLAS_INLINE std::complex OneElement (std::complex) { return std::complex (1.f); } template<> + BOOST_UBLAS_INLINE std::complex OneElement (std::complex) { return std::complex (1.); } template<> + BOOST_UBLAS_INLINE matrix > OneElement (matrix >) { return identity_matrix > (); } template<> + BOOST_UBLAS_INLINE matrix > OneElement (matrix >) { return identity_matrix > (); @@ -888,6 +908,7 @@ namespace boost { namespace numeric { namespace ublas { } }; + BOOST_UBLAS_INLINE void concept_checks () { // Allow tests to be group to keep down compiler storage requirement