Ticket #3728: ublas.patch

File ublas.patch, 65.2 KB (added by marc.schafer@…, 13 years ago)
  • ublas/detail/matrix_assign.hpp

    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 {  
    7474                if (it2 != it2_end && it2e != it2e_end) {
    7575                    size_type it2_index = it2.index2 (), it2e_index = it2e.index2 ();
    7676                    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) {
    7979                            ++ it2, ++ it2e;
    8080                            if (it2 != it2_end && it2e != it2e_end) {
    8181                                it2_index = it2.index2 ();
    8282                                it2e_index = it2e.index2 ();
    8383                            } else
    8484                                break;
    85                         } else if (compare < 0) {
    86                             increment (it2, it2_end, - compare);
     85                        } else if (compare2 < 0) {
     86                            increment (it2, it2_end, - compare2);
    8787                            if (it2 != it2_end)
    8888                                it2_index = it2.index2 ();
    8989                            else
    9090                                break;
    91                         } else if (compare > 0) {
     91                        } else if (compare2 > 0) {
    9292                            if (conformant_restrict_type::other (it2e.index1 (), it2e.index2 ()))
    9393                                if (*it2e != value_type/*zero*/())
    9494                                    index.push_back (std::pair<size_type, size_type> (it2e.index1 (), it2e.index2 ()));
    namespace detail {  
    177177                if (it1 != it1_end && it1e != it1e_end) {
    178178                    size_type it1_index = it1.index1 (), it1e_index = it1e.index1 ();
    179179                    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) {
    182182                            ++ it1, ++ it1e;
    183183                            if (it1 != it1_end && it1e != it1e_end) {
    184184                                it1_index = it1.index1 ();
    185185                                it1e_index = it1e.index1 ();
    186186                            } else
    187187                                break;
    188                         } else if (compare < 0) {
    189                             increment (it1, it1_end, - compare);
     188                        } else if (compare2 < 0) {
     189                            increment (it1, it1_end, - compare2);
    190190                            if (it1 != it1_end)
    191191                                it1_index = it1.index1 ();
    192192                            else
    193193                                break;
    194                         } else if (compare > 0) {
     194                        } else if (compare2 > 0) {
    195195                            if (conformant_restrict_type::other (it1e.index1 (), it1e.index2 ()))
    196196                                if (*it1e != value_type/*zero*/())
    197197                                    index.push_back (std::pair<size_type, size_type> (it1e.index1 (), it1e.index2 ()));
    namespace detail {  
    993993                if (it2 != it2_end && it2e != it2e_end) {
    994994                    size_type it2_index = it2.index2 (), it2e_index = it2e.index2 ();
    995995                    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) {
    998998                            functor_type::apply (*it2, *it2e);
    999999                            ++ it2, ++ it2e;
    10001000                            if (it2 != it2_end && it2e != it2e_end) {
    namespace detail {  
    10021002                                it2e_index = it2e.index2 ();
    10031003                            } else
    10041004                                break;
    1005                         } else if (compare < 0) {
     1005                        } else if (compare2 < 0) {
    10061006                            if (!functor_type::computed) {
    10071007                                functor_type::apply (*it2, value_type/*zero*/());
    10081008                                ++ it2;
    10091009                            } else
    1010                                 increment (it2, it2_end, - compare);
     1010                                increment (it2, it2_end, - compare2);
    10111011                            if (it2 != it2_end)
    10121012                                it2_index = it2.index2 ();
    10131013                            else
    10141014                                break;
    1015                         } else if (compare > 0) {
    1016                             increment (it2e, it2e_end, compare);
     1015                        } else if (compare2 > 0) {
     1016                            increment (it2e, it2e_end, compare2);
    10171017                            if (it2e != it2e_end)
    10181018                                it2e_index = it2e.index2 ();
    10191019                            else
    namespace detail {  
    11131113                if (it1 != it1_end && it1e != it1e_end) {
    11141114                    size_type it1_index = it1.index1 (), it1e_index = it1e.index1 ();
    11151115                    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) {
    11181118                            functor_type::apply (*it1, *it1e);
    11191119                            ++ it1, ++ it1e;
    11201120                            if (it1 != it1_end && it1e != it1e_end) {
    namespace detail {  
    11221122                                it1e_index = it1e.index1 ();
    11231123                            } else
    11241124                                break;
    1125                         } else if (compare < 0) {
     1125                        } else if (compare2 < 0) {
    11261126                            if (!functor_type::computed) {
    11271127                                functor_type::apply (*it1, value_type/*zero*/()); // zeroing
    11281128                                ++ it1;
    11291129                            } else
    1130                                 increment (it1, it1_end, - compare);
     1130                                increment (it1, it1_end, - compare2);
    11311131                            if (it1 != it1_end)
    11321132                                it1_index = it1.index1 ();
    11331133                            else
    11341134                                break;
    1135                         } else if (compare > 0) {
    1136                             increment (it1e, it1e_end, compare);
     1135                        } else if (compare2 > 0) {
     1136                            increment (it1e, it1e_end, compare2);
    11371137                            if (it1e != it1e_end)
    11381138                                it1e_index = it1e.index1 ();
    11391139                            else
    namespace detail {  
    13811381                if (it2 != it2_end && it2e != it2e_end) {
    13821382                    size_type it2_index = it2.index2 (), it2e_index = it2e.index2 ();
    13831383                    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) {
    13861386                            functor_type::apply (*it2, *it2e);
    13871387                            ++ it2, ++ it2e;
    13881388                            if (it2 != it2_end && it2e != it2e_end) {
    namespace detail {  
    13901390                                it2e_index = it2e.index2 ();
    13911391                            } else
    13921392                                break;
    1393                         } else if (compare < 0) {
    1394                             increment (it2, it2_end, - compare);
     1393                        } else if (compare2 < 0) {
     1394                            increment (it2, it2_end, - compare2);
    13951395                            if (it2 != it2_end)
    13961396                                it2_index = it2.index2 ();
    13971397                            else
    13981398                                break;
    1399                         } else if (compare > 0) {
    1400                             increment (it2e, it2e_end, compare);
     1399                        } else if (compare2 > 0) {
     1400                            increment (it2e, it2e_end, compare2);
    14011401                            if (it2e != it2e_end)
    14021402                                it2e_index = it2e.index2 ();
    14031403                            else
    namespace detail {  
    15061506                if (it1 != it1_end && it1e != it1e_end) {
    15071507                    size_type it1_index = it1.index1 (), it1e_index = it1e.index1 ();
    15081508                    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) {
    15111511                            functor_type::apply (*it1, *it1e);
    15121512                            ++ it1, ++ it1e;
    15131513                            if (it1 != it1_end && it1e != it1e_end) {
    namespace detail {  
    15151515                                it1e_index = it1e.index1 ();
    15161516                            } else
    15171517                                break;
    1518                         }  else if (compare < 0) {
    1519                             increment (it1, it1_end, - compare);
     1518                        }  else if (compare2 < 0) {
     1519                            increment (it1, it1_end, - compare2);
    15201520                            if (it1 != it1_end)
    15211521                                it1_index = it1.index1 ();
    15221522                            else
    15231523                                break;
    1524                         } else if (compare > 0) {
    1525                             increment (it1e, it1e_end, compare);
     1524                        } else if (compare2 > 0) {
     1525                            increment (it1e, it1e_end, compare2);
    15261526                            if (it1e != it1e_end)
    15271527                                it1e_index = it1e.index1 ();
    15281528                            else
  • ublas/matrix.hpp

    diff -rupN /hub/3rdparty/R2010b/151720/glnxa64/boost/include/boost/numeric/ublas/matrix.hpp ublas/matrix.hpp
    old new namespace boost { namespace numeric { na  
    9292            matrix_container<self_type> (),
    9393            size1_ (0), size2_ (0), data_ () {}
    9494        BOOST_UBLAS_INLINE
    95         matrix (size_type size1, size_type size2):
     95        matrix (size_type size1_arg, size_type size2_arg):
    9696            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)) {
    9898        }
    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):
    100100            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) {
    102102        }
    103103        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):
    105105            matrix_container<self_type> (),
    106             size1_ (size1), size2_ (size2), data_ (data) {}
     106            size1_ (size1_arg), size2_ (size2_arg), data_ (data_arg) {}
    107107        BOOST_UBLAS_INLINE
    108108        matrix (const matrix &m):
    109109            matrix_container<self_type> (),
    namespace boost { namespace numeric { na  
    138138
    139139        // Resizing
    140140        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) {
    142142            if (preserve) {
    143                 self_type temporary (size1, size2);
     143                self_type temporary (size1_arg, size2_arg);
    144144                detail::matrix_resize_preserve<layout_type> (*this, temporary);
    145145            }
    146146            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;
    150150            }
    151151        }
    152152
    namespace boost { namespace numeric { na  
    10651065            matrix_container<self_type> (),
    10661066            size1_ (0), size2_ (0), data_ (1) {}
    10671067        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):
    10691069            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);
    10721072        }
    10731073        BOOST_UBLAS_INLINE
    10741074        vector_of_vector (const vector_of_vector &m):
    namespace boost { namespace numeric { na  
    11061106
    11071107        // Resizing
    11081108        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;
    11121112            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 ());
    11141114            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) {
    11171117                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 ());
    11191119                else
    1120                     data () [k].resize (layout_type::size_m (size1, size2));
     1120                    data () [k].resize (layout_type::size_m (size1_arg, size2_arg));
    11211121            }
    11221122        }
    11231123
    namespace boost { namespace numeric { na  
    20432043            matrix_container<self_type> (),
    20442044            size1_ (size), size2_ (size) {}
    20452045        BOOST_UBLAS_INLINE
    2046         zero_matrix (size_type size1, size_type size2):
     2046        zero_matrix (size_type size1_arg, size_type size2_arg):
    20472047            matrix_container<self_type> (),
    2048             size1_ (size1), size2_ (size2) {}
     2048            size1_ (size1_arg), size2_ (size2_arg) {}
    20492049        BOOST_UBLAS_INLINE
    20502050        zero_matrix (const zero_matrix &m):
    20512051            matrix_container<self_type> (),
    namespace boost { namespace numeric { na  
    20682068            size2_ = size;
    20692069        }
    20702070        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;
    20742074        }
    20752075
    20762076        // Element access
    namespace boost { namespace numeric { na  
    24232423            matrix_container<self_type> (),
    24242424            size1_ (size), size2_ (size), size_common_ ((std::min) (size1_, size2_)) {}
    24252425        BOOST_UBLAS_INLINE
    2426         identity_matrix (size_type size1, size_type size2):
     2426        identity_matrix (size_type size1_arg, size_type size2_arg):
    24272427            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_)) {}
    24292429        BOOST_UBLAS_INLINE
    24302430        identity_matrix (const identity_matrix &m):
    24312431            matrix_container<self_type> (),
    namespace boost { namespace numeric { na  
    24482448            size2_ = size;
    24492449        }
    24502450        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;
    24542454        }
    24552455
    24562456        // Element access
    namespace boost { namespace numeric { na  
    28242824            matrix_container<self_type> (),
    28252825            size1_ (0), size2_ (0), value_ () {}
    28262826        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)):
    28282828            matrix_container<self_type> (),
    2829             size1_ (size1), size2_ (size2), value_ (value) {}
     2829            size1_ (size1_arg), size2_ (size2_arg), value_ (value) {}
    28302830        BOOST_UBLAS_INLINE
    28312831        scalar_matrix (const scalar_matrix &m):
    28322832            matrix_container<self_type> (),
    namespace boost { namespace numeric { na  
    28442844
    28452845        // Resizing
    28462846        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;
    28502850        }
    28512851
    28522852        // Element access
    namespace boost { namespace numeric { na  
    32843284            size1_ (N), size2_ (M) /* , data_ () */ {
    32853285        }
    32863286        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_ () */ {
    32893289            if (size1_ > N || size2_ > M)
    32903290                bad_size ().raise ();
    32913291        }
    namespace boost { namespace numeric { na  
    33253325
    33263326        // Resizing
    33273327        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)
    33303330                bad_size ().raise ();
    33313331            if (preserve) {
    3332                 self_type temporary (size1, size2);
     3332                self_type temporary (size1_arg, size2_arg);
    33333333                // 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_);
    33363336                for (size_type i = 0; i != size1_min; ++i) {    // indexing copy over major
    33373337                    for (size_type j = 0; j != size2_min; ++j) {
    33383338                        temporary.data_[i][j] = data_[i][j];
    namespace boost { namespace numeric { na  
    33413341                assign_temporary (temporary);
    33423342            }
    33433343            else {
    3344                 size1_ = size1;
    3345                 size2_ = size2;
     3344                size1_ = size1_arg;
     3345                size2_ = size2_arg;
    33463346            }
    33473347        }
    33483348
  • ublas/matrix_expression.hpp

    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  
    19181918            // Sparse specializations
    19191919            BOOST_UBLAS_INLINE
    19201920            void increment (sparse_bidirectional_iterator_tag) {
    1921                 size_type index1 = (*this) ().size1 ();
     1921                size_type index1_val = (*this) ().size1 ();
    19221922                if (it1_ != it1_end_) {
    19231923                    if (it1_.index1 () <= i_)
    19241924                        ++ it1_;
    19251925                    if (it1_ != it1_end_)
    1926                         index1 = it1_.index1 ();
     1926                        index1_val = it1_.index1 ();
    19271927                }
    1928                 size_type index2 = (*this) ().size1 ();
     1928                size_type index2_val = (*this) ().size1 ();
    19291929                if (it2_ != it2_end_)
    19301930                    if (it2_.index1 () <= i_)
    19311931                        ++ it2_;
    19321932                    if (it2_ != it2_end_) {
    1933                         index2 = it2_.index1 ();
     1933                        index2_val = it2_.index1 ();
    19341934                }
    1935                 i_ = (std::min) (index1, index2);
     1935                i_ = (std::min) (index1_val, index2_val);
    19361936            }
    19371937            BOOST_UBLAS_INLINE
    19381938            void decrement (sparse_bidirectional_iterator_tag) {
    1939                 size_type index1 = (*this) ().size1 ();
     1939                size_type index1_val = (*this) ().size1 ();
    19401940                if (it1_ != it1_end_) {
    19411941                    if (i_ <= it1_.index1 ())
    19421942                        -- it1_;
    19431943                    if (it1_ != it1_end_)
    1944                         index1 = it1_.index1 ();
     1944                        index1_val = it1_.index1 ();
    19451945                }
    1946                 size_type index2 = (*this) ().size1 ();
     1946                size_type index2_val = (*this) ().size1 ();
    19471947                if (it2_ != it2_end_) {
    19481948                    if (i_ <= it2_.index1 ())
    19491949                        -- it2_;
    19501950                    if (it2_ != it2_end_)
    1951                         index2 = it2_.index1 ();
     1951                        index2_val = it2_.index1 ();
    19521952                }
    1953                 i_ = (std::max) (index1, index2);
     1953                i_ = (std::max) (index1_val, index2_val);
    19541954            }
    19551955            BOOST_UBLAS_INLINE
    19561956            void increment (sparse_bidirectional_iterator_tag, difference_type n) {
    namespace boost { namespace numeric { na  
    22332233            // Sparse specializations
    22342234            BOOST_UBLAS_INLINE
    22352235            void increment (sparse_bidirectional_iterator_tag) {
    2236                 size_type index1 = (*this) ().size2 ();
     2236                size_type index1_val = (*this) ().size2 ();
    22372237                if (it1_ != it1_end_) {
    22382238                    if (it1_.index2 () <= j_)
    22392239                        ++ it1_;
    22402240                    if (it1_ != it1_end_)
    2241                         index1 = it1_.index2 ();
     2241                        index1_val = it1_.index2 ();
    22422242                }
    2243                 size_type index2 = (*this) ().size2 ();
     2243                size_type index2_val = (*this) ().size2 ();
    22442244                if (it2_ != it2_end_) {
    22452245                    if (it2_.index2 () <= j_)
    22462246                        ++ it2_;
    22472247                    if (it2_ != it2_end_)
    2248                         index2 = it2_.index2 ();
     2248                        index2_val = it2_.index2 ();
    22492249                }
    2250                 j_ = (std::min) (index1, index2);
     2250                j_ = (std::min) (index1_val, index2_val);
    22512251            }
    22522252            BOOST_UBLAS_INLINE
    22532253            void decrement (sparse_bidirectional_iterator_tag) {
    2254                 size_type index1 = (*this) ().size2 ();
     2254                size_type index1_val = (*this) ().size2 ();
    22552255                if (it1_ != it1_end_) {
    22562256                    if (j_ <= it1_.index2 ())
    22572257                        -- it1_;
    22582258                    if (it1_ != it1_end_)
    2259                         index1 = it1_.index2 ();
     2259                        index1_val = it1_.index2 ();
    22602260                }
    2261                 size_type index2 = (*this) ().size2 ();
     2261                size_type index2_val = (*this) ().size2 ();
    22622262                if (it2_ != it2_end_) {
    22632263                    if (j_ <= it2_.index2 ())
    22642264                        -- it2_;
    22652265                    if (it2_ != it2_end_)
    2266                         index2 = it2_.index2 ();
     2266                        index2_val = it2_.index2 ();
    22672267                }
    2268                 j_ = (std::max) (index1, index2);
     2268                j_ = (std::max) (index1_val, index2_val);
    22692269            }
    22702270            BOOST_UBLAS_INLINE
    22712271            void increment (sparse_bidirectional_iterator_tag, difference_type n) {
  • ublas/matrix_sparse.hpp

    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  
    284284            matrix_container<self_type> (),
    285285            size1_ (0), size2_ (0), data_ () {}
    286286        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):
    288288            matrix_container<self_type> (),
    289             size1_ (size1), size2_ (size2), data_ () {
     289            size1_ (size1_arg), size2_ (size2_arg), data_ () {
    290290            detail::map_reserve (data (), restrict_capacity (non_zeros));
    291291        }
    292292        BOOST_UBLAS_INLINE
    namespace boost { namespace numeric { na  
    342342        }
    343343    public:
    344344        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) {
    346346            // FIXME preserve unimplemented
    347347            BOOST_UBLAS_CHECK (!preserve, internal_logic ());
    348             size1_ = size1;
    349             size2_ = size2;
     348            size1_ = size1_arg;
     349            size2_ = size2_arg;
    350350            data ().clear ();
    351351        }
    352352
    namespace boost { namespace numeric { na  
    13571357            data_ [layout_type::size_M (size1_, size2_)] = vector_data_value_type ();
    13581358        }
    13591359        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):
    13611361            matrix_container<self_type> (),
    1362             size1_ (size1), size2_ (size2), data_ () {
     1362            size1_ (size1_arg), size2_ (size2_arg), data_ () {
    13631363            data_ [layout_type::size_M (size1_, size2_)] = vector_data_value_type ();
    13641364        }
    13651365        BOOST_UBLAS_INLINE
    namespace boost { namespace numeric { na  
    14111411
    14121412        // Resizing
    14131413        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) {
    14151415            // FIXME preserve unimplemented
    14161416            BOOST_UBLAS_CHECK (!preserve, internal_logic ());
    1417             size1_ = size1;
    1418             size2_ = size2;
     1417            size1_ = size1_arg;
     1418            size2_ = size2_arg;
    14191419            data ().clear ();
    14201420            data () [layout_type::size_M (size1_, size2_)] = vector_data_value_type ();
    14211421        }
    namespace boost { namespace numeric { na  
    26502650            storage_invariants ();
    26512651        }
    26522652        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):
    26542654            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)),
    26562656            filled1_ (1), filled2_ (0),
    26572657            index1_data_ (layout_type::size_M (size1_, size2_) + 1), index2_data_ (capacity_), value_data_ (capacity_) {
    26582658            index1_data_ [filled1_ - 1] = k_based (filled2_);
    namespace boost { namespace numeric { na  
    27482748            return value_data_;
    27492749        }
    27502750        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;
    27542754            storage_invariants ();
    27552755        }
    27562756        BOOST_UBLAS_INLINE
    namespace boost { namespace numeric { na  
    27862786        }
    27872787    public:
    27882788        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) {
    27902790            // FIXME preserve unimplemented
    27912791            BOOST_UBLAS_CHECK (!preserve, internal_logic ());
    2792             size1_ = size1;
    2793             size2_ = size2;
     2792            size1_ = size1_arg;
     2793            size2_ = size2_arg;
    27942794            capacity_ = restrict_capacity (capacity_);
    27952795            filled1_ = 1;
    27962796            filled2_ = 0;
    namespace boost { namespace numeric { na  
    40294029            storage_invariants ();
    40304030        }
    40314031        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):
    40334033            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)),
    40354035            filled_ (0), sorted_filled_ (filled_), sorted_ (true),
    40364036            index1_data_ (capacity_), index2_data_ (capacity_), value_data_ (capacity_) {
    40374037            storage_invariants ();
    namespace boost { namespace numeric { na  
    40954095            return value_data_;
    40964096        }
    40974097        BOOST_UBLAS_INLINE
    4098         void set_filled (const array_size_type &filled) {
     4098        void set_filled (const array_size_type &filled_arg) {
    40994099            // 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;
    41024102            else
    4103                 sorted_ = (sorted_filled_ == filled);
    4104             filled_ = filled;
     4103                sorted_ = (sorted_filled_ == filled_arg);
     4104            filled_ = filled_arg;
    41054105            storage_invariants ();
    41064106        }
    41074107        BOOST_UBLAS_INLINE
    namespace boost { namespace numeric { na  
    41284128        }
    41294129    public:
    41304130        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) {
    41324132            // FIXME preserve unimplemented
    41334133            BOOST_UBLAS_CHECK (!preserve, internal_logic ());
    4134             size1_ = size1;
    4135             size2_ = size2;
     4134            size1_ = size1_arg;
     4135            size2_ = size2_arg;
    41364136            capacity_ = restrict_capacity (capacity_);
    41374137            index1_data_.resize (capacity_);
    41384138            index2_data_.resize (capacity_);
    namespace boost { namespace numeric { na  
    43874387                std::inplace_merge (ita.begin (), iunsorted, ita.end ());
    43884388               
    43894389                // sum duplicates with += and remove
    4390                 array_size_type filled = 0;
     4390                array_size_type filled_val = 0;
    43914391                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];
    43994399                        }
    44004400                    } else {
    4401                         value_data_ [filled] += value_data_ [i];
     4401                        value_data_ [filled_val] += value_data_ [i];
    44024402                    }
    44034403                }
    4404                 filled_ = filled + 1;
     4404                filled_ = filled_val + 1;
    44054405                sorted_filled_ = filled_;
    44064406                sorted_ = true;
    44074407                storage_invariants ();
  • ublas/storage.hpp

    diff -rupN /hub/3rdparty/R2010b/151720/glnxa64/boost/include/boost/numeric/ublas/storage.hpp ublas/storage.hpp
    old new namespace boost { namespace numeric { na  
    6262            data_ = 0;
    6363        }
    6464        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) {
    6767          if (size_) {
    6868              data_ = alloc_.allocate (size_);
    6969              if (! detail::has_trivial_constructor<T>::value) {
    namespace boost { namespace numeric { na  
    7676        }
    7777        // No value initialised, but still be default constructed
    7878        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) {
    8181            if (size_) {
    8282                data_ = alloc_.allocate (size_);
    8383                std::uninitialized_fill (begin(), end(), init);
    namespace boost { namespace numeric { na  
    113113        // Resizing
    114114    private:
    115115        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_) {
    118118                pointer p_data = data_;
    119                 if (size) {
    120                     data_ = alloc_.allocate (size);
     119                if (size_arg) {
     120                    data_ = alloc_.allocate (size_arg);
    121121                    if (preserve) {
    122122                        pointer si = p_data;
    123123                        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) {
    126126                                alloc_.construct (di, *si);
    127127                                ++si;
    128128                            }
    129129                        }
    130130                        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);
    133133                                ++di;
    134134                            }
    135                             for (; di != data_ + size; ++di) {
     135                            for (; di != data_ + size_arg; ++di) {
    136136                                alloc_.construct (di, init);
    137137                            }
    138138                        }
    139139                    }
    140140                    else {
    141141                        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)
    143143                                alloc_.construct (di, value_type());
    144144                        }
    145145                    }
    namespace boost { namespace numeric { na  
    153153                    alloc_.deallocate (p_data, size_);
    154154                }
    155155
    156                 if (!size)
     156                if (!size_arg)
    157157                    data_ = 0;
    158                 size_ = size;
     158                size_ = size_arg;
    159159            }
    160160        }
    161161    public:
    162162        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);
    165165        }
    166166        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);
    169169        }
    170170                   
    171171        // Random Access Container
    namespace boost { namespace numeric { na  
    318318            size_ (0) /*, data_ ()*/ {   // size 0 - use bounded_vector to default construct with size N
    319319        }
    320320        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_ ()*/ {
    323323            BOOST_UBLAS_CHECK (size_ <= N, bad_size ());
    324324            // data_ (an array) elements are already default constructed
    325325        }
    326326        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_ ()*/ {
    329329            BOOST_UBLAS_CHECK (size_ <= N, bad_size ());
    330330            // ISSUE elements should be value constructed here, but we must fill instead as already default constructed
    331331            std::fill (begin(), end(), init) ;
    namespace boost { namespace numeric { na  
    339339       
    340340        // Resizing
    341341        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;
    345345        }
    346346        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;
    352352        }
    353353
    354354        // Random Access Container
    namespace boost { namespace numeric { na  
    486486        // Construction and destruction
    487487        BOOST_UBLAS_INLINE
    488488        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        {
    490492        }
    491493        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]) {
    494496        }
    495497        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]) {
    498500            std::fill (data_, data_ + size_, init);
    499501        }
    500502        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) {}
    503505        BOOST_UBLAS_INLINE
    504506        array_adaptor (const array_adaptor &a):
    505507            storage_array<self_type> (),
    namespace boost { namespace numeric { na  
    516518        // Resizing
    517519    private:
    518520        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];
    522524                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);
    525527                }
    526528                if (own_)
    527529                    delete [] data_;
    528                 size_ = size;
     530                size_ = size_arg;
    529531                own_ = true;
    530532                data_ = data;
    531533            }
    532534        }
    533535        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) {
    535537            if (data != data_) {
    536538                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);
    539541                }
    540542                if (own_)
    541543                    delete [] data_;
    namespace boost { namespace numeric { na  
    543545                data_ = data;
    544546            }
    545547            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);
    547549            }
    548             size_ = size;
     550            size_ = size_arg;
    549551        }
    550552    public:
    551553        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);
    554556        }
    555557        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);
    558560        }
    559561        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);
    562564        }
    563565        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);
    566568        }
    567569
    568570        BOOST_UBLAS_INLINE
    namespace boost { namespace numeric { na  
    882884        basic_range ():
    883885            start_ (0), size_ (0) {}
    884886        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) {
    887889            BOOST_UBLAS_CHECK (start_ <= stop, bad_index ());
    888890        }
    889891
    namespace boost { namespace numeric { na  
    10551057        }
    10561058
    10571059        BOOST_UBLAS_INLINE
    1058         basic_range preprocess (size_type size) const {
     1060        basic_range preprocess (size_type size_arg) const {
    10591061            if (this != &all_)
    10601062                return *this;
    1061             return basic_range (0, size);
     1063            return basic_range (0, size_arg);
    10621064        }
    10631065        static
    10641066        BOOST_UBLAS_INLINE
    namespace boost { namespace numeric { na  
    10941096        basic_slice ():
    10951097            start_ (0), stride_ (0), size_ (0) {}
    10961098        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) {}
    10991101
    11001102        BOOST_UBLAS_INLINE
    11011103        size_type start () const {
    namespace boost { namespace numeric { na  
    12741276        }
    12751277
    12761278        BOOST_UBLAS_INLINE
    1277         basic_slice preprocess (size_type size) const {
     1279        basic_slice preprocess (size_type size_arg) const {
    12781280            if (this != &all_)
    12791281                return *this;
    1280             return basic_slice (0, 1, size);
     1282            return basic_slice (0, 1, size_arg);
    12811283        }
    12821284        static
    12831285        BOOST_UBLAS_INLINE
    namespace boost { namespace numeric { na  
    13161318        indirect_array ():
    13171319            size_ (), data_ () {}
    13181320        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) {}
    13211323        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) {}
    13241326        BOOST_UBLAS_INLINE
    13251327        indirect_array (pointer start, pointer stop):
    13261328            size_ (stop - start), data_ (stop - start) {
    namespace boost { namespace numeric { na  
    13761378        BOOST_UBLAS_INLINE
    13771379        indirect_array compose (const basic_range<size_type, difference_type> &r) const {
    13781380            BOOST_UBLAS_CHECK (r.start () + r.size () <= size_, bad_size ());
    1379             array_type data (r.size ());
     1381            array_type data_val (r.size ());
    13801382            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);
    13831385        }
    13841386        BOOST_UBLAS_INLINE
    13851387        indirect_array compose (const basic_slice<size_type, difference_type> &s) const {
    13861388            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 ());
    13881390            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);
    13911393        }
    13921394        BOOST_UBLAS_INLINE
    13931395        indirect_array compose (const indirect_array &ia) const {
    1394             array_type data (ia.size_);
     1396            array_type data_val (ia.size_);
    13951397            for (size_type i = 0; i < ia.size_; ++ i) {
    13961398                BOOST_UBLAS_CHECK (ia.data_ [i] <= size_, bad_size ());
    1397                 data [i] = data_ [ia.data_ [i]];
     1399                data_val [i] = data_ [ia.data_ [i]];
    13981400            }
    1399             return indirect_array (ia.size_, data);
     1401            return indirect_array (ia.size_, data_val);
    14001402        }
    14011403
    14021404        // Comparison
    namespace boost { namespace numeric { na  
    15341536        }
    15351537
    15361538        BOOST_UBLAS_INLINE
    1537         indirect_array preprocess (size_type size) const {
     1539        indirect_array preprocess (size_type size_arg) const {
    15381540            if (this != &all_)
    15391541                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)
    15421544               ia (i) = i;
    15431545            return ia;
    15441546        }
    namespace boost { namespace numeric { na  
    16661668        typedef const value_type const_reference;
    16671669
    16681670        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) {}
    16711673
    16721674        BOOST_UBLAS_INLINE
    16731675        size_type size() const {
    namespace boost { namespace numeric { na  
    18411843        typedef const value_type const_reference;
    18421844
    18431845        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) {}
    18461848
    18471849        BOOST_UBLAS_INLINE
    18481850        size_type size() const {
  • ublas/storage_sparse.hpp

    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  
    263263    private:
    264264        // Resizing - implicitly exposses uninitialized (but default constructed) mapped_type
    265265        BOOST_UBLAS_INLINE
    266         void resize (size_type size) {
     266        void resize (size_type size_arg) {
    267267            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 ());
    274274
    275275                if (capacity_) {
    276276                    std::for_each (data_, data_ + capacity_, static_destroy);
    277277                    alloc_.deallocate (data_, capacity_);
    278278                }
    279                 capacity_ = capacity;
     279                capacity_ = capacity_val;
    280280                data_ = data;
    281281            }
    282             size_ = size;
     282            size_ = size_arg;
    283283            BOOST_UBLAS_CHECK (size_ <= capacity_, internal_logic ());
    284284        }
    285285    public:
    286286
    287287        // Reserving
    288288        BOOST_UBLAS_INLINE
    289         void reserve (size_type capacity) {
     289        void reserve (size_type capacity_arg) {
    290290            BOOST_UBLAS_CHECK (size_ <= capacity_, internal_logic ());
    291291            // Reduce capacity_ if size_ allows
    292             BOOST_UBLAS_CHECK (capacity >= size_, bad_size ());
     292            BOOST_UBLAS_CHECK (capacity_arg >= size_, bad_size ());
    293293            pointer data;
    294             if (capacity) {
    295                 data = alloc_.allocate (capacity);
     294            if (capacity_arg) {
     295                data = alloc_.allocate (capacity_arg);
    296296                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 ());
    298298            }
    299299            else
    300300                data = 0;
    namespace boost { namespace numeric { na  
    303303                std::for_each (data_, data_ + capacity_, static_destroy);
    304304                alloc_.deallocate (data_, capacity_);
    305305            }
    306             capacity_ = capacity;
     306            capacity_ = capacity_arg;
    307307            data_ = data;
    308308            BOOST_UBLAS_CHECK (size_ <= capacity_, internal_logic ());
    309309        }
  • ublas/vector.hpp

    diff -rupN /hub/3rdparty/R2010b/151720/glnxa64/boost/include/boost/numeric/ublas/vector.hpp ublas/vector.hpp
    old new namespace boost { namespace numeric { na  
    5252            vector_container<self_type> (),
    5353            data_ () {}
    5454        explicit BOOST_UBLAS_INLINE
    55         vector (size_type size):
     55        vector (size_type size_arg):
    5656            vector_container<self_type> (),
    57             data_ (size) {
     57            data_ (size_arg) {
    5858        }
    5959        BOOST_UBLAS_INLINE
    60         vector (size_type size, const array_type &data):
     60        vector (size_type size_arg, const array_type &data_arg):
    6161            vector_container<self_type> (),
    62             data_ (data) {}
     62            data_ (data_arg) {}
    6363        BOOST_UBLAS_INLINE
    64         vector (size_type size, const value_type &init):
     64        vector (size_type size_arg, const value_type &init):
    6565            vector_container<self_type> (),
    66             data_ (size, init) {}
     66            data_ (size_arg, init) {}
    6767        BOOST_UBLAS_INLINE
    6868        vector (const vector &v):
    6969            vector_container<self_type> (),
    namespace boost { namespace numeric { na  
    104104
    105105        // Resizing
    106106        BOOST_UBLAS_INLINE
    107         void resize (size_type size, bool preserve = true) {
     107        void resize (size_type size_arg, bool preserve = true) {
    108108            if (preserve)
    109                 data ().resize (size, typename A::value_type ());
     109                data ().resize (size_arg, typename A::value_type ());
    110110            else
    111                 data ().resize (size);
     111                data ().resize (size_arg);
    112112        }
    113113
    114114        // Element support
    namespace boost { namespace numeric { na  
    602602            vector_container<self_type> (),
    603603            size_ (0) {}
    604604        explicit BOOST_UBLAS_INLINE
    605         zero_vector (size_type size):
     605        zero_vector (size_type size_arg):
    606606            vector_container<self_type> (),
    607             size_ (size) {}
     607            size_ (size_arg) {}
    608608        BOOST_UBLAS_INLINE
    609609        zero_vector (const zero_vector &v):
    610610            vector_container<self_type> (),
    namespace boost { namespace numeric { na  
    618618
    619619        // Resizing
    620620        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;
    623623        }
    624624
    625625        // Element support
    namespace boost { namespace numeric { na  
    802802            vector_container<self_type> (),
    803803            size_ (0), index_ (0) {}
    804804        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):
    806806            vector_container<self_type> (),
    807             size_ (size), index_ (index) {}
     807            size_ (size_arg), index_ (index_arg) {}
    808808        BOOST_UBLAS_INLINE
    809809        unit_vector (const unit_vector &v):
    810810            vector_container<self_type> (),
    namespace boost { namespace numeric { na  
    822822
    823823        // Resizing
    824824        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;
    827827        }
    828828
    829829        // Element support
    namespace boost { namespace numeric { na  
    10271027            vector_container<self_type> (),
    10281028            size_ (0), value_ () {}
    10291029        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)):
    10311031            vector_container<self_type> (),
    1032             size_ (size), value_ (value) {}
     1032            size_ (size_arg), value_ (value) {}
    10331033        BOOST_UBLAS_INLINE
    10341034        scalar_vector (const scalar_vector &v):
    10351035            vector_container<self_type> (),
    namespace boost { namespace numeric { na  
    10431043
    10441044        // Resizing
    10451045        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;
    10481048        }
    10491049
    10501050        // Element support
    namespace boost { namespace numeric { na  
    12661266        c_vector ():
    12671267            size_ (N) /* , data_ () */ {}
    12681268        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_ () */ {
    12711271            if (size_ > N)
    12721272                bad_size ().raise ();
    12731273        }
    namespace boost { namespace numeric { na  
    13031303
    13041304        // Resizing
    13051305        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)
    13081308                bad_size ().raise ();
    1309             size_ = size;
     1309            size_ = size_arg;
    13101310        }
    13111311
    13121312        // Element support
  • ublas/vector_sparse.hpp

    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  
    294294            vector_container<self_type> (),
    295295            size_ (0), data_ () {}
    296296        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):
    298298            vector_container<self_type> (),
    299             size_ (size), data_ () {
     299            size_ (size_arg), data_ () {
    300300            detail::map_reserve (data(), restrict_capacity (non_zeros));
    301301        }
    302302        BOOST_UBLAS_INLINE
    namespace boost { namespace numeric { na  
    345345        }
    346346    public:
    347347        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;
    350350            if (preserve) {
    351351                data ().erase (data ().lower_bound(size_), data ().end());
    352352            }
    namespace boost { namespace numeric { na  
    796796            storage_invariants ();
    797797        }
    798798        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):
    800800            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),
    802802            index_data_ (capacity_), value_data_ (capacity_) {
    803803        storage_invariants ();
    804804        }
    namespace boost { namespace numeric { na  
    851851            return value_data_;
    852852        }
    853853        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;
    856856            storage_invariants ();
    857857        }
    858858        BOOST_UBLAS_INLINE
    namespace boost { namespace numeric { na  
    874874        }
    875875    public:
    876876        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;
    879879            capacity_ = restrict_capacity (capacity_);
    880880            if (preserve) {
    881881                index_data_. resize (capacity_, size_type ());
    882882                value_data_. resize (capacity_, value_type ());
    883883                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)) {
    885885                    --filled_;
    886886                }
    887887            }
    namespace boost { namespace numeric { na  
    14171417            storage_invariants ();
    14181418        }
    14191419        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):
    14211421            vector_container<self_type> (),
    1422             size_ (size), capacity_ (restrict_capacity (non_zeros)),
     1422            size_ (size_arg), capacity_ (restrict_capacity (non_zeros)),
    14231423            filled_ (0), sorted_filled_ (filled_), sorted_ (true),
    14241424            index_data_ (capacity_), value_data_ (capacity_) {
    14251425            storage_invariants ();
    namespace boost { namespace numeric { na  
    14751475            return value_data_;
    14761476        }
    14771477        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) {
    14791479            sorted_filled_ = sorted;
    1480             filled_ = filled;
     1480            filled_ = filled_arg;
    14811481            storage_invariants ();
    14821482            return filled_;
    14831483        }
    namespace boost { namespace numeric { na  
    15011501        }
    15021502    public:
    15031503        BOOST_UBLAS_INLINE
    1504         void resize (size_type size, bool preserve = true) {
     1504        void resize (size_type size_arg, bool preserve = true) {
    15051505            if (preserve)
    15061506                sort ();    // remove duplicate elements.
    1507             size_ = size;
     1507            size_ = size_arg;
    15081508            capacity_ = restrict_capacity (capacity_);
    15091509            if (preserve) {
    15101510                index_data_. resize (capacity_, size_type ());
    15111511                value_data_. resize (capacity_, value_type ());
    15121512                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)) {
    15141514                    --filled_;
    15151515                }
    15161516            }
    namespace boost { namespace numeric { na  
    17581758                std::inplace_merge (ipa.begin (), iunsorted, ipa.end ());
    17591759               
    17601760                // sum duplicates with += and remove
    1761                 size_type filled = 0;
     1761                size_type filled_val = 0;
    17621762                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];
    17681768                        }
    17691769                    } else {
    1770                         value_data_ [filled] += value_data_ [i];
     1770                        value_data_ [filled_val] += value_data_ [i];
    17711771                    }
    17721772                }
    1773                 filled_ = filled + 1;
     1773                filled_ = filled_val + 1;
    17741774                sorted_filled_ = filled_;
    17751775                sorted_ = true;
    17761776                storage_invariants ();