|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r64857 - trunk/boost/numeric/ublas/detail
From: david.bellot_at_[hidden]
Date: 2010-08-16 18:11:09
Author: david.bellot
Date: 2010-08-16 18:11:08 EDT (Mon, 16 Aug 2010)
New Revision: 64857
URL: http://svn.boost.org/trac/boost/changeset/64857
Log:
applied patch from #4410
Text files modified:
trunk/boost/numeric/ublas/detail/matrix_assign.hpp | 61 +++++++++++++++++++++------------------
1 files changed, 33 insertions(+), 28 deletions(-)
Modified: trunk/boost/numeric/ublas/detail/matrix_assign.hpp
==============================================================================
--- trunk/boost/numeric/ublas/detail/matrix_assign.hpp (original)
+++ trunk/boost/numeric/ublas/detail/matrix_assign.hpp 2010-08-16 18:11:08 EDT (Mon, 16 Aug 2010)
@@ -13,6 +13,7 @@
#ifndef _BOOST_UBLAS_MATRIX_ASSIGN_
#define _BOOST_UBLAS_MATRIX_ASSIGN_
+#include <boost/numeric/ublas/traits.hpp>
// Required for make_conformant storage
#include <vector>
@@ -90,7 +91,7 @@
break;
} else if (compare > 0) {
if (conformant_restrict_type::other (it2e.index1 (), it2e.index2 ()))
- if (*it2e != value_type/*zero*/())
+ if (static_cast<value_type>(*it2e) != value_type/*zero*/())
index.push_back (std::pair<size_type, size_type> (it2e.index1 (), it2e.index2 ()));
++ it2e;
if (it2e != it2e_end)
@@ -102,7 +103,7 @@
}
while (it2e != it2e_end) {
if (conformant_restrict_type::other (it2e.index1 (), it2e.index2 ()))
- if (*it2e != value_type/*zero*/())
+ if (static_cast<value_type>(*it2e) != value_type/*zero*/())
index.push_back (std::pair<size_type, size_type> (it2e.index1 (), it2e.index2 ()));
++ it2e;
}
@@ -119,7 +120,7 @@
#endif
while (it2e != it2e_end) {
if (conformant_restrict_type::other (it2e.index1 (), it2e.index2 ()))
- if (*it2e != value_type/*zero*/())
+ if (static_cast<value_type>(*it2e) != value_type/*zero*/())
index.push_back (std::pair<size_type, size_type> (it2e.index1 (), it2e.index2 ()));
++ it2e;
}
@@ -136,7 +137,7 @@
#endif
while (it2e != it2e_end) {
if (conformant_restrict_type::other (it2e.index1 (), it2e.index2 ()))
- if (*it2e != value_type/*zero*/())
+ if (static_cast<value_type>(*it2e) != value_type/*zero*/())
index.push_back (std::pair<size_type, size_type> (it2e.index1 (), it2e.index2 ()));
++ it2e;
}
@@ -193,7 +194,7 @@
break;
} else if (compare > 0) {
if (conformant_restrict_type::other (it1e.index1 (), it1e.index2 ()))
- if (*it1e != value_type/*zero*/())
+ if (static_cast<value_type>(*it1e) != value_type/*zero*/())
index.push_back (std::pair<size_type, size_type> (it1e.index1 (), it1e.index2 ()));
++ it1e;
if (it1e != it1e_end)
@@ -205,7 +206,7 @@
}
while (it1e != it1e_end) {
if (conformant_restrict_type::other (it1e.index1 (), it1e.index2 ()))
- if (*it1e != value_type/*zero*/())
+ if (static_cast<value_type>(*it1e) != value_type/*zero*/())
index.push_back (std::pair<size_type, size_type> (it1e.index1 (), it1e.index2 ()));
++ it1e;
}
@@ -222,7 +223,7 @@
#endif
while (it1e != it1e_end) {
if (conformant_restrict_type::other (it1e.index1 (), it1e.index2 ()))
- if (*it1e != value_type/*zero*/())
+ if (static_cast<value_type>(*it1e) != value_type/*zero*/())
index.push_back (std::pair<size_type, size_type> (it1e.index1 (), it1e.index2 ()));
++ it1e;
}
@@ -239,7 +240,7 @@
#endif
while (it1e != it1e_end) {
if (conformant_restrict_type::other (it1e.index1 (), it1e.index2 ()))
- if (*it1e != value_type/*zero*/())
+ if (static_cast<value_type>(*it1e) != value_type/*zero*/())
index.push_back (std::pair<size_type, size_type> (it1e.index1 (), it1e.index2 ()));
++ it1e;
}
@@ -636,7 +637,8 @@
template<template <class T1, class T2> class F, class R, class M, class E>
// BOOST_UBLAS_INLINE This function seems to be big. So we do not let the compiler inline it.
void matrix_assign (M &m, const matrix_expression<E> &e, packed_proxy_tag, row_major_tag) {
- typedef F<typename M::iterator2::reference, typename E::value_type> functor_type;
+ typedef typename matrix_traits<E>::value_type expr_value_type;
+ typedef F<typename M::iterator2::reference, expr_value_type> functor_type;
// R unnecessary, make_conformant not required
typedef typename M::difference_type difference_type;
typedef typename M::value_type value_type;
@@ -677,7 +679,7 @@
#endif
difference_type size2 (it2_end - it2);
while (-- size2 >= 0)
- functor_type::apply (*it2, value_type/*zero*/()), ++ it2;
+ functor_type::apply (*it2, expr_value_type/*zero*/()), ++ it2;
++ it1;
}
} else {
@@ -717,7 +719,7 @@
it2_size -= size2;
if (!functor_type::computed) {
while (-- size2 >= 0) // zeroing
- functor_type::apply (*it2, value_type/*zero*/()), ++ it2;
+ functor_type::apply (*it2, expr_value_type/*zero*/()), ++ it2;
} else {
it2 += size2;
}
@@ -732,7 +734,7 @@
size2 = it2_size;
if (!functor_type::computed) {
while (-- size2 >= 0) // zeroing
- functor_type::apply (*it2, value_type/*zero*/()), ++ it2;
+ functor_type::apply (*it2, expr_value_type/*zero*/()), ++ it2;
} else {
it2 += size2;
}
@@ -750,7 +752,7 @@
#endif
difference_type size2 (it2_end - it2);
while (-- size2 >= 0)
- functor_type::apply (*it2, value_type/*zero*/()), ++ it2;
+ functor_type::apply (*it2, expr_value_type/*zero*/()), ++ it2;
++ it1;
}
} else {
@@ -765,7 +767,8 @@
template<template <class T1, class T2> class F, class R, class M, class E>
// BOOST_UBLAS_INLINE This function seems to be big. So we do not let the compiler inline it.
void matrix_assign (M &m, const matrix_expression<E> &e, packed_proxy_tag, column_major_tag) {
- typedef F<typename M::iterator1::reference, typename E::value_type> functor_type;
+ typedef typename matrix_traits<E>::value_type expr_value_type;
+ typedef F<typename M::iterator1::reference, expr_value_type> functor_type;
// R unnecessary, make_conformant not required
typedef typename M::difference_type difference_type;
typedef typename M::value_type value_type;
@@ -806,7 +809,7 @@
#endif
difference_type size1 (it1_end - it1);
while (-- size1 >= 0)
- functor_type::apply (*it1, value_type/*zero*/()), ++ it1;
+ functor_type::apply (*it1, expr_value_type/*zero*/()), ++ it1;
++ it2;
}
} else {
@@ -846,7 +849,7 @@
it1_size -= size1;
if (!functor_type::computed) {
while (-- size1 >= 0) // zeroing
- functor_type::apply (*it1, value_type/*zero*/()), ++ it1;
+ functor_type::apply (*it1, expr_value_type/*zero*/()), ++ it1;
} else {
it1 += size1;
}
@@ -861,7 +864,7 @@
size1 = it1_size;
if (!functor_type::computed) {
while (-- size1 >= 0) // zeroing
- functor_type::apply (*it1, value_type/*zero*/()), ++ it1;
+ functor_type::apply (*it1, expr_value_type/*zero*/()), ++ it1;
} else {
it1 += size1;
}
@@ -879,7 +882,7 @@
#endif
difference_type size1 (it1_end - it1);
while (-- size1 >= 0)
- functor_type::apply (*it1, value_type/*zero*/()), ++ it1;
+ functor_type::apply (*it1, expr_value_type/*zero*/()), ++ it1;
++ it2;
}
} else {
@@ -958,7 +961,8 @@
template<template <class T1, class T2> class F, class R, class M, class E>
// BOOST_UBLAS_INLINE This function seems to be big. So we do not let the compiler inline it.
void matrix_assign (M &m, const matrix_expression<E> &e, sparse_proxy_tag, row_major_tag) {
- typedef F<typename M::iterator2::reference, typename E::value_type> functor_type;
+ typedef typename matrix_traits<E>::value_type expr_value_type;
+ typedef F<typename M::iterator2::reference, expr_value_type> functor_type;
typedef R conformant_restrict_type;
typedef typename M::size_type size_type;
typedef typename M::difference_type difference_type;
@@ -1004,7 +1008,7 @@
break;
} else if (compare < 0) {
if (!functor_type::computed) {
- functor_type::apply (*it2, value_type/*zero*/());
+ functor_type::apply (*it2, expr_value_type/*zero*/());
++ it2;
} else
increment (it2, it2_end, - compare);
@@ -1023,7 +1027,7 @@
}
if (!functor_type::computed) {
while (it2 != it2_end) { // zeroing
- functor_type::apply (*it2, value_type/*zero*/());
+ functor_type::apply (*it2, expr_value_type/*zero*/());
++ it2;
}
} else {
@@ -1040,7 +1044,7 @@
typename M::iterator2 it2_end (end (it1, iterator1_tag ()));
#endif
while (it2 != it2_end) { // zeroing
- functor_type::apply (*it2, value_type/*zero*/());
+ functor_type::apply (*it2, expr_value_type/*zero*/());
++ it2;
}
++ it1;
@@ -1061,7 +1065,7 @@
typename M::iterator2 it2_end (end (it1, iterator1_tag ()));
#endif
while (it2 != it2_end) { // zeroing
- functor_type::apply (*it2, value_type/*zero*/());
+ functor_type::apply (*it2, expr_value_type/*zero*/());
++ it2;
}
++ it1;
@@ -1078,7 +1082,8 @@
template<template <class T1, class T2> class F, class R, class M, class E>
// BOOST_UBLAS_INLINE This function seems to be big. So we do not let the compiler inline it.
void matrix_assign (M &m, const matrix_expression<E> &e, sparse_proxy_tag, column_major_tag) {
- typedef F<typename M::iterator1::reference, typename E::value_type> functor_type;
+ typedef typename matrix_traits<E>::value_type expr_value_type;
+ typedef F<typename M::iterator1::reference, expr_value_type> functor_type;
typedef R conformant_restrict_type;
typedef typename M::size_type size_type;
typedef typename M::difference_type difference_type;
@@ -1124,7 +1129,7 @@
break;
} else if (compare < 0) {
if (!functor_type::computed) {
- functor_type::apply (*it1, value_type/*zero*/()); // zeroing
+ functor_type::apply (*it1, expr_value_type/*zero*/()); // zeroing
++ it1;
} else
increment (it1, it1_end, - compare);
@@ -1143,7 +1148,7 @@
}
if (!functor_type::computed) {
while (it1 != it1_end) { // zeroing
- functor_type::apply (*it1, value_type/*zero*/());
+ functor_type::apply (*it1, expr_value_type/*zero*/());
++ it1;
}
} else {
@@ -1160,7 +1165,7 @@
typename M::iterator1 it1_end (end (it2, iterator2_tag ()));
#endif
while (it1 != it1_end) { // zeroing
- functor_type::apply (*it1, value_type/*zero*/());
+ functor_type::apply (*it1, expr_value_type/*zero*/());
++ it1;
}
++ it2;
@@ -1181,7 +1186,7 @@
typename M::iterator1 it1_end (end (it2, iterator2_tag ()));
#endif
while (it1 != it1_end) { // zeroing
- functor_type::apply (*it1, value_type/*zero*/());
+ functor_type::apply (*it1, expr_value_type/*zero*/());
++ it1;
}
++ it2;
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