Hello community, here is the log from the commit of package armadillo for openSUSE:Factory checked in at 2014-05-22 06:57:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/armadillo (Old) and /work/SRC/openSUSE:Factory/.armadillo.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "armadillo" Changes: -------- --- /work/SRC/openSUSE:Factory/armadillo/armadillo.changes 2014-05-13 20:42:41.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.armadillo.new/armadillo.changes 2014-05-22 06:57:17.000000000 +0200 @@ -1,0 +2,6 @@ +Wed May 21 15:45:26 UTC 2014 - badshah...@gmail.com + +- Update to version 4.300.5: + + List of changes not documented upstream. + +------------------------------------------------------------------- Old: ---- armadillo-4.300.2.tar.gz New: ---- armadillo-4.300.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ armadillo.spec ++++++ --- /var/tmp/diff_new_pack.qUUSoa/_old 2014-05-22 06:57:18.000000000 +0200 +++ /var/tmp/diff_new_pack.qUUSoa/_new 2014-05-22 06:57:18.000000000 +0200 @@ -19,7 +19,7 @@ %define soname libarmadillo4 Name: armadillo -Version: 4.300.2 +Version: 4.300.5 Release: 0 Summary: Fast C++ matrix library with interfaces to LAPACK and ATLAS License: MPL-2.0 ++++++ armadillo-4.300.2.tar.gz -> armadillo-4.300.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-4.300.2/CMakeLists.txt new/armadillo-4.300.5/CMakeLists.txt --- old/armadillo-4.300.2/CMakeLists.txt 2014-05-11 15:11:27.000000000 +0200 +++ new/armadillo-4.300.5/CMakeLists.txt 2014-05-19 17:20:03.000000000 +0200 @@ -14,7 +14,7 @@ set(ARMA_MAJOR 4) set(ARMA_MINOR 300) -set(ARMA_PATCH 2) +set(ARMA_PATCH 5) message(STATUS "Configuring Armadillo ${ARMA_MAJOR}.${ARMA_MINOR}.${ARMA_PATCH}") @@ -247,10 +247,12 @@ message(STATUS "") -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.9) - set(ARMA_USE_CXX11_RNG true) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - message(STATUS "Detected gcc 4.9 or later. Added '-std=c++11' to compiler flags") +if(DEFINED CMAKE_CXX_COMPILER_ID AND DEFINED CMAKE_CXX_COMPILER_VERSION) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.9) + set(ARMA_USE_CXX11_RNG true) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + message(STATUS "Detected gcc 4.9 or later. Added '-std=c++11' to compiler flags") + endif() endif() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-4.300.2/docs.html new/armadillo-4.300.5/docs.html --- old/armadillo-4.300.2/docs.html 2014-05-03 16:56:22.000000000 +0200 +++ new/armadillo-4.300.5/docs.html 2014-05-19 08:33:48.000000000 +0200 @@ -7033,7 +7033,7 @@ </li> <br> <li> -<i>norm_dot(A,B)</i>: normalised version of <i>dot(A,B)</i> +<i>norm_dot(A,B)</i>: equivalent to <i>dot(A,B) / (∥A∥•∥B∥)</i> </li> <br> <li> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-4.300.2/include/armadillo_bits/arma_version.hpp new/armadillo-4.300.5/include/armadillo_bits/arma_version.hpp --- old/armadillo-4.300.2/include/armadillo_bits/arma_version.hpp 2014-05-11 15:11:27.000000000 +0200 +++ new/armadillo-4.300.5/include/armadillo_bits/arma_version.hpp 2014-05-19 17:20:03.000000000 +0200 @@ -13,7 +13,7 @@ #define ARMA_VERSION_MAJOR 4 #define ARMA_VERSION_MINOR 300 -#define ARMA_VERSION_PATCH 2 +#define ARMA_VERSION_PATCH 5 #define ARMA_VERSION_NAME "Medieval Cornea Scraper" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-4.300.2/include/armadillo_bits/fn_dot.hpp new/armadillo-4.300.5/include/armadillo_bits/fn_dot.hpp --- old/armadillo-4.300.2/include/armadillo_bits/fn_dot.hpp 2014-02-26 05:45:33.000000000 +0100 +++ new/armadillo-4.300.5/include/armadillo_bits/fn_dot.hpp 2014-05-19 07:16:24.000000000 +0200 @@ -56,12 +56,12 @@ template<typename T1, typename T2> -arma_inline +inline arma_warn_unused typename enable_if2 < - is_arma_type<T1>::value && is_arma_type<T2>::value && is_same_type<typename T1::elem_type, typename T2::elem_type>::value && is_cx<typename T1::elem_type>::no, + is_arma_type<T1>::value && is_arma_type<T2>::value && is_same_type<typename T1::elem_type, typename T2::elem_type>::value, typename T1::elem_type >::result norm_dot @@ -76,28 +76,6 @@ } - -template<typename T1, typename T2> -arma_inline -arma_warn_unused -typename -enable_if2 - < - is_arma_type<T1>::value && is_arma_type<T2>::value && is_same_type<typename T1::elem_type, typename T2::elem_type>::value && is_complex_strict<typename T1::elem_type>::value, - typename T1::elem_type - >::result -norm_dot - ( - const T1& A, - const T2& B - ) - { - arma_extra_debug_sigprint(); - - return op_norm_dot_slow::apply(A,B); - } - - // // cdot diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-4.300.2/include/armadillo_bits/fn_norm.hpp new/armadillo-4.300.5/include/armadillo_bits/fn_norm.hpp --- old/armadillo-4.300.2/include/armadillo_bits/fn_norm.hpp 2014-02-25 18:15:35.000000000 +0100 +++ new/armadillo-4.300.5/include/armadillo_bits/fn_norm.hpp 2014-05-19 17:20:03.000000000 +0200 @@ -1,5 +1,5 @@ -// Copyright (C) 2008-2012 Conrad Sanderson -// Copyright (C) 2008-2012 NICTA (www.nicta.com.au) +// Copyright (C) 2008-2014 Conrad Sanderson +// Copyright (C) 2008-2014 NICTA (www.nicta.com.au) // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -96,7 +96,8 @@ arma_extra_debug_sigprint(); arma_ignore(junk); - typedef typename T1::pod_type T; + typedef typename T1::elem_type eT; + typedef typename T1::pod_type T; T acc = T(0); @@ -167,7 +168,71 @@ } } - return std::sqrt(acc); + + const T sqrt_acc = std::sqrt(acc); + + if( (sqrt_acc != T(0)) && arma_isfinite(sqrt_acc) ) + { + return sqrt_acc; + } + else + { + arma_extra_debug_print("arma_vec_norm_2(): detected possible underflow or overflow"); + + const quasi_unwrap<typename Proxy<T1>::stored_type> R(P.Q); + + const uword N = R.M.n_elem; + const eT* R_mem = R.M.memptr(); + + eT max_val = priv::most_neg<eT>(); + + uword i,j; + + for(i=0, j=1; j<N; i+=2, j+=2) + { + eT val_i = R_mem[i]; + eT val_j = R_mem[j]; + + val_i = std::abs(val_i); + val_j = std::abs(val_j); + + if(val_i > max_val) { max_val = val_i; } + if(val_j > max_val) { max_val = val_j; } + } + + if(i < N) + { + const eT val_i = std::abs(R_mem[i]); + + if(val_i > max_val) { max_val = val_i; } + } + + if(max_val == eT(0)) { return eT(0); } + + eT alt_acc1 = eT(0); + eT alt_acc2 = eT(0); + + for(i=0, j=1; j<N; i+=2, j+=2) + { + eT val_i = R_mem[i]; + eT val_j = R_mem[j]; + + val_i /= max_val; + val_j /= max_val; + + alt_acc1 += val_i * val_i; + alt_acc2 += val_j * val_j; + } + + if(i < N) + { + const eT val_i = R_mem[i] / max_val; + + alt_acc1 += val_i*val_i; + } + + return ( std::sqrt(alt_acc1 + alt_acc2) * max_val ); + } } @@ -185,7 +250,8 @@ arma_extra_debug_sigprint(); arma_ignore(junk); - typedef typename T1::pod_type T; + typedef typename T1::elem_type eT; + typedef typename T1::pod_type T; T acc = T(0); @@ -225,7 +291,43 @@ } } - return std::sqrt(acc); + const T sqrt_acc = std::sqrt(acc); + + if( (sqrt_acc != T(0)) && arma_isfinite(sqrt_acc) ) + { + return sqrt_acc; + } + else + { + arma_extra_debug_print("arma_vec_norm_2(): detected possible underflow or overflow"); + + const quasi_unwrap<typename Proxy<T1>::stored_type> R(P.Q); + + const uword N = R.M.n_elem; + const eT* R_mem = R.M.memptr(); + + T max_val = priv::most_neg<T>(); + + for(uword i=0; i<N; ++i) + { + const T val_i = std::abs(R_mem[i]); + + if(val_i > max_val) { max_val = val_i; } + } + + if(max_val == T(0)) { return T(0); } + + T alt_acc = T(0); + + for(uword i=0; i<N; ++i) + { + const T val_i = std::abs(R_mem[i]) / max_val; + + alt_acc += val_i * val_i; + } + + return ( std::sqrt(alt_acc) * max_val ); + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-4.300.2/include/armadillo_bits/op_dot_bones.hpp new/armadillo-4.300.5/include/armadillo_bits/op_dot_bones.hpp --- old/armadillo-4.300.2/include/armadillo_bits/op_dot_bones.hpp 2014-02-26 05:46:25.000000000 +0100 +++ new/armadillo-4.300.5/include/armadillo_bits/op_dot_bones.hpp 2014-05-19 07:16:24.000000000 +0200 @@ -65,19 +65,6 @@ public: template<typename T1, typename T2> - arma_hot inline static typename T1::elem_type apply (const T1& X, const T2& Y); - - template<typename T1, typename T2> - arma_hot inline static typename T1::elem_type apply_unwrap(const T1& X, const T2& Y); - }; - - - -class op_norm_dot_slow - { - public: - - template<typename T1, typename T2> arma_hot inline static typename T1::elem_type apply(const T1& X, const T2& Y); }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-4.300.2/include/armadillo_bits/op_dot_meat.hpp new/armadillo-4.300.5/include/armadillo_bits/op_dot_meat.hpp --- old/armadillo-4.300.2/include/armadillo_bits/op_dot_meat.hpp 2014-02-26 05:42:55.000000000 +0100 +++ new/armadillo-4.300.5/include/armadillo_bits/op_dot_meat.hpp 2014-05-19 17:20:03.000000000 +0200 @@ -1,5 +1,5 @@ -// Copyright (C) 2008-2013 Conrad Sanderson -// Copyright (C) 2008-2013 NICTA (www.nicta.com.au) +// Copyright (C) 2008-2014 Conrad Sanderson +// Copyright (C) 2008-2014 NICTA (www.nicta.com.au) // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -372,115 +372,20 @@ { arma_extra_debug_sigprint(); - typedef typename T1::elem_type eT; - typedef typename Proxy<T1>::ea_type ea_type1; - typedef typename Proxy<T2>::ea_type ea_type2; - - const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor) && (Proxy<T2>::prefer_at_accessor); - - if(prefer_at_accessor == false) - { - const Proxy<T1> PA(X); - const Proxy<T2> PB(Y); - - const uword N = PA.get_n_elem(); - - arma_debug_check( (N != PB.get_n_elem()), "norm_dot(): objects must have the same number of elements" ); - - ea_type1 A = PA.get_ea(); - ea_type2 B = PB.get_ea(); - - eT acc1 = eT(0); - eT acc2 = eT(0); - eT acc3 = eT(0); - - for(uword i=0; i<N; ++i) - { - const eT tmpA = A[i]; - const eT tmpB = B[i]; - - acc1 += tmpA * tmpA; - acc2 += tmpB * tmpB; - acc3 += tmpA * tmpB; - } - - return acc3 / ( std::sqrt(acc1 * acc2) ); - } - else - { - return op_norm_dot::apply_unwrap(X, Y); - } - } - - - -template<typename T1, typename T2> -arma_hot -inline -typename T1::elem_type -op_norm_dot::apply_unwrap(const T1& X, const T2& Y) - { - arma_extra_debug_sigprint(); - typedef typename T1::elem_type eT; + typedef typename T1::pod_type T; - const unwrap<T1> tmp1(X); - const unwrap<T2> tmp2(Y); - - const Mat<eT>& A = tmp1.M; - const Mat<eT>& B = tmp2.M; - - - arma_debug_check( (A.n_elem != B.n_elem), "norm_dot(): objects must have the same number of elements" ); - - const uword N = A.n_elem; - - const eT* A_mem = A.memptr(); - const eT* B_mem = B.memptr(); - - eT acc1 = eT(0); - eT acc2 = eT(0); - eT acc3 = eT(0); - - for(uword i=0; i<N; ++i) - { - const eT tmpA = A_mem[i]; - const eT tmpB = B_mem[i]; - - acc1 += tmpA * tmpA; - acc2 += tmpB * tmpB; - acc3 += tmpA * tmpB; - } - - return acc3 / ( std::sqrt(acc1 * acc2) ); - } - - - -// -// op_norm_dot_slow - - - -template<typename T1, typename T2> -arma_hot -inline -typename T1::elem_type -op_norm_dot_slow::apply(const T1& X, const T2& Y) - { - arma_extra_debug_sigprint(); - - typedef typename T1::elem_type eT; - - const unwrap<T1> tmp1(X); - const unwrap<T2> tmp2(Y); + const quasi_unwrap<T1> tmp1(X); + const quasi_unwrap<T2> tmp2(Y); const Col<eT> A( const_cast<eT*>(tmp1.M.memptr()), tmp1.M.n_elem, false ); const Col<eT> B( const_cast<eT*>(tmp2.M.memptr()), tmp2.M.n_elem, false ); arma_debug_check( (A.n_elem != B.n_elem), "norm_dot(): objects must have the same number of elements" ); - return ( op_dot::apply(A,B) / (norm(A,2) * norm(B,2)) ); + const T denom = norm(A,2) * norm(B,2); + + return (denom != T(0)) ? ( op_dot::apply(A,B) / denom ) : eT(0); } -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org