diff -rupN /hub/3rdparty/R2010b/151720/glnxa64/boost/include/boost/numeric/ublas/detail/matrix_assign.hpp ublas/detail/matrix_assign.hpp
|
old
|
new
|
namespace detail {
|
| 74 | 74 | if (it2 != it2_end && it2e != it2e_end) { |
| 75 | 75 | size_type it2_index = it2.index2 (), it2e_index = it2e.index2 (); |
| 76 | 76 | while (true) { |
| 77 | | difference_type compare = it2_index - it2e_index; |
| 78 | | if (compare == 0) { |
| | 77 | difference_type compare2 = it2_index - it2e_index; |
| | 78 | if (compare2 == 0) { |
| 79 | 79 | ++ it2, ++ it2e; |
| 80 | 80 | if (it2 != it2_end && it2e != it2e_end) { |
| 81 | 81 | it2_index = it2.index2 (); |
| 82 | 82 | it2e_index = it2e.index2 (); |
| 83 | 83 | } else |
| 84 | 84 | break; |
| 85 | | } else if (compare < 0) { |
| 86 | | increment (it2, it2_end, - compare); |
| | 85 | } else if (compare2 < 0) { |
| | 86 | increment (it2, it2_end, - compare2); |
| 87 | 87 | if (it2 != it2_end) |
| 88 | 88 | it2_index = it2.index2 (); |
| 89 | 89 | else |
| 90 | 90 | break; |
| 91 | | } else if (compare > 0) { |
| | 91 | } else if (compare2 > 0) { |
| 92 | 92 | if (conformant_restrict_type::other (it2e.index1 (), it2e.index2 ())) |
| 93 | 93 | if (*it2e != value_type/*zero*/()) |
| 94 | 94 | index.push_back (std::pair<size_type, size_type> (it2e.index1 (), it2e.index2 ())); |
| … |
… |
namespace detail {
|
| 177 | 177 | if (it1 != it1_end && it1e != it1e_end) { |
| 178 | 178 | size_type it1_index = it1.index1 (), it1e_index = it1e.index1 (); |
| 179 | 179 | while (true) { |
| 180 | | difference_type compare = it1_index - it1e_index; |
| 181 | | if (compare == 0) { |
| | 180 | difference_type compare2 = it1_index - it1e_index; |
| | 181 | if (compare2 == 0) { |
| 182 | 182 | ++ it1, ++ it1e; |
| 183 | 183 | if (it1 != it1_end && it1e != it1e_end) { |
| 184 | 184 | it1_index = it1.index1 (); |
| 185 | 185 | it1e_index = it1e.index1 (); |
| 186 | 186 | } else |
| 187 | 187 | break; |
| 188 | | } else if (compare < 0) { |
| 189 | | increment (it1, it1_end, - compare); |
| | 188 | } else if (compare2 < 0) { |
| | 189 | increment (it1, it1_end, - compare2); |
| 190 | 190 | if (it1 != it1_end) |
| 191 | 191 | it1_index = it1.index1 (); |
| 192 | 192 | else |
| 193 | 193 | break; |
| 194 | | } else if (compare > 0) { |
| | 194 | } else if (compare2 > 0) { |
| 195 | 195 | if (conformant_restrict_type::other (it1e.index1 (), it1e.index2 ())) |
| 196 | 196 | if (*it1e != value_type/*zero*/()) |
| 197 | 197 | index.push_back (std::pair<size_type, size_type> (it1e.index1 (), it1e.index2 ())); |
| … |
… |
namespace detail {
|
| 993 | 993 | if (it2 != it2_end && it2e != it2e_end) { |
| 994 | 994 | size_type it2_index = it2.index2 (), it2e_index = it2e.index2 (); |
| 995 | 995 | while (true) { |
| 996 | | difference_type compare = it2_index - it2e_index; |
| 997 | | if (compare == 0) { |
| | 996 | difference_type compare2 = it2_index - it2e_index; |
| | 997 | if (compare2 == 0) { |
| 998 | 998 | functor_type::apply (*it2, *it2e); |
| 999 | 999 | ++ it2, ++ it2e; |
| 1000 | 1000 | if (it2 != it2_end && it2e != it2e_end) { |
| … |
… |
namespace detail {
|
| 1002 | 1002 | it2e_index = it2e.index2 (); |
| 1003 | 1003 | } else |
| 1004 | 1004 | break; |
| 1005 | | } else if (compare < 0) { |
| | 1005 | } else if (compare2 < 0) { |
| 1006 | 1006 | if (!functor_type::computed) { |
| 1007 | 1007 | functor_type::apply (*it2, value_type/*zero*/()); |
| 1008 | 1008 | ++ it2; |
| 1009 | 1009 | } else |
| 1010 | | increment (it2, it2_end, - compare); |
| | 1010 | increment (it2, it2_end, - compare2); |
| 1011 | 1011 | if (it2 != it2_end) |
| 1012 | 1012 | it2_index = it2.index2 (); |
| 1013 | 1013 | else |
| 1014 | 1014 | break; |
| 1015 | | } else if (compare > 0) { |
| 1016 | | increment (it2e, it2e_end, compare); |
| | 1015 | } else if (compare2 > 0) { |
| | 1016 | increment (it2e, it2e_end, compare2); |
| 1017 | 1017 | if (it2e != it2e_end) |
| 1018 | 1018 | it2e_index = it2e.index2 (); |
| 1019 | 1019 | else |
| … |
… |
namespace detail {
|
| 1113 | 1113 | if (it1 != it1_end && it1e != it1e_end) { |
| 1114 | 1114 | size_type it1_index = it1.index1 (), it1e_index = it1e.index1 (); |
| 1115 | 1115 | while (true) { |
| 1116 | | difference_type compare = it1_index - it1e_index; |
| 1117 | | if (compare == 0) { |
| | 1116 | difference_type compare2 = it1_index - it1e_index; |
| | 1117 | if (compare2 == 0) { |
| 1118 | 1118 | functor_type::apply (*it1, *it1e); |
| 1119 | 1119 | ++ it1, ++ it1e; |
| 1120 | 1120 | if (it1 != it1_end && it1e != it1e_end) { |
| … |
… |
namespace detail {
|
| 1122 | 1122 | it1e_index = it1e.index1 (); |
| 1123 | 1123 | } else |
| 1124 | 1124 | break; |
| 1125 | | } else if (compare < 0) { |
| | 1125 | } else if (compare2 < 0) { |
| 1126 | 1126 | if (!functor_type::computed) { |
| 1127 | 1127 | functor_type::apply (*it1, value_type/*zero*/()); // zeroing |
| 1128 | 1128 | ++ it1; |
| 1129 | 1129 | } else |
| 1130 | | increment (it1, it1_end, - compare); |
| | 1130 | increment (it1, it1_end, - compare2); |
| 1131 | 1131 | if (it1 != it1_end) |
| 1132 | 1132 | it1_index = it1.index1 (); |
| 1133 | 1133 | else |
| 1134 | 1134 | break; |
| 1135 | | } else if (compare > 0) { |
| 1136 | | increment (it1e, it1e_end, compare); |
| | 1135 | } else if (compare2 > 0) { |
| | 1136 | increment (it1e, it1e_end, compare2); |
| 1137 | 1137 | if (it1e != it1e_end) |
| 1138 | 1138 | it1e_index = it1e.index1 (); |
| 1139 | 1139 | else |
| … |
… |
namespace detail {
|
| 1381 | 1381 | if (it2 != it2_end && it2e != it2e_end) { |
| 1382 | 1382 | size_type it2_index = it2.index2 (), it2e_index = it2e.index2 (); |
| 1383 | 1383 | while (true) { |
| 1384 | | difference_type compare = it2_index - it2e_index; |
| 1385 | | if (compare == 0) { |
| | 1384 | difference_type compare2 = it2_index - it2e_index; |
| | 1385 | if (compare2 == 0) { |
| 1386 | 1386 | functor_type::apply (*it2, *it2e); |
| 1387 | 1387 | ++ it2, ++ it2e; |
| 1388 | 1388 | if (it2 != it2_end && it2e != it2e_end) { |
| … |
… |
namespace detail {
|
| 1390 | 1390 | it2e_index = it2e.index2 (); |
| 1391 | 1391 | } else |
| 1392 | 1392 | break; |
| 1393 | | } else if (compare < 0) { |
| 1394 | | increment (it2, it2_end, - compare); |
| | 1393 | } else if (compare2 < 0) { |
| | 1394 | increment (it2, it2_end, - compare2); |
| 1395 | 1395 | if (it2 != it2_end) |
| 1396 | 1396 | it2_index = it2.index2 (); |
| 1397 | 1397 | else |
| 1398 | 1398 | break; |
| 1399 | | } else if (compare > 0) { |
| 1400 | | increment (it2e, it2e_end, compare); |
| | 1399 | } else if (compare2 > 0) { |
| | 1400 | increment (it2e, it2e_end, compare2); |
| 1401 | 1401 | if (it2e != it2e_end) |
| 1402 | 1402 | it2e_index = it2e.index2 (); |
| 1403 | 1403 | else |
| … |
… |
namespace detail {
|
| 1506 | 1506 | if (it1 != it1_end && it1e != it1e_end) { |
| 1507 | 1507 | size_type it1_index = it1.index1 (), it1e_index = it1e.index1 (); |
| 1508 | 1508 | while (true) { |
| 1509 | | difference_type compare = it1_index - it1e_index; |
| 1510 | | if (compare == 0) { |
| | 1509 | difference_type compare2 = it1_index - it1e_index; |
| | 1510 | if (compare2 == 0) { |
| 1511 | 1511 | functor_type::apply (*it1, *it1e); |
| 1512 | 1512 | ++ it1, ++ it1e; |
| 1513 | 1513 | if (it1 != it1_end && it1e != it1e_end) { |
| … |
… |
namespace detail {
|
| 1515 | 1515 | it1e_index = it1e.index1 (); |
| 1516 | 1516 | } else |
| 1517 | 1517 | break; |
| 1518 | | } else if (compare < 0) { |
| 1519 | | increment (it1, it1_end, - compare); |
| | 1518 | } else if (compare2 < 0) { |
| | 1519 | increment (it1, it1_end, - compare2); |
| 1520 | 1520 | if (it1 != it1_end) |
| 1521 | 1521 | it1_index = it1.index1 (); |
| 1522 | 1522 | else |
| 1523 | 1523 | break; |
| 1524 | | } else if (compare > 0) { |
| 1525 | | increment (it1e, it1e_end, compare); |
| | 1524 | } else if (compare2 > 0) { |
| | 1525 | increment (it1e, it1e_end, compare2); |
| 1526 | 1526 | if (it1e != it1e_end) |
| 1527 | 1527 | it1e_index = it1e.index1 (); |
| 1528 | 1528 | else |
diff -rupN /hub/3rdparty/R2010b/151720/glnxa64/boost/include/boost/numeric/ublas/matrix.hpp ublas/matrix.hpp
|
old
|
new
|
namespace boost { namespace numeric { na
|
| 92 | 92 | matrix_container<self_type> (), |
| 93 | 93 | size1_ (0), size2_ (0), data_ () {} |
| 94 | 94 | BOOST_UBLAS_INLINE |
| 95 | | matrix (size_type size1, size_type size2): |
| | 95 | matrix (size_type size1_arg, size_type size2_arg): |
| 96 | 96 | matrix_container<self_type> (), |
| 97 | | size1_ (size1), size2_ (size2), data_ (layout_type::storage_size (size1, size2)) { |
| | 97 | size1_ (size1_arg), size2_ (size2_arg), data_ (layout_type::storage_size (size1_arg, size2_arg)) { |
| 98 | 98 | } |
| 99 | | matrix (size_type size1, size_type size2, const value_type &init): |
| | 99 | matrix (size_type size1_arg, size_type size2_arg, const value_type &init): |
| 100 | 100 | matrix_container<self_type> (), |
| 101 | | size1_ (size1), size2_ (size2), data_ (layout_type::storage_size (size1, size2), init) { |
| | 101 | size1_ (size1_arg), size2_ (size2_arg), data_ (layout_type::storage_size (size1_arg, size2_arg), init) { |
| 102 | 102 | } |
| 103 | 103 | BOOST_UBLAS_INLINE |
| 104 | | matrix (size_type size1, size_type size2, const array_type &data): |
| | 104 | matrix (size_type size1_arg, size_type size2_arg, const array_type &data_arg): |
| 105 | 105 | matrix_container<self_type> (), |
| 106 | | size1_ (size1), size2_ (size2), data_ (data) {} |
| | 106 | size1_ (size1_arg), size2_ (size2_arg), data_ (data_arg) {} |
| 107 | 107 | BOOST_UBLAS_INLINE |
| 108 | 108 | matrix (const matrix &m): |
| 109 | 109 | matrix_container<self_type> (), |
| … |
… |
namespace boost { namespace numeric { na
|
| 138 | 138 | |
| 139 | 139 | // Resizing |
| 140 | 140 | BOOST_UBLAS_INLINE |
| 141 | | void resize (size_type size1, size_type size2, bool preserve = true) { |
| | 141 | void resize (size_type size1_arg, size_type size2_arg, bool preserve = true) { |
| 142 | 142 | if (preserve) { |
| 143 | | self_type temporary (size1, size2); |
| | 143 | self_type temporary (size1_arg, size2_arg); |
| 144 | 144 | detail::matrix_resize_preserve<layout_type> (*this, temporary); |
| 145 | 145 | } |
| 146 | 146 | else { |
| 147 | | data ().resize (layout_type::storage_size (size1, size2)); |
| 148 | | size1_ = size1; |
| 149 | | size2_ = size2; |
| | 147 | data ().resize (layout_type::storage_size (size1_arg, size2_arg)); |
| | 148 | size1_ = size1_arg; |
| | 149 | size2_ = size2_arg; |
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | |
| … |
… |
namespace boost { namespace numeric { na
|
| 1065 | 1065 | matrix_container<self_type> (), |
| 1066 | 1066 | size1_ (0), size2_ (0), data_ (1) {} |
| 1067 | 1067 | BOOST_UBLAS_INLINE |
| 1068 | | vector_of_vector (size_type size1, size_type size2): |
| | 1068 | vector_of_vector (size_type size1_arg, size_type size2_arg): |
| 1069 | 1069 | matrix_container<self_type> (), |
| 1070 | | size1_ (size1), size2_ (size2), data_ (1) { |
| 1071 | | resize (size1, size2, true); |
| | 1070 | size1_ (size1_arg), size2_ (size2_arg), data_ (1) { |
| | 1071 | resize (size1_arg, size2_arg, true); |
| 1072 | 1072 | } |
| 1073 | 1073 | BOOST_UBLAS_INLINE |
| 1074 | 1074 | vector_of_vector (const vector_of_vector &m): |
| … |
… |
namespace boost { namespace numeric { na
|
| 1106 | 1106 | |
| 1107 | 1107 | // Resizing |
| 1108 | 1108 | BOOST_UBLAS_INLINE |
| 1109 | | void resize (size_type size1, size_type size2, bool preserve = true) { |
| 1110 | | size1_ = size1; |
| 1111 | | size2_ = size2; |
| | 1109 | void resize (size_type size1_arg, size_type size2_arg, bool preserve = true) { |
| | 1110 | size1_ = size1_arg; |
| | 1111 | size2_ = size2_arg; |
| 1112 | 1112 | if (preserve) |
| 1113 | | data ().resize (layout_type::size_M (size1, size2) + 1, typename array_type::value_type ()); |
| | 1113 | data ().resize (layout_type::size_M (size1_arg, size2_arg) + 1, typename array_type::value_type ()); |
| 1114 | 1114 | else |
| 1115 | | data ().resize (layout_type::size_M (size1, size2) + 1); |
| 1116 | | for (size_type k = 0; k < layout_type::size_M (size1, size2); ++ k) { |
| | 1115 | data ().resize (layout_type::size_M (size1_arg, size2_arg) + 1); |
| | 1116 | for (size_type k = 0; k < layout_type::size_M (size1_arg, size2_arg); ++ k) { |
| 1117 | 1117 | if (preserve) |
| 1118 | | data () [k].resize (layout_type::size_m (size1, size2), value_type ()); |
| | 1118 | data () [k].resize (layout_type::size_m (size1_arg, size2_arg), value_type ()); |
| 1119 | 1119 | else |
| 1120 | | data () [k].resize (layout_type::size_m (size1, size2)); |
| | 1120 | data () [k].resize (layout_type::size_m (size1_arg, size2_arg)); |
| 1121 | 1121 | } |
| 1122 | 1122 | } |
| 1123 | 1123 | |
| … |
… |
namespace boost { namespace numeric { na
|
| 2043 | 2043 | matrix_container<self_type> (), |
| 2044 | 2044 | size1_ (size), size2_ (size) {} |
| 2045 | 2045 | BOOST_UBLAS_INLINE |
| 2046 | | zero_matrix (size_type size1, size_type size2): |
| | 2046 | zero_matrix (size_type size1_arg, size_type size2_arg): |
| 2047 | 2047 | matrix_container<self_type> (), |
| 2048 | | size1_ (size1), size2_ (size2) {} |
| | 2048 | size1_ (size1_arg), size2_ (size2_arg) {} |
| 2049 | 2049 | BOOST_UBLAS_INLINE |
| 2050 | 2050 | zero_matrix (const zero_matrix &m): |
| 2051 | 2051 | matrix_container<self_type> (), |
| … |
… |
namespace boost { namespace numeric { na
|
| 2068 | 2068 | size2_ = size; |
| 2069 | 2069 | } |
| 2070 | 2070 | BOOST_UBLAS_INLINE |
| 2071 | | void resize (size_type size1, size_type size2, bool /*preserve*/ = true) { |
| 2072 | | size1_ = size1; |
| 2073 | | size2_ = size2; |
| | 2071 | void resize (size_type size1_arg, size_type size2_arg, bool /*preserve*/ = true) { |
| | 2072 | size1_ = size1_arg; |
| | 2073 | size2_ = size2_arg; |
| 2074 | 2074 | } |
| 2075 | 2075 | |
| 2076 | 2076 | // Element access |
| … |
… |
namespace boost { namespace numeric { na
|
| 2423 | 2423 | matrix_container<self_type> (), |
| 2424 | 2424 | size1_ (size), size2_ (size), size_common_ ((std::min) (size1_, size2_)) {} |
| 2425 | 2425 | BOOST_UBLAS_INLINE |
| 2426 | | identity_matrix (size_type size1, size_type size2): |
| | 2426 | identity_matrix (size_type size1_arg, size_type size2_arg): |
| 2427 | 2427 | matrix_container<self_type> (), |
| 2428 | | size1_ (size1), size2_ (size2), size_common_ ((std::min) (size1_, size2_)) {} |
| | 2428 | size1_ (size1_arg), size2_ (size2_arg), size_common_ ((std::min) (size1_, size2_)) {} |
| 2429 | 2429 | BOOST_UBLAS_INLINE |
| 2430 | 2430 | identity_matrix (const identity_matrix &m): |
| 2431 | 2431 | matrix_container<self_type> (), |
| … |
… |
namespace boost { namespace numeric { na
|
| 2448 | 2448 | size2_ = size; |
| 2449 | 2449 | } |
| 2450 | 2450 | BOOST_UBLAS_INLINE |
| 2451 | | void resize (size_type size1, size_type size2, bool /*preserve*/ = true) { |
| 2452 | | size1_ = size1; |
| 2453 | | size2_ = size2; |
| | 2451 | void resize (size_type size1_arg, size_type size2_arg, bool /*preserve*/ = true) { |
| | 2452 | size1_ = size1_arg; |
| | 2453 | size2_ = size2_arg; |
| 2454 | 2454 | } |
| 2455 | 2455 | |
| 2456 | 2456 | // Element access |
| … |
… |
namespace boost { namespace numeric { na
|
| 2824 | 2824 | matrix_container<self_type> (), |
| 2825 | 2825 | size1_ (0), size2_ (0), value_ () {} |
| 2826 | 2826 | BOOST_UBLAS_INLINE |
| 2827 | | scalar_matrix (size_type size1, size_type size2, const value_type &value = value_type(1)): |
| | 2827 | scalar_matrix (size_type size1_arg, size_type size2_arg, const value_type &value = value_type(1)): |
| 2828 | 2828 | matrix_container<self_type> (), |
| 2829 | | size1_ (size1), size2_ (size2), value_ (value) {} |
| | 2829 | size1_ (size1_arg), size2_ (size2_arg), value_ (value) {} |
| 2830 | 2830 | BOOST_UBLAS_INLINE |
| 2831 | 2831 | scalar_matrix (const scalar_matrix &m): |
| 2832 | 2832 | matrix_container<self_type> (), |
| … |
… |
namespace boost { namespace numeric { na
|
| 2844 | 2844 | |
| 2845 | 2845 | // Resizing |
| 2846 | 2846 | BOOST_UBLAS_INLINE |
| 2847 | | void resize (size_type size1, size_type size2, bool /*preserve*/ = true) { |
| 2848 | | size1_ = size1; |
| 2849 | | size2_ = size2; |
| | 2847 | void resize (size_type size1_arg, size_type size2_arg, bool /*preserve*/ = true) { |
| | 2848 | size1_ = size1_arg; |
| | 2849 | size2_ = size2_arg; |
| 2850 | 2850 | } |
| 2851 | 2851 | |
| 2852 | 2852 | // Element access |
| … |
… |
namespace boost { namespace numeric { na
|
| 3284 | 3284 | size1_ (N), size2_ (M) /* , data_ () */ { |
| 3285 | 3285 | } |
| 3286 | 3286 | BOOST_UBLAS_INLINE |
| 3287 | | c_matrix (size_type size1, size_type size2): |
| 3288 | | size1_ (size1), size2_ (size2) /* , data_ () */ { |
| | 3287 | c_matrix (size_type size1_arg, size_type size2_arg): |
| | 3288 | size1_ (size1_arg), size2_ (size2_arg) /* , data_ () */ { |
| 3289 | 3289 | if (size1_ > N || size2_ > M) |
| 3290 | 3290 | bad_size ().raise (); |
| 3291 | 3291 | } |
| … |
… |
namespace boost { namespace numeric { na
|
| 3325 | 3325 | |
| 3326 | 3326 | // Resizing |
| 3327 | 3327 | BOOST_UBLAS_INLINE |
| 3328 | | void resize (size_type size1, size_type size2, bool preserve = true) { |
| 3329 | | if (size1 > N || size2 > M) |
| | 3328 | void resize (size_type size1_arg, size_type size2_arg, bool preserve = true) { |
| | 3329 | if (size1_arg > N || size2_arg > M) |
| 3330 | 3330 | bad_size ().raise (); |
| 3331 | 3331 | if (preserve) { |
| 3332 | | self_type temporary (size1, size2); |
| | 3332 | self_type temporary (size1_arg, size2_arg); |
| 3333 | 3333 | // Common elements to preserve |
| 3334 | | const size_type size1_min = (std::min) (size1, size1_); |
| 3335 | | const size_type size2_min = (std::min) (size2, size2_); |
| | 3334 | const size_type size1_min = (std::min) (size1_arg, size1_); |
| | 3335 | const size_type size2_min = (std::min) (size2_arg, size2_); |
| 3336 | 3336 | for (size_type i = 0; i != size1_min; ++i) { // indexing copy over major |
| 3337 | 3337 | for (size_type j = 0; j != size2_min; ++j) { |
| 3338 | 3338 | temporary.data_[i][j] = data_[i][j]; |
| … |
… |
namespace boost { namespace numeric { na
|
| 3341 | 3341 | assign_temporary (temporary); |
| 3342 | 3342 | } |
| 3343 | 3343 | else { |
| 3344 | | size1_ = size1; |
| 3345 | | size2_ = size2; |
| | 3344 | size1_ = size1_arg; |
| | 3345 | size2_ = size2_arg; |
| 3346 | 3346 | } |
| 3347 | 3347 | } |
| 3348 | 3348 | |
diff -rupN /hub/3rdparty/R2010b/151720/glnxa64/boost/include/boost/numeric/ublas/matrix_expression.hpp ublas/matrix_expression.hpp
|
old
|
new
|
namespace boost { namespace numeric { na
|
| 1918 | 1918 | // Sparse specializations |
| 1919 | 1919 | BOOST_UBLAS_INLINE |
| 1920 | 1920 | void increment (sparse_bidirectional_iterator_tag) { |
| 1921 | | size_type index1 = (*this) ().size1 (); |
| | 1921 | size_type index1_val = (*this) ().size1 (); |
| 1922 | 1922 | if (it1_ != it1_end_) { |
| 1923 | 1923 | if (it1_.index1 () <= i_) |
| 1924 | 1924 | ++ it1_; |
| 1925 | 1925 | if (it1_ != it1_end_) |
| 1926 | | index1 = it1_.index1 (); |
| | 1926 | index1_val = it1_.index1 (); |
| 1927 | 1927 | } |
| 1928 | | size_type index2 = (*this) ().size1 (); |
| | 1928 | size_type index2_val = (*this) ().size1 (); |
| 1929 | 1929 | if (it2_ != it2_end_) |
| 1930 | 1930 | if (it2_.index1 () <= i_) |
| 1931 | 1931 | ++ it2_; |
| 1932 | 1932 | if (it2_ != it2_end_) { |
| 1933 | | index2 = it2_.index1 (); |
| | 1933 | index2_val = it2_.index1 (); |
| 1934 | 1934 | } |
| 1935 | | i_ = (std::min) (index1, index2); |
| | 1935 | i_ = (std::min) (index1_val, index2_val); |
| 1936 | 1936 | } |
| 1937 | 1937 | BOOST_UBLAS_INLINE |
| 1938 | 1938 | void decrement (sparse_bidirectional_iterator_tag) { |
| 1939 | | size_type index1 = (*this) ().size1 (); |
| | 1939 | size_type index1_val = (*this) ().size1 (); |
| 1940 | 1940 | if (it1_ != it1_end_) { |
| 1941 | 1941 | if (i_ <= it1_.index1 ()) |
| 1942 | 1942 | -- it1_; |
| 1943 | 1943 | if (it1_ != it1_end_) |
| 1944 | | index1 = it1_.index1 (); |
| | 1944 | index1_val = it1_.index1 (); |
| 1945 | 1945 | } |
| 1946 | | size_type index2 = (*this) ().size1 (); |
| | 1946 | size_type index2_val = (*this) ().size1 (); |
| 1947 | 1947 | if (it2_ != it2_end_) { |
| 1948 | 1948 | if (i_ <= it2_.index1 ()) |
| 1949 | 1949 | -- it2_; |
| 1950 | 1950 | if (it2_ != it2_end_) |
| 1951 | | index2 = it2_.index1 (); |
| | 1951 | index2_val = it2_.index1 (); |
| 1952 | 1952 | } |
| 1953 | | i_ = (std::max) (index1, index2); |
| | 1953 | i_ = (std::max) (index1_val, index2_val); |
| 1954 | 1954 | } |
| 1955 | 1955 | BOOST_UBLAS_INLINE |
| 1956 | 1956 | void increment (sparse_bidirectional_iterator_tag, difference_type n) { |
| … |
… |
namespace boost { namespace numeric { na
|
| 2233 | 2233 | // Sparse specializations |
| 2234 | 2234 | BOOST_UBLAS_INLINE |
| 2235 | 2235 | void increment (sparse_bidirectional_iterator_tag) { |
| 2236 | | size_type index1 = (*this) ().size2 (); |
| | 2236 | size_type index1_val = (*this) ().size2 (); |
| 2237 | 2237 | if (it1_ != it1_end_) { |
| 2238 | 2238 | if (it1_.index2 () <= j_) |
| 2239 | 2239 | ++ it1_; |
| 2240 | 2240 | if (it1_ != it1_end_) |
| 2241 | | index1 = it1_.index2 (); |
| | 2241 | index1_val = it1_.index2 (); |
| 2242 | 2242 | } |
| 2243 | | size_type index2 = (*this) ().size2 (); |
| | 2243 | size_type index2_val = (*this) ().size2 (); |
| 2244 | 2244 | if (it2_ != it2_end_) { |
| 2245 | 2245 | if (it2_.index2 () <= j_) |
| 2246 | 2246 | ++ it2_; |
| 2247 | 2247 | if (it2_ != it2_end_) |
| 2248 | | index2 = it2_.index2 (); |
| | 2248 | index2_val = it2_.index2 (); |
| 2249 | 2249 | } |
| 2250 | | j_ = (std::min) (index1, index2); |
| | 2250 | j_ = (std::min) (index1_val, index2_val); |
| 2251 | 2251 | } |
| 2252 | 2252 | BOOST_UBLAS_INLINE |
| 2253 | 2253 | void decrement (sparse_bidirectional_iterator_tag) { |
| 2254 | | size_type index1 = (*this) ().size2 (); |
| | 2254 | size_type index1_val = (*this) ().size2 (); |
| 2255 | 2255 | if (it1_ != it1_end_) { |
| 2256 | 2256 | if (j_ <= it1_.index2 ()) |
| 2257 | 2257 | -- it1_; |
| 2258 | 2258 | if (it1_ != it1_end_) |
| 2259 | | index1 = it1_.index2 (); |
| | 2259 | index1_val = it1_.index2 (); |
| 2260 | 2260 | } |
| 2261 | | size_type index2 = (*this) ().size2 (); |
| | 2261 | size_type index2_val = (*this) ().size2 (); |
| 2262 | 2262 | if (it2_ != it2_end_) { |
| 2263 | 2263 | if (j_ <= it2_.index2 ()) |
| 2264 | 2264 | -- it2_; |
| 2265 | 2265 | if (it2_ != it2_end_) |
| 2266 | | index2 = it2_.index2 (); |
| | 2266 | index2_val = it2_.index2 (); |
| 2267 | 2267 | } |
| 2268 | | j_ = (std::max) (index1, index2); |
| | 2268 | j_ = (std::max) (index1_val, index2_val); |
| 2269 | 2269 | } |
| 2270 | 2270 | BOOST_UBLAS_INLINE |
| 2271 | 2271 | void increment (sparse_bidirectional_iterator_tag, difference_type n) { |
diff -rupN /hub/3rdparty/R2010b/151720/glnxa64/boost/include/boost/numeric/ublas/matrix_sparse.hpp ublas/matrix_sparse.hpp
|
old
|
new
|
namespace boost { namespace numeric { na
|
| 284 | 284 | matrix_container<self_type> (), |
| 285 | 285 | size1_ (0), size2_ (0), data_ () {} |
| 286 | 286 | BOOST_UBLAS_INLINE |
| 287 | | mapped_matrix (size_type size1, size_type size2, size_type non_zeros = 0): |
| | 287 | mapped_matrix (size_type size1_arg, size_type size2_arg, size_type non_zeros = 0): |
| 288 | 288 | matrix_container<self_type> (), |
| 289 | | size1_ (size1), size2_ (size2), data_ () { |
| | 289 | size1_ (size1_arg), size2_ (size2_arg), data_ () { |
| 290 | 290 | detail::map_reserve (data (), restrict_capacity (non_zeros)); |
| 291 | 291 | } |
| 292 | 292 | BOOST_UBLAS_INLINE |
| … |
… |
namespace boost { namespace numeric { na
|
| 342 | 342 | } |
| 343 | 343 | public: |
| 344 | 344 | BOOST_UBLAS_INLINE |
| 345 | | void resize (size_type size1, size_type size2, bool preserve = true) { |
| | 345 | void resize (size_type size1_arg, size_type size2_arg, bool preserve = true) { |
| 346 | 346 | // FIXME preserve unimplemented |
| 347 | 347 | BOOST_UBLAS_CHECK (!preserve, internal_logic ()); |
| 348 | | size1_ = size1; |
| 349 | | size2_ = size2; |
| | 348 | size1_ = size1_arg; |
| | 349 | size2_ = size2_arg; |
| 350 | 350 | data ().clear (); |
| 351 | 351 | } |
| 352 | 352 | |
| … |
… |
namespace boost { namespace numeric { na
|
| 1357 | 1357 | data_ [layout_type::size_M (size1_, size2_)] = vector_data_value_type (); |
| 1358 | 1358 | } |
| 1359 | 1359 | BOOST_UBLAS_INLINE |
| 1360 | | mapped_vector_of_mapped_vector (size_type size1, size_type size2, size_type non_zeros = 0): |
| | 1360 | mapped_vector_of_mapped_vector (size_type size1_arg, size_type size2_arg, size_type non_zeros = 0): |
| 1361 | 1361 | matrix_container<self_type> (), |
| 1362 | | size1_ (size1), size2_ (size2), data_ () { |
| | 1362 | size1_ (size1_arg), size2_ (size2_arg), data_ () { |
| 1363 | 1363 | data_ [layout_type::size_M (size1_, size2_)] = vector_data_value_type (); |
| 1364 | 1364 | } |
| 1365 | 1365 | BOOST_UBLAS_INLINE |
| … |
… |
namespace boost { namespace numeric { na
|
| 1411 | 1411 | |
| 1412 | 1412 | // Resizing |
| 1413 | 1413 | BOOST_UBLAS_INLINE |
| 1414 | | void resize (size_type size1, size_type size2, bool preserve = true) { |
| | 1414 | void resize (size_type size1_arg, size_type size2_arg, bool preserve = true) { |
| 1415 | 1415 | // FIXME preserve unimplemented |
| 1416 | 1416 | BOOST_UBLAS_CHECK (!preserve, internal_logic ()); |
| 1417 | | size1_ = size1; |
| 1418 | | size2_ = size2; |
| | 1417 | size1_ = size1_arg; |
| | 1418 | size2_ = size2_arg; |
| 1419 | 1419 | data ().clear (); |
| 1420 | 1420 | data () [layout_type::size_M (size1_, size2_)] = vector_data_value_type (); |
| 1421 | 1421 | } |
| … |
… |
namespace boost { namespace numeric { na
|
| 2650 | 2650 | storage_invariants (); |
| 2651 | 2651 | } |
| 2652 | 2652 | BOOST_UBLAS_INLINE |
| 2653 | | compressed_matrix (size_type size1, size_type size2, size_type non_zeros = 0): |
| | 2653 | compressed_matrix (size_type size1_arg, size_type size2_arg, size_type non_zeros = 0): |
| 2654 | 2654 | matrix_container<self_type> (), |
| 2655 | | size1_ (size1), size2_ (size2), capacity_ (restrict_capacity (non_zeros)), |
| | 2655 | size1_ (size1_arg), size2_ (size2_arg), capacity_ (restrict_capacity (non_zeros)), |
| 2656 | 2656 | filled1_ (1), filled2_ (0), |
| 2657 | 2657 | index1_data_ (layout_type::size_M (size1_, size2_) + 1), index2_data_ (capacity_), value_data_ (capacity_) { |
| 2658 | 2658 | index1_data_ [filled1_ - 1] = k_based (filled2_); |
| … |
… |
namespace boost { namespace numeric { na
|
| 2748 | 2748 | return value_data_; |
| 2749 | 2749 | } |
| 2750 | 2750 | BOOST_UBLAS_INLINE |
| 2751 | | void set_filled (const array_size_type& filled1, const array_size_type& filled2) { |
| 2752 | | filled1_ = filled1; |
| 2753 | | filled2_ = filled2; |
| | 2751 | void set_filled (const array_size_type& filled1_arg, const array_size_type& filled2_arg) { |
| | 2752 | filled1_ = filled1_arg; |
| | 2753 | filled2_ = filled2_arg; |
| 2754 | 2754 | storage_invariants (); |
| 2755 | 2755 | } |
| 2756 | 2756 | BOOST_UBLAS_INLINE |
| … |
… |
namespace boost { namespace numeric { na
|
| 2786 | 2786 | } |
| 2787 | 2787 | public: |
| 2788 | 2788 | BOOST_UBLAS_INLINE |
| 2789 | | void resize (size_type size1, size_type size2, bool preserve = true) { |
| | 2789 | void resize (size_type size1_arg, size_type size2_arg, bool preserve = true) { |
| 2790 | 2790 | // FIXME preserve unimplemented |
| 2791 | 2791 | BOOST_UBLAS_CHECK (!preserve, internal_logic ()); |
| 2792 | | size1_ = size1; |
| 2793 | | size2_ = size2; |
| | 2792 | size1_ = size1_arg; |
| | 2793 | size2_ = size2_arg; |
| 2794 | 2794 | capacity_ = restrict_capacity (capacity_); |
| 2795 | 2795 | filled1_ = 1; |
| 2796 | 2796 | filled2_ = 0; |
| … |
… |
namespace boost { namespace numeric { na
|
| 4029 | 4029 | storage_invariants (); |
| 4030 | 4030 | } |
| 4031 | 4031 | BOOST_UBLAS_INLINE |
| 4032 | | coordinate_matrix (size_type size1, size_type size2, array_size_type non_zeros = 0): |
| | 4032 | coordinate_matrix (size_type size1_arg, size_type size2_arg, array_size_type non_zeros = 0): |
| 4033 | 4033 | matrix_container<self_type> (), |
| 4034 | | size1_ (size1), size2_ (size2), capacity_ (restrict_capacity (non_zeros)), |
| | 4034 | size1_ (size1_arg), size2_ (size2_arg), capacity_ (restrict_capacity (non_zeros)), |
| 4035 | 4035 | filled_ (0), sorted_filled_ (filled_), sorted_ (true), |
| 4036 | 4036 | index1_data_ (capacity_), index2_data_ (capacity_), value_data_ (capacity_) { |
| 4037 | 4037 | storage_invariants (); |
| … |
… |
namespace boost { namespace numeric { na
|
| 4095 | 4095 | return value_data_; |
| 4096 | 4096 | } |
| 4097 | 4097 | BOOST_UBLAS_INLINE |
| 4098 | | void set_filled (const array_size_type &filled) { |
| | 4098 | void set_filled (const array_size_type &filled_arg) { |
| 4099 | 4099 | // Make sure that storage_invariants() succeeds |
| 4100 | | if (sorted_ && filled < filled_) |
| 4101 | | sorted_filled_ = filled; |
| | 4100 | if (sorted_ && filled_arg < filled_) |
| | 4101 | sorted_filled_ = filled_arg; |
| 4102 | 4102 | else |
| 4103 | | sorted_ = (sorted_filled_ == filled); |
| 4104 | | filled_ = filled; |
| | 4103 | sorted_ = (sorted_filled_ == filled_arg); |
| | 4104 | filled_ = filled_arg; |
| 4105 | 4105 | storage_invariants (); |
| 4106 | 4106 | } |
| 4107 | 4107 | BOOST_UBLAS_INLINE |
| … |
… |
namespace boost { namespace numeric { na
|
| 4128 | 4128 | } |
| 4129 | 4129 | public: |
| 4130 | 4130 | BOOST_UBLAS_INLINE |
| 4131 | | void resize (size_type size1, size_type size2, bool preserve = true) { |
| | 4131 | void resize (size_type size1_arg, size_type size2_arg, bool preserve = true) { |
| 4132 | 4132 | // FIXME preserve unimplemented |
| 4133 | 4133 | BOOST_UBLAS_CHECK (!preserve, internal_logic ()); |
| 4134 | | size1_ = size1; |
| 4135 | | size2_ = size2; |
| | 4134 | size1_ = size1_arg; |
| | 4135 | size2_ = size2_arg; |
| 4136 | 4136 | capacity_ = restrict_capacity (capacity_); |
| 4137 | 4137 | index1_data_.resize (capacity_); |
| 4138 | 4138 | index2_data_.resize (capacity_); |
| … |
… |
namespace boost { namespace numeric { na
|
| 4387 | 4387 | std::inplace_merge (ita.begin (), iunsorted, ita.end ()); |
| 4388 | 4388 | |
| 4389 | 4389 | // sum duplicates with += and remove |
| 4390 | | array_size_type filled = 0; |
| | 4390 | array_size_type filled_val = 0; |
| 4391 | 4391 | for (array_size_type i = 1; i < filled_; ++ i) { |
| 4392 | | if (index1_data_ [filled] != index1_data_ [i] || |
| 4393 | | index2_data_ [filled] != index2_data_ [i]) { |
| 4394 | | ++ filled; |
| 4395 | | if (filled != i) { |
| 4396 | | index1_data_ [filled] = index1_data_ [i]; |
| 4397 | | index2_data_ [filled] = index2_data_ [i]; |
| 4398 | | value_data_ [filled] = value_data_ [i]; |
| | 4392 | if (index1_data_ [filled_val] != index1_data_ [i] || |
| | 4393 | index2_data_ [filled_val] != index2_data_ [i]) { |
| | 4394 | ++ filled_val; |
| | 4395 | if (filled_val != i) { |
| | 4396 | index1_data_ [filled_val] = index1_data_ [i]; |
| | 4397 | index2_data_ [filled_val] = index2_data_ [i]; |
| | 4398 | value_data_ [filled_val] = value_data_ [i]; |
| 4399 | 4399 | } |
| 4400 | 4400 | } else { |
| 4401 | | value_data_ [filled] += value_data_ [i]; |
| | 4401 | value_data_ [filled_val] += value_data_ [i]; |
| 4402 | 4402 | } |
| 4403 | 4403 | } |
| 4404 | | filled_ = filled + 1; |
| | 4404 | filled_ = filled_val + 1; |
| 4405 | 4405 | sorted_filled_ = filled_; |
| 4406 | 4406 | sorted_ = true; |
| 4407 | 4407 | storage_invariants (); |
diff -rupN /hub/3rdparty/R2010b/151720/glnxa64/boost/include/boost/numeric/ublas/storage.hpp ublas/storage.hpp
|
old
|
new
|
namespace boost { namespace numeric { na
|
| 62 | 62 | data_ = 0; |
| 63 | 63 | } |
| 64 | 64 | explicit BOOST_UBLAS_INLINE |
| 65 | | unbounded_array (size_type size, const ALLOC &a = ALLOC()): |
| 66 | | alloc_(a), size_ (size) { |
| | 65 | unbounded_array (size_type size_arg, const ALLOC &a = ALLOC()): |
| | 66 | alloc_(a), size_ (size_arg) { |
| 67 | 67 | if (size_) { |
| 68 | 68 | data_ = alloc_.allocate (size_); |
| 69 | 69 | if (! detail::has_trivial_constructor<T>::value) { |
| … |
… |
namespace boost { namespace numeric { na
|
| 76 | 76 | } |
| 77 | 77 | // No value initialised, but still be default constructed |
| 78 | 78 | BOOST_UBLAS_INLINE |
| 79 | | unbounded_array (size_type size, const value_type &init, const ALLOC &a = ALLOC()): |
| 80 | | alloc_ (a), size_ (size) { |
| | 79 | unbounded_array (size_type size_arg, const value_type &init, const ALLOC &a = ALLOC()): |
| | 80 | alloc_ (a), size_ (size_arg) { |
| 81 | 81 | if (size_) { |
| 82 | 82 | data_ = alloc_.allocate (size_); |
| 83 | 83 | std::uninitialized_fill (begin(), end(), init); |
| … |
… |
namespace boost { namespace numeric { na
|
| 113 | 113 | // Resizing |
| 114 | 114 | private: |
| 115 | 115 | BOOST_UBLAS_INLINE |
| 116 | | void resize_internal (const size_type size, const value_type init, const bool preserve) { |
| 117 | | if (size != size_) { |
| | 116 | void resize_internal (const size_type size_arg, const value_type init, const bool preserve) { |
| | 117 | if (size_arg != size_) { |
| 118 | 118 | pointer p_data = data_; |
| 119 | | if (size) { |
| 120 | | data_ = alloc_.allocate (size); |
| | 119 | if (size_arg) { |
| | 120 | data_ = alloc_.allocate (size_arg); |
| 121 | 121 | if (preserve) { |
| 122 | 122 | pointer si = p_data; |
| 123 | 123 | pointer di = data_; |
| 124 | | if (size < size_) { |
| 125 | | for (; di != data_ + size; ++di) { |
| | 124 | if (size_arg < size_) { |
| | 125 | for (; di != data_ + size_arg; ++di) { |
| 126 | 126 | alloc_.construct (di, *si); |
| 127 | 127 | ++si; |
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | else { |
| 131 | | for (pointer si = p_data; si != p_data + size_; ++si) { |
| 132 | | alloc_.construct (di, *si); |
| | 131 | for (pointer si2 = p_data; si2 != p_data + size_; ++si2) { |
| | 132 | alloc_.construct (di, *si2); |
| 133 | 133 | ++di; |
| 134 | 134 | } |
| 135 | | for (; di != data_ + size; ++di) { |
| | 135 | for (; di != data_ + size_arg; ++di) { |
| 136 | 136 | alloc_.construct (di, init); |
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | else { |
| 141 | 141 | if (! detail::has_trivial_constructor<T>::value) { |
| 142 | | for (pointer di = data_; di != data_ + size; ++di) |
| | 142 | for (pointer di = data_; di != data_ + size_arg; ++di) |
| 143 | 143 | alloc_.construct (di, value_type()); |
| 144 | 144 | } |
| 145 | 145 | } |
| … |
… |
namespace boost { namespace numeric { na
|
| 153 | 153 | alloc_.deallocate (p_data, size_); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | | if (!size) |
| | 156 | if (!size_arg) |
| 157 | 157 | data_ = 0; |
| 158 | | size_ = size; |
| | 158 | size_ = size_arg; |
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | public: |
| 162 | 162 | BOOST_UBLAS_INLINE |
| 163 | | void resize (size_type size) { |
| 164 | | resize_internal (size, value_type (), false); |
| | 163 | void resize (size_type size_arg) { |
| | 164 | resize_internal (size_arg, value_type (), false); |
| 165 | 165 | } |
| 166 | 166 | BOOST_UBLAS_INLINE |
| 167 | | void resize (size_type size, value_type init) { |
| 168 | | resize_internal (size, init, true); |
| | 167 | void resize (size_type size_arg, value_type init) { |
| | 168 | resize_internal (size_arg, init, true); |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | // Random Access Container |
| … |
… |
namespace boost { namespace numeric { na
|
| 318 | 318 | size_ (0) /*, data_ ()*/ { // size 0 - use bounded_vector to default construct with size N |
| 319 | 319 | } |
| 320 | 320 | explicit BOOST_UBLAS_INLINE |
| 321 | | bounded_array (size_type size): |
| 322 | | size_ (size) /*, data_ ()*/ { |
| | 321 | bounded_array (size_type size_arg): |
| | 322 | size_ (size_arg) /*, data_ ()*/ { |
| 323 | 323 | BOOST_UBLAS_CHECK (size_ <= N, bad_size ()); |
| 324 | 324 | // data_ (an array) elements are already default constructed |
| 325 | 325 | } |
| 326 | 326 | BOOST_UBLAS_INLINE |
| 327 | | bounded_array (size_type size, const value_type &init): |
| 328 | | size_ (size) /*, data_ ()*/ { |
| | 327 | bounded_array (size_type size_arg, const value_type &init): |
| | 328 | size_ (size_arg) /*, data_ ()*/ { |
| 329 | 329 | BOOST_UBLAS_CHECK (size_ <= N, bad_size ()); |
| 330 | 330 | // ISSUE elements should be value constructed here, but we must fill instead as already default constructed |
| 331 | 331 | std::fill (begin(), end(), init) ; |
| … |
… |
namespace boost { namespace numeric { na
|
| 339 | 339 | |
| 340 | 340 | // Resizing |
| 341 | 341 | BOOST_UBLAS_INLINE |
| 342 | | void resize (size_type size) { |
| 343 | | BOOST_UBLAS_CHECK (size <= N, bad_size ()); |
| 344 | | size_ = size; |
| | 342 | void resize (size_type size_arg) { |
| | 343 | BOOST_UBLAS_CHECK (size_arg <= N, bad_size ()); |
| | 344 | size_ = size_arg; |
| 345 | 345 | } |
| 346 | 346 | BOOST_UBLAS_INLINE |
| 347 | | void resize (size_type size, value_type init) { |
| 348 | | BOOST_UBLAS_CHECK (size <= N, bad_size ()); |
| 349 | | if (size > size_) |
| 350 | | std::fill (data_ + size_, data_ + size, init); |
| 351 | | size_ = size; |
| | 347 | void resize (size_type size_arg, value_type init) { |
| | 348 | BOOST_UBLAS_CHECK (size_arg <= N, bad_size ()); |
| | 349 | if (size_arg > size_) |
| | 350 | std::fill (data_ + size_, data_ + size_arg, init); |
| | 351 | size_ = size_arg; |
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | // Random Access Container |
| … |
… |
namespace boost { namespace numeric { na
|
| 486 | 486 | // Construction and destruction |
| 487 | 487 | BOOST_UBLAS_INLINE |
| 488 | 488 | array_adaptor (): |
| 489 | | size_ (0), own_ (true), data_ (new value_type [0]) { |
| | 489 | size_ (0), own_ (true), |
| | 490 | data_ (new value_type [1]) // using 1 instead of 0 to eliminate a warning |
| | 491 | { |
| 490 | 492 | } |
| 491 | 493 | explicit BOOST_UBLAS_INLINE |
| 492 | | array_adaptor (size_type size): |
| 493 | | size_ (size), own_ (true), data_ (new value_type [size]) { |
| | 494 | array_adaptor (size_type size_arg): |
| | 495 | size_ (size_arg), own_ (true), data_ (new value_type [size_arg]) { |
| 494 | 496 | } |
| 495 | 497 | BOOST_UBLAS_INLINE |
| 496 | | array_adaptor (size_type size, const value_type &init): |
| 497 | | size_ (size), own_ (true), data_ (new value_type [size]) { |
| | 498 | array_adaptor (size_type size_arg, const value_type &init): |
| | 499 | size_ (size_arg), own_ (true), data_ (new value_type [size_arg]) { |
| 498 | 500 | std::fill (data_, data_ + size_, init); |
| 499 | 501 | } |
| 500 | 502 | BOOST_UBLAS_INLINE |
| 501 | | array_adaptor (size_type size, pointer data): |
| 502 | | size_ (size), own_ (false), data_ (data) {} |
| | 503 | array_adaptor (size_type size_arg, pointer data): |
| | 504 | size_ (size_arg), own_ (false), data_ (data) {} |
| 503 | 505 | BOOST_UBLAS_INLINE |
| 504 | 506 | array_adaptor (const array_adaptor &a): |
| 505 | 507 | storage_array<self_type> (), |
| … |
… |
namespace boost { namespace numeric { na
|
| 516 | 518 | // Resizing |
| 517 | 519 | private: |
| 518 | 520 | BOOST_UBLAS_INLINE |
| 519 | | void resize_internal (size_type size, value_type init, bool preserve = true) { |
| 520 | | if (size != size_) { |
| 521 | | pointer data = new value_type [size]; |
| | 521 | void resize_internal (size_type size_arg, value_type init, bool preserve = true) { |
| | 522 | if (size_arg != size_) { |
| | 523 | pointer data = new value_type [size_arg]; |
| 522 | 524 | if (preserve) { |
| 523 | | std::copy (data_, data_ + (std::min) (size, size_), data); |
| 524 | | std::fill (data + (std::min) (size, size_), data + size, init); |
| | 525 | std::copy (data_, data_ + (std::min) (size_arg, size_), data); |
| | 526 | std::fill (data + (std::min) (size_arg, size_), data + size_arg, init); |
| 525 | 527 | } |
| 526 | 528 | if (own_) |
| 527 | 529 | delete [] data_; |
| 528 | | size_ = size; |
| | 530 | size_ = size_arg; |
| 529 | 531 | own_ = true; |
| 530 | 532 | data_ = data; |
| 531 | 533 | } |
| 532 | 534 | } |
| 533 | 535 | BOOST_UBLAS_INLINE |
| 534 | | void resize_internal (size_type size, pointer data, value_type init, bool preserve = true) { |
| | 536 | void resize_internal (size_type size_arg, pointer data, value_type init, bool preserve = true) { |
| 535 | 537 | if (data != data_) { |
| 536 | 538 | if (preserve) { |
| 537 | | std::copy (data_, data_ + (std::min) (size, size_), data); |
| 538 | | std::fill (data + (std::min) (size, size_), data + size, init); |
| | 539 | std::copy (data_, data_ + (std::min) (size_arg, size_), data); |
| | 540 | std::fill (data + (std::min) (size_arg, size_), data + size_arg, init); |
| 539 | 541 | } |
| 540 | 542 | if (own_) |
| 541 | 543 | delete [] data_; |
| … |
… |
namespace boost { namespace numeric { na
|
| 543 | 545 | data_ = data; |
| 544 | 546 | } |
| 545 | 547 | else { |
| 546 | | std::fill (data + (std::min) (size, size_), data + size, init); |
| | 548 | std::fill (data + (std::min) (size_arg, size_), data + size_arg, init); |
| 547 | 549 | } |
| 548 | | size_ = size; |
| | 550 | size_ = size_arg; |
| 549 | 551 | } |
| 550 | 552 | public: |
| 551 | 553 | BOOST_UBLAS_INLINE |
| 552 | | void resize (size_type size) { |
| 553 | | resize_internal (size, value_type (), false); |
| | 554 | void resize (size_type size_arg) { |
| | 555 | resize_internal (size_arg, value_type (), false); |
| 554 | 556 | } |
| 555 | 557 | BOOST_UBLAS_INLINE |
| 556 | | void resize (size_type size, value_type init) { |
| 557 | | resize_internal (size, init, true); |
| | 558 | void resize (size_type size_arg, value_type init) { |
| | 559 | resize_internal (size_arg, init, true); |
| 558 | 560 | } |
| 559 | 561 | BOOST_UBLAS_INLINE |
| 560 | | void resize (size_type size, pointer data) { |
| 561 | | resize_internal (size, data, value_type (), false); |
| | 562 | void resize (size_type size_arg, pointer data) { |
| | 563 | resize_internal (size_arg, data, value_type (), false); |
| 562 | 564 | } |
| 563 | 565 | BOOST_UBLAS_INLINE |
| 564 | | void resize (size_type size, pointer data, value_type init) { |
| 565 | | resize_internal (size, data, init, true); |
| | 566 | void resize (size_type size_arg, pointer data, value_type init) { |
| | 567 | resize_internal (size_arg, data, init, true); |
| 566 | 568 | } |
| 567 | 569 | |
| 568 | 570 | BOOST_UBLAS_INLINE |
| … |
… |
namespace boost { namespace numeric { na
|
| 882 | 884 | basic_range (): |
| 883 | 885 | start_ (0), size_ (0) {} |
| 884 | 886 | BOOST_UBLAS_INLINE |
| 885 | | basic_range (size_type start, size_type stop): |
| 886 | | start_ (start), size_ (stop - start) { |
| | 887 | basic_range (size_type start_arg, size_type stop): |
| | 888 | start_ (start_arg), size_ (stop - start_arg) { |
| 887 | 889 | BOOST_UBLAS_CHECK (start_ <= stop, bad_index ()); |
| 888 | 890 | } |
| 889 | 891 | |
| … |
… |
namespace boost { namespace numeric { na
|
| 1055 | 1057 | } |
| 1056 | 1058 | |
| 1057 | 1059 | BOOST_UBLAS_INLINE |
| 1058 | | basic_range preprocess (size_type size) const { |
| | 1060 | basic_range preprocess (size_type size_arg) const { |
| 1059 | 1061 | if (this != &all_) |
| 1060 | 1062 | return *this; |
| 1061 | | return basic_range (0, size); |
| | 1063 | return basic_range (0, size_arg); |
| 1062 | 1064 | } |
| 1063 | 1065 | static |
| 1064 | 1066 | BOOST_UBLAS_INLINE |
| … |
… |
namespace boost { namespace numeric { na
|
| 1094 | 1096 | basic_slice (): |
| 1095 | 1097 | start_ (0), stride_ (0), size_ (0) {} |
| 1096 | 1098 | BOOST_UBLAS_INLINE |
| 1097 | | basic_slice (size_type start, difference_type stride, size_type size): |
| 1098 | | start_ (start), stride_ (stride), size_ (size) {} |
| | 1099 | basic_slice (size_type start_arg, difference_type stride_arg, size_type size_arg): |
| | 1100 | start_ (start_arg), stride_ (stride_arg), size_ (size_arg) {} |
| 1099 | 1101 | |
| 1100 | 1102 | BOOST_UBLAS_INLINE |
| 1101 | 1103 | size_type start () const { |
| … |
… |
namespace boost { namespace numeric { na
|
| 1274 | 1276 | } |
| 1275 | 1277 | |
| 1276 | 1278 | BOOST_UBLAS_INLINE |
| 1277 | | basic_slice preprocess (size_type size) const { |
| | 1279 | basic_slice preprocess (size_type size_arg) const { |
| 1278 | 1280 | if (this != &all_) |
| 1279 | 1281 | return *this; |
| 1280 | | return basic_slice (0, 1, size); |
| | 1282 | return basic_slice (0, 1, size_arg); |
| 1281 | 1283 | } |
| 1282 | 1284 | static |
| 1283 | 1285 | BOOST_UBLAS_INLINE |
| … |
… |
namespace boost { namespace numeric { na
|
| 1316 | 1318 | indirect_array (): |
| 1317 | 1319 | size_ (), data_ () {} |
| 1318 | 1320 | explicit BOOST_UBLAS_INLINE |
| 1319 | | indirect_array (size_type size): |
| 1320 | | size_ (size), data_ (size) {} |
| | 1321 | indirect_array (size_type size_arg): |
| | 1322 | size_ (size_arg), data_ (size_arg) {} |
| 1321 | 1323 | BOOST_UBLAS_INLINE |
| 1322 | | indirect_array (size_type size, const array_type &data): |
| 1323 | | size_ (size), data_ (data) {} |
| | 1324 | indirect_array (size_type size_arg, const array_type &data_arg): |
| | 1325 | size_ (size_arg), data_ (data_arg) {} |
| 1324 | 1326 | BOOST_UBLAS_INLINE |
| 1325 | 1327 | indirect_array (pointer start, pointer stop): |
| 1326 | 1328 | size_ (stop - start), data_ (stop - start) { |
| … |
… |
namespace boost { namespace numeric { na
|
| 1376 | 1378 | BOOST_UBLAS_INLINE |
| 1377 | 1379 | indirect_array compose (const basic_range<size_type, difference_type> &r) const { |
| 1378 | 1380 | BOOST_UBLAS_CHECK (r.start () + r.size () <= size_, bad_size ()); |
| 1379 | | array_type data (r.size ()); |
| | 1381 | array_type data_val (r.size ()); |
| 1380 | 1382 | for (size_type i = 0; i < r.size (); ++ i) |
| 1381 | | data [i] = data_ [r.start () + i]; |
| 1382 | | return indirect_array (r.size (), data); |
| | 1383 | data_val [i] = data_ [r.start () + i]; |
| | 1384 | return indirect_array (r.size (), data_val); |
| 1383 | 1385 | } |
| 1384 | 1386 | BOOST_UBLAS_INLINE |
| 1385 | 1387 | indirect_array compose (const basic_slice<size_type, difference_type> &s) const { |
| 1386 | 1388 | BOOST_UBLAS_CHECK (s.start () + s.stride () * (s.size () - (s.size () > 0)) <= size (), bad_size ()); |
| 1387 | | array_type data (s.size ()); |
| | 1389 | array_type data_val (s.size ()); |
| 1388 | 1390 | for (size_type i = 0; i < s.size (); ++ i) |
| 1389 | | data [i] = data_ [s.start () + s.stride () * i]; |
| 1390 | | return indirect_array (s.size (), data); |
| | 1391 | data_val [i] = data_ [s.start () + s.stride () * i]; |
| | 1392 | return indirect_array (s.size (), data_val); |
| 1391 | 1393 | } |
| 1392 | 1394 | BOOST_UBLAS_INLINE |
| 1393 | 1395 | indirect_array compose (const indirect_array &ia) const { |
| 1394 | | array_type data (ia.size_); |
| | 1396 | array_type data_val (ia.size_); |
| 1395 | 1397 | for (size_type i = 0; i < ia.size_; ++ i) { |
| 1396 | 1398 | BOOST_UBLAS_CHECK (ia.data_ [i] <= size_, bad_size ()); |
| 1397 | | data [i] = data_ [ia.data_ [i]]; |
| | 1399 | data_val [i] = data_ [ia.data_ [i]]; |
| 1398 | 1400 | } |
| 1399 | | return indirect_array (ia.size_, data); |
| | 1401 | return indirect_array (ia.size_, data_val); |
| 1400 | 1402 | } |
| 1401 | 1403 | |
| 1402 | 1404 | // Comparison |
| … |
… |
namespace boost { namespace numeric { na
|
| 1534 | 1536 | } |
| 1535 | 1537 | |
| 1536 | 1538 | BOOST_UBLAS_INLINE |
| 1537 | | indirect_array preprocess (size_type size) const { |
| | 1539 | indirect_array preprocess (size_type size_arg) const { |
| 1538 | 1540 | if (this != &all_) |
| 1539 | 1541 | return *this; |
| 1540 | | indirect_array ia (size); |
| 1541 | | for (size_type i = 0; i < size; ++ i) |
| | 1542 | indirect_array ia (size_arg); |
| | 1543 | for (size_type i = 0; i < size_arg; ++ i) |
| 1542 | 1544 | ia (i) = i; |
| 1543 | 1545 | return ia; |
| 1544 | 1546 | } |
| … |
… |
namespace boost { namespace numeric { na
|
| 1666 | 1668 | typedef const value_type const_reference; |
| 1667 | 1669 | |
| 1668 | 1670 | BOOST_UBLAS_INLINE |
| 1669 | | index_pair_array(size_type size, V1& data1, V2& data2) : |
| 1670 | | size_(size),data1_(data1),data2_(data2) {} |
| | 1671 | index_pair_array(size_type size_arg, V1& data1, V2& data2) : |
| | 1672 | size_(size_arg),data1_(data1),data2_(data2) {} |
| 1671 | 1673 | |
| 1672 | 1674 | BOOST_UBLAS_INLINE |
| 1673 | 1675 | size_type size() const { |
| … |
… |
namespace boost { namespace numeric { na
|
| 1841 | 1843 | typedef const value_type const_reference; |
| 1842 | 1844 | |
| 1843 | 1845 | BOOST_UBLAS_INLINE |
| 1844 | | index_triple_array(size_type size, V1& data1, V2& data2, V3& data3) : |
| 1845 | | size_(size),data1_(data1),data2_(data2),data3_(data3) {} |
| | 1846 | index_triple_array(size_type size_arg, V1& data1, V2& data2, V3& data3) : |
| | 1847 | size_(size_arg),data1_(data1),data2_(data2),data3_(data3) {} |
| 1846 | 1848 | |
| 1847 | 1849 | BOOST_UBLAS_INLINE |
| 1848 | 1850 | size_type size() const { |
diff -rupN /hub/3rdparty/R2010b/151720/glnxa64/boost/include/boost/numeric/ublas/storage_sparse.hpp ublas/storage_sparse.hpp
|
old
|
new
|
namespace boost { namespace numeric { na
|
| 263 | 263 | private: |
| 264 | 264 | // Resizing - implicitly exposses uninitialized (but default constructed) mapped_type |
| 265 | 265 | BOOST_UBLAS_INLINE |
| 266 | | void resize (size_type size) { |
| | 266 | void resize (size_type size_arg) { |
| 267 | 267 | BOOST_UBLAS_CHECK (size_ <= capacity_, internal_logic ()); |
| 268 | | if (size > capacity_) { |
| 269 | | const size_type capacity = size << 1; |
| 270 | | BOOST_UBLAS_CHECK (capacity, internal_logic ()); |
| 271 | | pointer data = alloc_.allocate (capacity); |
| 272 | | std::uninitialized_copy (data_, data_ + (std::min) (size, size_), data); |
| 273 | | std::uninitialized_fill (data + (std::min) (size, size_), data + capacity, value_type ()); |
| | 268 | if (size_arg > capacity_) { |
| | 269 | const size_type capacity_val = size_arg << 1; |
| | 270 | BOOST_UBLAS_CHECK (capacity_val, internal_logic ()); |
| | 271 | pointer data = alloc_.allocate (capacity_val); |
| | 272 | std::uninitialized_copy (data_, data_ + (std::min) (size_arg, size_), data); |
| | 273 | std::uninitialized_fill (data + (std::min) (size_arg, size_), data + capacity_val, value_type ()); |
| 274 | 274 | |
| 275 | 275 | if (capacity_) { |
| 276 | 276 | std::for_each (data_, data_ + capacity_, static_destroy); |
| 277 | 277 | alloc_.deallocate (data_, capacity_); |
| 278 | 278 | } |
| 279 | | capacity_ = capacity; |
| | 279 | capacity_ = capacity_val; |
| 280 | 280 | data_ = data; |
| 281 | 281 | } |
| 282 | | size_ = size; |
| | 282 | size_ = size_arg; |
| 283 | 283 | BOOST_UBLAS_CHECK (size_ <= capacity_, internal_logic ()); |
| 284 | 284 | } |
| 285 | 285 | public: |
| 286 | 286 | |
| 287 | 287 | // Reserving |
| 288 | 288 | BOOST_UBLAS_INLINE |
| 289 | | void reserve (size_type capacity) { |
| | 289 | void reserve (size_type capacity_arg) { |
| 290 | 290 | BOOST_UBLAS_CHECK (size_ <= capacity_, internal_logic ()); |
| 291 | 291 | // Reduce capacity_ if size_ allows |
| 292 | | BOOST_UBLAS_CHECK (capacity >= size_, bad_size ()); |
| | 292 | BOOST_UBLAS_CHECK (capacity_arg >= size_, bad_size ()); |
| 293 | 293 | pointer data; |
| 294 | | if (capacity) { |
| 295 | | data = alloc_.allocate (capacity); |
| | 294 | if (capacity_arg) { |
| | 295 | data = alloc_.allocate (capacity_arg); |
| 296 | 296 | std::uninitialized_copy (data_, data_ + size_, data); |
| 297 | | std::uninitialized_fill (data + size_, data + capacity, value_type ()); |
| | 297 | std::uninitialized_fill (data + size_, data + capacity_arg, value_type ()); |
| 298 | 298 | } |
| 299 | 299 | else |
| 300 | 300 | data = 0; |
| … |
… |
namespace boost { namespace numeric { na
|
| 303 | 303 | std::for_each (data_, data_ + capacity_, static_destroy); |
| 304 | 304 | alloc_.deallocate (data_, capacity_); |
| 305 | 305 | } |
| 306 | | capacity_ = capacity; |
| | 306 | capacity_ = capacity_arg; |
| 307 | 307 | data_ = data; |
| 308 | 308 | BOOST_UBLAS_CHECK (size_ <= capacity_, internal_logic ()); |
| 309 | 309 | } |
diff -rupN /hub/3rdparty/R2010b/151720/glnxa64/boost/include/boost/numeric/ublas/vector.hpp ublas/vector.hpp
|
old
|
new
|
namespace boost { namespace numeric { na
|
| 52 | 52 | vector_container<self_type> (), |
| 53 | 53 | data_ () {} |
| 54 | 54 | explicit BOOST_UBLAS_INLINE |
| 55 | | vector (size_type size): |
| | 55 | vector (size_type size_arg): |
| 56 | 56 | vector_container<self_type> (), |
| 57 | | data_ (size) { |
| | 57 | data_ (size_arg) { |
| 58 | 58 | } |
| 59 | 59 | BOOST_UBLAS_INLINE |
| 60 | | vector (size_type size, const array_type &data): |
| | 60 | vector (size_type size_arg, const array_type &data_arg): |
| 61 | 61 | vector_container<self_type> (), |
| 62 | | data_ (data) {} |
| | 62 | data_ (data_arg) {} |
| 63 | 63 | BOOST_UBLAS_INLINE |
| 64 | | vector (size_type size, const value_type &init): |
| | 64 | vector (size_type size_arg, const value_type &init): |
| 65 | 65 | vector_container<self_type> (), |
| 66 | | data_ (size, init) {} |
| | 66 | data_ (size_arg, init) {} |
| 67 | 67 | BOOST_UBLAS_INLINE |
| 68 | 68 | vector (const vector &v): |
| 69 | 69 | vector_container<self_type> (), |
| … |
… |
namespace boost { namespace numeric { na
|
| 104 | 104 | |
| 105 | 105 | // Resizing |
| 106 | 106 | BOOST_UBLAS_INLINE |
| 107 | | void resize (size_type size, bool preserve = true) { |
| | 107 | void resize (size_type size_arg, bool preserve = true) { |
| 108 | 108 | if (preserve) |
| 109 | | data ().resize (size, typename A::value_type ()); |
| | 109 | data ().resize (size_arg, typename A::value_type ()); |
| 110 | 110 | else |
| 111 | | data ().resize (size); |
| | 111 | data ().resize (size_arg); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | // Element support |
| … |
… |
namespace boost { namespace numeric { na
|
| 602 | 602 | vector_container<self_type> (), |
| 603 | 603 | size_ (0) {} |
| 604 | 604 | explicit BOOST_UBLAS_INLINE |
| 605 | | zero_vector (size_type size): |
| | 605 | zero_vector (size_type size_arg): |
| 606 | 606 | vector_container<self_type> (), |
| 607 | | size_ (size) {} |
| | 607 | size_ (size_arg) {} |
| 608 | 608 | BOOST_UBLAS_INLINE |
| 609 | 609 | zero_vector (const zero_vector &v): |
| 610 | 610 | vector_container<self_type> (), |
| … |
… |
namespace boost { namespace numeric { na
|
| 618 | 618 | |
| 619 | 619 | // Resizing |
| 620 | 620 | BOOST_UBLAS_INLINE |
| 621 | | void resize (size_type size, bool /*preserve*/ = true) { |
| 622 | | size_ = size; |
| | 621 | void resize (size_type size_arg, bool /*preserve*/ = true) { |
| | 622 | size_ = size_arg; |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | // Element support |
| … |
… |
namespace boost { namespace numeric { na
|
| 802 | 802 | vector_container<self_type> (), |
| 803 | 803 | size_ (0), index_ (0) {} |
| 804 | 804 | BOOST_UBLAS_INLINE |
| 805 | | explicit unit_vector (size_type size, size_type index = 0): |
| | 805 | explicit unit_vector (size_type size_arg, size_type index_arg = 0): |
| 806 | 806 | vector_container<self_type> (), |
| 807 | | size_ (size), index_ (index) {} |
| | 807 | size_ (size_arg), index_ (index_arg) {} |
| 808 | 808 | BOOST_UBLAS_INLINE |
| 809 | 809 | unit_vector (const unit_vector &v): |
| 810 | 810 | vector_container<self_type> (), |
| … |
… |
namespace boost { namespace numeric { na
|
| 822 | 822 | |
| 823 | 823 | // Resizing |
| 824 | 824 | BOOST_UBLAS_INLINE |
| 825 | | void resize (size_type size, bool /*preserve*/ = true) { |
| 826 | | size_ = size; |
| | 825 | void resize (size_type size_arg, bool /*preserve*/ = true) { |
| | 826 | size_ = size_arg; |
| 827 | 827 | } |
| 828 | 828 | |
| 829 | 829 | // Element support |
| … |
… |
namespace boost { namespace numeric { na
|
| 1027 | 1027 | vector_container<self_type> (), |
| 1028 | 1028 | size_ (0), value_ () {} |
| 1029 | 1029 | BOOST_UBLAS_INLINE |
| 1030 | | explicit scalar_vector (size_type size, const value_type &value = value_type(1)): |
| | 1030 | explicit scalar_vector (size_type size_arg, const value_type &value = value_type(1)): |
| 1031 | 1031 | vector_container<self_type> (), |
| 1032 | | size_ (size), value_ (value) {} |
| | 1032 | size_ (size_arg), value_ (value) {} |
| 1033 | 1033 | BOOST_UBLAS_INLINE |
| 1034 | 1034 | scalar_vector (const scalar_vector &v): |
| 1035 | 1035 | vector_container<self_type> (), |
| … |
… |
namespace boost { namespace numeric { na
|
| 1043 | 1043 | |
| 1044 | 1044 | // Resizing |
| 1045 | 1045 | BOOST_UBLAS_INLINE |
| 1046 | | void resize (size_type size, bool /*preserve*/ = true) { |
| 1047 | | size_ = size; |
| | 1046 | void resize (size_type size_arg, bool /*preserve*/ = true) { |
| | 1047 | size_ = size_arg; |
| 1048 | 1048 | } |
| 1049 | 1049 | |
| 1050 | 1050 | // Element support |
| … |
… |
namespace boost { namespace numeric { na
|
| 1266 | 1266 | c_vector (): |
| 1267 | 1267 | size_ (N) /* , data_ () */ {} |
| 1268 | 1268 | explicit BOOST_UBLAS_INLINE |
| 1269 | | c_vector (size_type size): |
| 1270 | | size_ (size) /* , data_ () */ { |
| | 1269 | c_vector (size_type size_arg): |
| | 1270 | size_ (size_arg) /* , data_ () */ { |
| 1271 | 1271 | if (size_ > N) |
| 1272 | 1272 | bad_size ().raise (); |
| 1273 | 1273 | } |
| … |
… |
namespace boost { namespace numeric { na
|
| 1303 | 1303 | |
| 1304 | 1304 | // Resizing |
| 1305 | 1305 | BOOST_UBLAS_INLINE |
| 1306 | | void resize (size_type size, bool preserve = true) { |
| 1307 | | if (size > N) |
| | 1306 | void resize (size_type size_arg, bool preserve = true) { |
| | 1307 | if (size_arg > N) |
| 1308 | 1308 | bad_size ().raise (); |
| 1309 | | size_ = size; |
| | 1309 | size_ = size_arg; |
| 1310 | 1310 | } |
| 1311 | 1311 | |
| 1312 | 1312 | // Element support |
diff -rupN /hub/3rdparty/R2010b/151720/glnxa64/boost/include/boost/numeric/ublas/vector_sparse.hpp ublas/vector_sparse.hpp
|
old
|
new
|
namespace boost { namespace numeric { na
|
| 294 | 294 | vector_container<self_type> (), |
| 295 | 295 | size_ (0), data_ () {} |
| 296 | 296 | BOOST_UBLAS_INLINE |
| 297 | | mapped_vector (size_type size, size_type non_zeros = 0): |
| | 297 | mapped_vector (size_type size_arg, size_type non_zeros = 0): |
| 298 | 298 | vector_container<self_type> (), |
| 299 | | size_ (size), data_ () { |
| | 299 | size_ (size_arg), data_ () { |
| 300 | 300 | detail::map_reserve (data(), restrict_capacity (non_zeros)); |
| 301 | 301 | } |
| 302 | 302 | BOOST_UBLAS_INLINE |
| … |
… |
namespace boost { namespace numeric { na
|
| 345 | 345 | } |
| 346 | 346 | public: |
| 347 | 347 | BOOST_UBLAS_INLINE |
| 348 | | void resize (size_type size, bool preserve = true) { |
| 349 | | size_ = size; |
| | 348 | void resize (size_type size_arg, bool preserve = true) { |
| | 349 | size_ = size_arg; |
| 350 | 350 | if (preserve) { |
| 351 | 351 | data ().erase (data ().lower_bound(size_), data ().end()); |
| 352 | 352 | } |
| … |
… |
namespace boost { namespace numeric { na
|
| 796 | 796 | storage_invariants (); |
| 797 | 797 | } |
| 798 | 798 | explicit BOOST_UBLAS_INLINE |
| 799 | | compressed_vector (size_type size, size_type non_zeros = 0): |
| | 799 | compressed_vector (size_type size_arg, size_type non_zeros = 0): |
| 800 | 800 | vector_container<self_type> (), |
| 801 | | size_ (size), capacity_ (restrict_capacity (non_zeros)), filled_ (0), |
| | 801 | size_ (size_arg), capacity_ (restrict_capacity (non_zeros)), filled_ (0), |
| 802 | 802 | index_data_ (capacity_), value_data_ (capacity_) { |
| 803 | 803 | storage_invariants (); |
| 804 | 804 | } |
| … |
… |
namespace boost { namespace numeric { na
|
| 851 | 851 | return value_data_; |
| 852 | 852 | } |
| 853 | 853 | BOOST_UBLAS_INLINE |
| 854 | | void set_filled (const typename index_array_type::size_type & filled) { |
| 855 | | filled_ = filled; |
| | 854 | void set_filled (const typename index_array_type::size_type & filled_arg) { |
| | 855 | filled_ = filled_arg; |
| 856 | 856 | storage_invariants (); |
| 857 | 857 | } |
| 858 | 858 | BOOST_UBLAS_INLINE |
| … |
… |
namespace boost { namespace numeric { na
|
| 874 | 874 | } |
| 875 | 875 | public: |
| 876 | 876 | BOOST_UBLAS_INLINE |
| 877 | | void resize (size_type size, bool preserve = true) { |
| 878 | | size_ = size; |
| | 877 | void resize (size_type size_arg, bool preserve = true) { |
| | 878 | size_ = size_arg; |
| 879 | 879 | capacity_ = restrict_capacity (capacity_); |
| 880 | 880 | if (preserve) { |
| 881 | 881 | index_data_. resize (capacity_, size_type ()); |
| 882 | 882 | value_data_. resize (capacity_, value_type ()); |
| 883 | 883 | filled_ = (std::min) (capacity_, filled_); |
| 884 | | while ((filled_ > 0) && (zero_based(index_data_[filled_ - 1]) >= size)) { |
| | 884 | while ((filled_ > 0) && (zero_based(index_data_[filled_ - 1]) >= size_arg)) { |
| 885 | 885 | --filled_; |
| 886 | 886 | } |
| 887 | 887 | } |
| … |
… |
namespace boost { namespace numeric { na
|
| 1417 | 1417 | storage_invariants (); |
| 1418 | 1418 | } |
| 1419 | 1419 | explicit BOOST_UBLAS_INLINE |
| 1420 | | coordinate_vector (size_type size, size_type non_zeros = 0): |
| | 1420 | coordinate_vector (size_type size_arg, size_type non_zeros = 0): |
| 1421 | 1421 | vector_container<self_type> (), |
| 1422 | | size_ (size), capacity_ (restrict_capacity (non_zeros)), |
| | 1422 | size_ (size_arg), capacity_ (restrict_capacity (non_zeros)), |
| 1423 | 1423 | filled_ (0), sorted_filled_ (filled_), sorted_ (true), |
| 1424 | 1424 | index_data_ (capacity_), value_data_ (capacity_) { |
| 1425 | 1425 | storage_invariants (); |
| … |
… |
namespace boost { namespace numeric { na
|
| 1475 | 1475 | return value_data_; |
| 1476 | 1476 | } |
| 1477 | 1477 | BOOST_UBLAS_INLINE |
| 1478 | | void set_filled (const typename index_array_type::size_type &sorted, const typename index_array_type::size_type &filled) { |
| | 1478 | void set_filled (const typename index_array_type::size_type &sorted, const typename index_array_type::size_type &filled_arg) { |
| 1479 | 1479 | sorted_filled_ = sorted; |
| 1480 | | filled_ = filled; |
| | 1480 | filled_ = filled_arg; |
| 1481 | 1481 | storage_invariants (); |
| 1482 | 1482 | return filled_; |
| 1483 | 1483 | } |
| … |
… |
namespace boost { namespace numeric { na
|
| 1501 | 1501 | } |
| 1502 | 1502 | public: |
| 1503 | 1503 | BOOST_UBLAS_INLINE |
| 1504 | | void resize (size_type size, bool preserve = true) { |
| | 1504 | void resize (size_type size_arg, bool preserve = true) { |
| 1505 | 1505 | if (preserve) |
| 1506 | 1506 | sort (); // remove duplicate elements. |
| 1507 | | size_ = size; |
| | 1507 | size_ = size_arg; |
| 1508 | 1508 | capacity_ = restrict_capacity (capacity_); |
| 1509 | 1509 | if (preserve) { |
| 1510 | 1510 | index_data_. resize (capacity_, size_type ()); |
| 1511 | 1511 | value_data_. resize (capacity_, value_type ()); |
| 1512 | 1512 | filled_ = (std::min) (capacity_, filled_); |
| 1513 | | while ((filled_ > 0) && (zero_based(index_data_[filled_ - 1]) >= size)) { |
| | 1513 | while ((filled_ > 0) && (zero_based(index_data_[filled_ - 1]) >= size_arg)) { |
| 1514 | 1514 | --filled_; |
| 1515 | 1515 | } |
| 1516 | 1516 | } |
| … |
… |
namespace boost { namespace numeric { na
|
| 1758 | 1758 | std::inplace_merge (ipa.begin (), iunsorted, ipa.end ()); |
| 1759 | 1759 | |
| 1760 | 1760 | // sum duplicates with += and remove |
| 1761 | | size_type filled = 0; |
| | 1761 | size_type filled_val = 0; |
| 1762 | 1762 | for (size_type i = 1; i < filled_; ++ i) { |
| 1763 | | if (index_data_ [filled] != index_data_ [i]) { |
| 1764 | | ++ filled; |
| 1765 | | if (filled != i) { |
| 1766 | | index_data_ [filled] = index_data_ [i]; |
| 1767 | | value_data_ [filled] = value_data_ [i]; |
| | 1763 | if (index_data_ [filled_val] != index_data_ [i]) { |
| | 1764 | ++ filled_val; |
| | 1765 | if (filled_val != i) { |
| | 1766 | index_data_ [filled_val] = index_data_ [i]; |
| | 1767 | value_data_ [filled_val] = value_data_ [i]; |
| 1768 | 1768 | } |
| 1769 | 1769 | } else { |
| 1770 | | value_data_ [filled] += value_data_ [i]; |
| | 1770 | value_data_ [filled_val] += value_data_ [i]; |
| 1771 | 1771 | } |
| 1772 | 1772 | } |
| 1773 | | filled_ = filled + 1; |
| | 1773 | filled_ = filled_val + 1; |
| 1774 | 1774 | sorted_filled_ = filled_; |
| 1775 | 1775 | sorted_ = true; |
| 1776 | 1776 | storage_invariants (); |