2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-18 14:32:14 +00:00

MSVC 6.0 regressions fixed.

[SVN r19567]
This commit is contained in:
Jörg Walter
2003-08-12 21:32:46 +00:00
parent 9b3731433b
commit e97d502c20
10 changed files with 92 additions and 0 deletions

View File

@@ -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");

View File

@@ -53,7 +53,11 @@ struct initialize_c_vector {
void operator () (typename c_vector_traits<T, N>::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;
}

View File

@@ -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");

View File

@@ -53,7 +53,11 @@ struct initialize_c_vector {
void operator () (typename c_vector_traits<T, N>::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<class M>
@@ -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<class M>

View File

@@ -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");

View File

@@ -53,7 +53,11 @@ struct initialize_c_vector {
void operator () (typename c_vector_traits<T, N>::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;
}

View File

@@ -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<float>, 3");

View File

@@ -53,7 +53,11 @@ struct initialize_c_vector {
void operator () (typename c_vector_traits<T, N>::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;
}

View File

@@ -1795,7 +1795,9 @@ namespace boost { namespace numeric { namespace ublas {
void swap(index_pair<V> lhs, index_pair<V> rhs) {
lhs.swap(rhs);
}
#endif
#if defined (BOOST_UBLAS_NO_MEMBER_FRIENDS) || defined (BOOST_MSVC)
template<class V>
BOOST_UBLAS_INLINE
bool operator < (const index_pair<V>& lhs, const index_pair<V>& rhs) {
@@ -1948,7 +1950,9 @@ namespace boost { namespace numeric { namespace ublas {
void swap(index_triple<M> lhs, index_triple<M> rhs) {
lhs.swap(rhs);
}
#endif
#if defined (BOOST_UBLAS_NO_MEMBER_FRIENDS) || defined (BOOST_MSVC)
template<class M>
BOOST_UBLAS_INLINE
bool operator < (const index_triple<M>& lhs, const index_triple<M>& rhs) {

View File

@@ -641,11 +641,13 @@ namespace boost { namespace numeric { namespace ublas {
a.reserve (capacity);
}
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template<class I, class T>
BOOST_UBLAS_INLINE
typename map_array<I, T>::data_reference make_reference (map_array<I, T> &a, typename map_array<I, T>::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<I, T> &a, typename std::map<I, T>::size_type capacity) {}
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template<class I, class T>
BOOST_UBLAS_INLINE
typename std::map<I, T>::mapped_type &make_reference (std::map<I, T> &a, typename std::map<I, T>::iterator it) {
return (*it).second;
}
#endif
}