From e97d502c201211186b7171a559b92eb4e569274e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Walter?= Date: Tue, 12 Aug 2003 21:32:46 +0000 Subject: [PATCH] MSVC 6.0 regressions fixed. [SVN r19567] --- bench1/bench1.cpp | 4 ++++ bench1/bench1.hpp | 16 +++++++++++++++ bench2/bench2.cpp | 4 ++++ bench2/bench2.hpp | 20 +++++++++++++++++++ bench3/bench3.cpp | 4 ++++ bench3/bench3.hpp | 16 +++++++++++++++ bench4/bench4.cpp | 4 ++++ bench4/bench4.hpp | 16 +++++++++++++++ include/boost/numeric/ublas/storage.hpp | 4 ++++ .../boost/numeric/ublas/storage_sparse.hpp | 4 ++++ 10 files changed, 92 insertions(+) diff --git a/bench1/bench1.cpp b/bench1/bench1.cpp index 28b90f9c..f004b42d 100644 --- a/bench1/bench1.cpp +++ b/bench1/bench1.cpp @@ -136,7 +136,11 @@ int main (int argc, char *argv []) { int scale = 1; if (argc > 1) +#ifndef BOOST_NO_STDC_NAMESPACE scale = std::atoi (argv [1]); +#else + scale = ::atoi (argv [1]); +#endif #ifdef USE_FLOAT header ("float, 3"); diff --git a/bench1/bench1.hpp b/bench1/bench1.hpp index 350fb94e..1a0e6bbc 100644 --- a/bench1/bench1.hpp +++ b/bench1/bench1.hpp @@ -53,7 +53,11 @@ struct initialize_c_vector { void operator () (typename c_vector_traits::type &v) { #endif for (int i = 0; i < N; ++ i) +#ifndef BOOST_NO_STDC_NAMESPACE v [i] = std::rand () * 1.f; +#else + v [i] = ::rand () * 1.f; +#endif // v [i] = 0.f; } }; @@ -62,7 +66,11 @@ BOOST_UBLAS_INLINE void initialize_vector (V &v) { int size = v.size (); for (int i = 0; i < size; ++ i) +#ifndef BOOST_NO_STDC_NAMESPACE v [i] = std::rand () * 1.f; +#else + v [i] = ::rand () * 1.f; +#endif // v [i] = 0.f; } @@ -76,7 +84,11 @@ struct initialize_c_matrix { #endif for (int i = 0; i < N; ++ i) for (int j = 0; j < M; ++ j) +#ifndef BOOST_NO_STDC_NAMESPACE m [i] [j] = std::rand () * 1.f; +#else + m [i] [j] = ::rand () * 1.f; +#endif // m [i] [j] = 0.f; } }; @@ -87,7 +99,11 @@ void initialize_matrix (M &m) { int size2 = m.size2 (); for (int i = 0; i < size1; ++ i) for (int j = 0; j < size2; ++ j) +#ifndef BOOST_NO_STDC_NAMESPACE m (i, j) = std::rand () * 1.f; +#else + m (i, j) = ::rand () * 1.f; +#endif // m (i, j) = 0.f; } diff --git a/bench2/bench2.cpp b/bench2/bench2.cpp index bcf3a28c..ca0594b5 100644 --- a/bench2/bench2.cpp +++ b/bench2/bench2.cpp @@ -138,7 +138,11 @@ int main (int argc, char *argv []) { int scale = 1; if (argc > 1) +#ifndef BOOST_NO_STDC_NAMESPACE scale = std::atoi (argv [1]); +#else + scale = ::atoi (argv [1]); +#endif #ifdef USE_FLOAT header ("float, 3"); diff --git a/bench2/bench2.hpp b/bench2/bench2.hpp index 8b73ddc9..7a78b62a 100644 --- a/bench2/bench2.hpp +++ b/bench2/bench2.hpp @@ -53,7 +53,11 @@ struct initialize_c_vector { void operator () (typename c_vector_traits::type &v) { #endif for (int i = 0; i < N; ++ i) +#ifndef BOOST_NO_STDC_NAMESPACE v [i] = std::rand () * 1.f; +#else + v [i] = ::rand () * 1.f; +#endif // v [i] = 0.f; } }; @@ -62,7 +66,11 @@ BOOST_UBLAS_INLINE void initialize_vector (V &v) { int size = v.size (); for (int i = 0; i < size; ++ i) +#ifndef BOOST_NO_STDC_NAMESPACE v [i] = std::rand () * 1.f; +#else + v [i] = ::rand () * 1.f; +#endif // v [i] = 0.f; } @@ -76,7 +84,11 @@ struct initialize_c_matrix { #endif for (int i = 0; i < N; ++ i) for (int j = 0; j < M; ++ j) +#ifndef BOOST_NO_STDC_NAMESPACE m [i] [j] = std::rand () * 1.f; +#else + m [i] [j] = ::rand () * 1.f; +#endif // m [i] [j] = 0.f; } }; @@ -87,7 +99,11 @@ void initialize_matrix (M &m, ublas::row_major_tag) { int size2 = m.size2 (); for (int i = 0; i < size1; ++ i) for (int j = 0; j < size2; ++ j) +#ifndef BOOST_NO_STDC_NAMESPACE m (i, j) = std::rand () * 1.f; +#else + m (i, j) = ::rand () * 1.f; +#endif // m (i, j) = 0.f; } template @@ -97,7 +113,11 @@ void initialize_matrix (M &m, ublas::column_major_tag) { int size2 = m.size2 (); for (int j = 0; j < size2; ++ j) for (int i = 0; i < size1; ++ i) +#ifndef BOOST_NO_STDC_NAMESPACE m (i, j) = std::rand () * 1.f; +#else + m (i, j) = ::rand () * 1.f; +#endif // m (i, j) = 0.f; } template diff --git a/bench3/bench3.cpp b/bench3/bench3.cpp index efe9a163..67721b25 100644 --- a/bench3/bench3.cpp +++ b/bench3/bench3.cpp @@ -136,7 +136,11 @@ int main (int argc, char *argv []) { int scale = 1; if (argc > 1) +#ifndef BOOST_NO_STDC_NAMESPACE scale = std::atoi (argv [1]); +#else + scale = ::atoi (argv [1]); +#endif #ifdef USE_FLOAT header ("float, 3"); diff --git a/bench3/bench3.hpp b/bench3/bench3.hpp index fd7bcecc..4275c9b9 100644 --- a/bench3/bench3.hpp +++ b/bench3/bench3.hpp @@ -53,7 +53,11 @@ struct initialize_c_vector { void operator () (typename c_vector_traits::type &v) { #endif for (int i = 0; i < N; ++ i) +#ifndef BOOST_NO_STDC_NAMESPACE v [i] = std::rand () * 1.f; +#else + v [i] = ::rand () * 1.f; +#endif // v [i] = 0.f; } }; @@ -62,7 +66,11 @@ BOOST_UBLAS_INLINE void initialize_vector (V &v) { int size = v.size (); for (int i = 0; i < size; ++ i) +#ifndef BOOST_NO_STDC_NAMESPACE v [i] = std::rand () * 1.f; +#else + v [i] = ::rand () * 1.f; +#endif // v [i] = 0.f; } @@ -76,7 +84,11 @@ struct initialize_c_matrix { #endif for (int i = 0; i < N; ++ i) for (int j = 0; j < M; ++ j) +#ifndef BOOST_NO_STDC_NAMESPACE m [i] [j] = std::rand () * 1.f; +#else + m [i] [j] = ::rand () * 1.f; +#endif // m [i] [j] = 0.f; } }; @@ -87,7 +99,11 @@ void initialize_matrix (M &m) { int size2 = m.size2 (); for (int i = 0; i < size1; ++ i) for (int j = 0; j < size2; ++ j) +#ifndef BOOST_NO_STDC_NAMESPACE m (i, j) = std::rand () * 1.f; +#else + m (i, j) = ::rand () * 1.f; +#endif // m (i, j) = 0.f; } diff --git a/bench4/bench4.cpp b/bench4/bench4.cpp index b6cb03a3..816de541 100644 --- a/bench4/bench4.cpp +++ b/bench4/bench4.cpp @@ -144,7 +144,11 @@ int main (int argc, char *argv []) { int scale = 1; if (argc > 1) +#ifndef BOOST_NO_STDC_NAMESPACE scale = std::atoi (argv [1]); +#else + scale = ::atoi (argv [1]); +#endif #ifdef USE_FLOAT header ("boost::numeric::interval, 3"); diff --git a/bench4/bench4.hpp b/bench4/bench4.hpp index 33633485..191226b9 100644 --- a/bench4/bench4.hpp +++ b/bench4/bench4.hpp @@ -53,7 +53,11 @@ struct initialize_c_vector { void operator () (typename c_vector_traits::type &v) { #endif for (int i = 0; i < N; ++ i) +#ifndef BOOST_NO_STDC_NAMESPACE v [i] = std::rand () * 1.f; +#else + v [i] = ::rand () * 1.f; +#endif // v [i] = 0.f; } }; @@ -62,7 +66,11 @@ BOOST_UBLAS_INLINE void initialize_vector (V &v) { int size = v.size (); for (int i = 0; i < size; ++ i) +#ifndef BOOST_NO_STDC_NAMESPACE v [i] = std::rand () * 1.f; +#else + v [i] = ::rand () * 1.f; +#endif // v [i] = 0.f; } @@ -76,7 +84,11 @@ struct initialize_c_matrix { #endif for (int i = 0; i < N; ++ i) for (int j = 0; j < M; ++ j) +#ifndef BOOST_NO_STDC_NAMESPACE m [i] [j] = std::rand () * 1.f; +#else + m [i] [j] = ::rand () * 1.f; +#endif // m [i] [j] = 0.f; } }; @@ -87,7 +99,11 @@ void initialize_matrix (M &m) { int size2 = m.size2 (); for (int i = 0; i < size1; ++ i) for (int j = 0; j < size2; ++ j) +#ifndef BOOST_NO_STDC_NAMESPACE m (i, j) = std::rand () * 1.f; +#else + m (i, j) = ::rand () * 1.f; +#endif // m (i, j) = 0.f; } diff --git a/include/boost/numeric/ublas/storage.hpp b/include/boost/numeric/ublas/storage.hpp index c23c4739..cbad73e9 100644 --- a/include/boost/numeric/ublas/storage.hpp +++ b/include/boost/numeric/ublas/storage.hpp @@ -1795,7 +1795,9 @@ namespace boost { namespace numeric { namespace ublas { void swap(index_pair lhs, index_pair rhs) { lhs.swap(rhs); } +#endif +#if defined (BOOST_UBLAS_NO_MEMBER_FRIENDS) || defined (BOOST_MSVC) template BOOST_UBLAS_INLINE bool operator < (const index_pair& lhs, const index_pair& rhs) { @@ -1948,7 +1950,9 @@ namespace boost { namespace numeric { namespace ublas { void swap(index_triple lhs, index_triple rhs) { lhs.swap(rhs); } +#endif +#if defined (BOOST_UBLAS_NO_MEMBER_FRIENDS) || defined (BOOST_MSVC) template BOOST_UBLAS_INLINE bool operator < (const index_triple& lhs, const index_triple& rhs) { diff --git a/include/boost/numeric/ublas/storage_sparse.hpp b/include/boost/numeric/ublas/storage_sparse.hpp index 7c8e322f..17c6c0d8 100644 --- a/include/boost/numeric/ublas/storage_sparse.hpp +++ b/include/boost/numeric/ublas/storage_sparse.hpp @@ -641,11 +641,13 @@ namespace boost { namespace numeric { namespace ublas { a.reserve (capacity); } +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template BOOST_UBLAS_INLINE typename map_array::data_reference make_reference (map_array &a, typename map_array::iterator it) { return reference (a, it); } +#endif // Some helpers for std::map @@ -653,11 +655,13 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_INLINE void reserve (std::map &a, typename std::map::size_type capacity) {} +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template BOOST_UBLAS_INLINE typename std::map::mapped_type &make_reference (std::map &a, typename std::map::iterator it) { return (*it).second; } +#endif }