Boost logo

Boost-Commit :

From: thomas.klimpel_at_[hidden]
Date: 2008-08-24 08:52:21


Author: klimpel
Date: 2008-08-24 08:52:20 EDT (Sun, 24 Aug 2008)
New Revision: 48348
URL: http://svn.boost.org/trac/boost/changeset/48348

Log:
sync with git

- Some compiler fixes where adding an <int> template parameter made something better.
- A few #ifdef NDEBUG that prevent unused variable warnings.
- A syev() without a workspace argument.

Text files modified:
   sandbox/boost/numeric/bindings/lapack/geqrf.hpp | 8 ++++----
   sandbox/boost/numeric/bindings/lapack/gesvd.hpp | 10 +++++++++-
   sandbox/boost/numeric/bindings/lapack/syev.hpp | 11 +++++++++--
   sandbox/boost/numeric/bindings/lapack/trevc.hpp | 2 +-
   4 files changed, 23 insertions(+), 8 deletions(-)

Modified: sandbox/boost/numeric/bindings/lapack/geqrf.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/geqrf.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/geqrf.hpp 2008-08-24 08:52:20 EDT (Sun, 24 Aug 2008)
@@ -109,7 +109,7 @@
 
       int const m = traits::matrix_size1 (a);
       int const n = traits::matrix_size2 (a);
- assert (std::min(m,n) <= traits::vector_size (tau));
+ assert (std::min<int>(m,n) <= traits::vector_size (tau));
       assert (n <= traits::vector_size (work));
 
       int info;
@@ -131,7 +131,7 @@
     int geqrf (A& a, Tau& tau, optimal_workspace ) {
        typedef typename A::value_type value_type ;
        const int n = traits::matrix_size2 (a);
- traits::detail::array<value_type> work(std::max(1, n*32));
+ traits::detail::array<value_type> work(std::max<int>(1, n*32));
        return geqrf( a, tau, work );
     }
 
@@ -143,7 +143,7 @@
     int geqrf (A& a, Tau& tau, minimal_workspace ) {
        typedef typename A::value_type value_type ;
        const int n = traits::matrix_size2 (a);
- traits::detail::array<value_type> work(std::max(1, n));
+ traits::detail::array<value_type> work(std::max<int>(1, n));
        return geqrf( a, tau, work );
     }
 
@@ -157,7 +157,7 @@
     int geqrf (A& a, Tau& tau, detail::workspace1<Work> workspace ) {
        typedef typename A::value_type value_type ;
        const int n = traits::matrix_size2 (a);
- traits::detail::array<value_type> work(std::max(1, n));
+ traits::detail::array<value_type> work(std::max<int>(1, n));
        return geqrf( a, tau, workspace.w_ );
     }
 

Modified: sandbox/boost/numeric/bindings/lapack/gesvd.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/gesvd.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/gesvd.hpp 2008-08-24 08:52:20 EDT (Sun, 24 Aug 2008)
@@ -49,7 +49,7 @@
      * diagonal elements, U is an M-by-M orthogonal/unitary matrix, and V
      * is an N-by-N orthogonal/unitary matrix. The diagonal elements of S
      * are the singular values of A; they are real and non-negative, and
- * are returnede in descending order. The first min(m,n) columns of
+ * are returned in descending order. The first min(m,n) columns of
      * U and V are the left and right singular vectors of A. (Note that
      * the routine returns V^T or V^H, not V.
      */
@@ -275,7 +275,9 @@
 
       int const m = traits::matrix_size1 (a);
       int const n = traits::matrix_size2 (a);
+#ifndef NDEBUG /* this variable is only used in assertions below */
       int const minmn = m < n ? m : n;
+#endif
 
       assert (minmn == traits::vector_size (s));
       assert (!(jobu == 'O' && jobvt == 'O'));
@@ -340,7 +342,9 @@
 
       int const m = traits::matrix_size1 (a);
       int const n = traits::matrix_size2 (a);
+#ifndef NDEBUG /* this variable is only used in assertions below */
       int const minmn = m < n ? m : n;
+#endif
 
       assert (minmn == traits::vector_size (s));
       assert (!(jobu == 'O' && jobvt == 'O'));
@@ -405,7 +409,9 @@
 
       int const m = traits::matrix_size1 (a);
       int const n = traits::matrix_size2 (a);
+#ifndef NDEBUG /* this variable is only used in assertions below */
       int const minmn = m < n ? m : n;
+#endif
 
       assert (minmn == traits::vector_size (s));
       assert (!(jobu == 'O' && jobvt == 'O'));
@@ -490,7 +496,9 @@
 
       int const m = traits::matrix_size1 (a);
       int const n = traits::matrix_size2 (a);
+#ifndef NDEBUG /* this variable is only used in assertions below */
       int const minmn = m < n ? m : n;
+#endif
 
       assert (minmn == traits::vector_size (s));
 

Modified: sandbox/boost/numeric/bindings/lapack/syev.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/syev.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/syev.hpp 2008-08-24 08:52:20 EDT (Sun, 24 Aug 2008)
@@ -114,7 +114,7 @@
 
        int const n = traits::matrix_size1 (a);
 
- traits::detail::array<value_type> work( std::max(1,34*n) );
+ traits::detail::array<value_type> work( std::max<int>(1,34*n) );
        return detail::syev(jobz, uplo, a, w, work);
     } // syev()
 
@@ -127,7 +127,7 @@
 
        int const n = traits::matrix_size1 (a);
 
- traits::detail::array<value_type> work( std::max(1,3*n-1) );
+ traits::detail::array<value_type> work( std::max<int>(1,3*n-1) );
        return detail::syev(jobz, uplo, a, w, work);
     } // syev()
 
@@ -141,6 +141,13 @@
        return detail::syev(jobz, uplo, a, w, workspace.w_);
     } // syev()
 
+ // Function without workarray as argument
+ template <typename A, typename W>
+ inline
+ int syev (char jobz, char uplo, A& a, W& w) {
+ return syev(jobz, uplo, a, w, optimal_workspace());
+ } // syev()
+
   }
 
 }}}

Modified: sandbox/boost/numeric/bindings/lapack/trevc.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/trevc.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/trevc.hpp 2008-08-24 08:52:20 EDT (Sun, 24 Aug 2008)
@@ -75,7 +75,7 @@
       inline
       void trevc (char const side, char const howmny, const logical_t* select, int const n,
                   traits::complex_d* t, int const ldt, traits::complex_d* vl, int const ldvl, traits::complex_d* vr, int const ldvr,
- int const mm, int& m, traits::complex_d* work, int& info)
+ int const mm, int& m, traits::complex_d* work, int& info)
       {
         LAPACK_ZTREVC (&side, &howmny, select, &n, traits::complex_ptr(t), &ldt,
                              traits::complex_ptr(vl), &ldvl, traits::complex_ptr(vr), &ldvr,


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk