Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50512 - in sandbox/boost/numeric/bindings: lapack traits traits/detail
From: karl.meerbergen_at_[hidden]
Date: 2009-01-08 05:56:00


Author: karlmeerbergen
Date: 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
New Revision: 50512
URL: http://svn.boost.org/trac/boost/changeset/50512

Log:
workspace is improved in lapack (possibly with 3 arguments)

Text files modified:
   sandbox/boost/numeric/bindings/lapack/gees.hpp | 7 ++
   sandbox/boost/numeric/bindings/lapack/gels.hpp | 2
   sandbox/boost/numeric/bindings/lapack/gelsd.hpp | 7 ++
   sandbox/boost/numeric/bindings/lapack/gelss.hpp | 16 ++++---
   sandbox/boost/numeric/bindings/lapack/geqrf.hpp | 2
   sandbox/boost/numeric/bindings/lapack/hbev.hpp | 17 +++----
   sandbox/boost/numeric/bindings/lapack/hbevx.hpp | 23 +++++----
   sandbox/boost/numeric/bindings/lapack/heev.hpp | 2
   sandbox/boost/numeric/bindings/lapack/heevd.hpp | 24 ++++++----
   sandbox/boost/numeric/bindings/lapack/heevx.hpp | 20 ++++----
   sandbox/boost/numeric/bindings/lapack/hegv.hpp | 12 ++--
   sandbox/boost/numeric/bindings/lapack/hesv.hpp | 3
   sandbox/boost/numeric/bindings/lapack/hpsv.hpp | 3
   sandbox/boost/numeric/bindings/lapack/orgqr.hpp | 2
   sandbox/boost/numeric/bindings/lapack/ormqr.hpp | 4
   sandbox/boost/numeric/bindings/lapack/syev.hpp | 21 +++++----
   sandbox/boost/numeric/bindings/lapack/sysv.hpp | 1
   sandbox/boost/numeric/bindings/lapack/workspace.hpp | 87 ++++++++++++++++++++++++++++++++-------
   sandbox/boost/numeric/bindings/traits/detail/ublas_uplo.hpp | 15 +++++
   sandbox/boost/numeric/bindings/traits/matrix_raw.hpp | 86 +++++++++++++++++----------------------
   sandbox/boost/numeric/bindings/traits/matrix_traits.hpp | 5 --
   sandbox/boost/numeric/bindings/traits/ublas_banded.hpp | 1
   sandbox/boost/numeric/bindings/traits/ublas_hermitian.hpp | 6 --
   sandbox/boost/numeric/bindings/traits/ublas_matrix.hpp | 2
   sandbox/boost/numeric/bindings/traits/ublas_symmetric.hpp | 6 --
   sandbox/boost/numeric/bindings/traits/ublas_vector2.hpp | 5 --
   sandbox/boost/numeric/bindings/traits/vector_raw.hpp | 30 ++++++------
   27 files changed, 225 insertions(+), 184 deletions(-)

Modified: sandbox/boost/numeric/bindings/lapack/gees.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/gees.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/gees.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -249,7 +249,9 @@
           /// Compute Schur factorization, passing workspace2 as workspace
           template <typename MatrA, typename SchVec, typename EigVal, typename RWork, typename Work>
           int operator() (char jobvs, MatrA& a, EigVal& w, SchVec& vs, workspace2<Work,RWork>& workspace ) const {
- return gees( jobvs, a, w, vs, workspace.w_, workspace.wr_ );
+ typedef typename traits::matrix_traits<MatrA>::value_type value_type ;
+ typedef typename traits::type_traits<value_type>::real_type real_type ;
+ return gees( jobvs, a, w, vs, workspace.select(value_type()), workspace.select(real_type()) );
           } // gees()
        }; // Gees<2>
 
@@ -283,7 +285,8 @@
           /// Compute Schur factorization, passing workspace1 as workspace
           template <typename MatrA, typename SchVec, typename EigVal, typename Work>
           int operator() (char jobvs, MatrA& a, EigVal& w, SchVec& vs, detail::workspace1<Work> workspace ) const {
- return gees( jobvs, a, w, vs, workspace.w_ );
+ typedef typename traits::matrix_traits<MatrA>::value_type value_type ;
+ return gees( jobvs, a, w, vs, workspace.select(value_type()) );
           } // gees()
        }; // Gees<1>
 

Modified: sandbox/boost/numeric/bindings/lapack/gels.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/gels.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/gels.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -197,7 +197,7 @@
         template <typename MatrA, typename VecB, typename Work>
         int gels(const char trans, MatrA& A, VecB& b, detail::workspace1<Work> workspace)
         {
- return detail::gels(trans, A, b, workspace.w_);
+ return detail::gels(trans, A, b, workspace.select(typename traits::vector_traits<VecB>::value_type()));
         }
 
     } // namespace lapack

Modified: sandbox/boost/numeric/bindings/lapack/gelsd.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/gelsd.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/gelsd.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -263,7 +263,8 @@
                     //const std::ptrdiff_t maxmn = std::max(m, n); // maxmn = m > n ? m : n
                     //const std::ptrdiff_t maxmnr = std::max(maxmn, nrhs); // maxmnr = maxmn > nrhs ? maxmn : nrhs
 
- return gelsd(A, B, s, workspace.w_);
+ typedef typename traits::vector_traits<VecS>::value_type value_type ;
+ return gelsd(A, B, s, workspace.select(value_type()));
                 }
             };
 
@@ -367,7 +368,9 @@
                     //const std::ptrdiff_t maxmn = std::max(m, n); // maxmn = m > n ? m : n
                     //const std::ptrdiff_t maxmnr = std::max(maxmn, nrhs); // maxmnr = maxmn > nrhs ? maxmn : nrhs
 
- return gelsd(A, B, s, workspace.w_, workspace.wr_);
+ typedef typename traits::vector_traits<VecS>::value_type value_type ;
+ typedef typename traits::type_traits<value_type>::real_type real_type ;
+ return gelsd(A, B, s, workspace.select(value_type()), workspace.select(real_type()));
                 }
             };
 

Modified: sandbox/boost/numeric/bindings/lapack/gelss.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/gelss.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/gelss.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -165,7 +165,7 @@
                 template <typename MatrA, typename MatrB, typename VecS>
                 int operator() (MatrA& A, MatrB& B, VecS& s, minimal_workspace) const
                 {
- typedef typename MatrA::value_type val_t;
+ typedef typename traits::matrix_traits<MatrA>::value_type val_t;
 
                     const std::ptrdiff_t m = traits::matrix_size1(A);
                     const std::ptrdiff_t n = traits::matrix_size2(A);
@@ -183,7 +183,7 @@
                 template <typename MatrA, typename MatrB, typename VecS>
                 int operator() (MatrA& A, MatrB& B, VecS& s, optimal_workspace) const
                 {
- typedef typename MatrA::value_type val_t;
+ typedef typename traits::matrix_traits<MatrA>::value_type val_t;
                     typedef typename traits::type_traits<val_t>::real_type real_t;
 
                     //const std::ptrdiff_t m = traits::matrix_size1(A);
@@ -227,7 +227,7 @@
                 template <typename MatrA, typename MatrB, typename VecS, typename Work>
                 int operator() (MatrA& A, MatrB& B, VecS& s, detail::workspace1<Work> workspace) const
                 {
- return gelss(A, B, s, workspace.w_);
+ return gelss(A, B, s, workspace.select(typename traits::matrix_traits<MatrA>::value_type()));
                 }
             };
 
@@ -238,7 +238,7 @@
                 template <typename MatrA, typename MatrB, typename VecS>
                 int operator() (MatrA& A, MatrB& B, VecS& s, minimal_workspace) const
                 {
- typedef typename MatrA::value_type val_t;
+ typedef typename traits::matrix_traits<MatrA>::value_type val_t;
                     typedef typename traits::type_traits<val_t>::real_type real_t;
 
                     const std::ptrdiff_t m = traits::matrix_size1(A);
@@ -305,7 +305,9 @@
                 template <typename MatrA, typename MatrB, typename VecS, typename Work, typename RWork>
                 int operator() (MatrA& A, MatrB& B, VecS& s, detail::workspace2<Work, RWork> workspace) const
                 {
- return gelss(A, B, s, workspace.w_, workspace.wr);
+ typedef typename traits::matrix_traits<MatrA>::value_type value_type ;
+ typedef typename traits::type_traits<value_type>::real_type real_type ;
+ return gelss(A, B, s, workspace.select(value_type()), workspace.select(real_type()));
                 }
             };
 
@@ -321,7 +323,7 @@
         template <typename MatrA, typename MatrB, typename VecS, typename Work>
         int gelss(MatrA& A, MatrB& B, VecS& s, Work workspace)
         {
- typedef typename MatrA::value_type val_t;
+ typedef typename traits::matrix_traits<MatrA>::value_type val_t;
 
             return detail::Gelss<n_workspace_args<val_t>::value>() (A, B, s, workspace);
         }
@@ -335,7 +337,7 @@
         template <typename MatrA, typename MatrB, typename Work>
         int gelss(MatrA& A, MatrB& B, Work workspace)
         {
- typedef typename MatrA::value_type val_t;
+ typedef typename traits::matrix_traits<MatrA>::value_type val_t;
             typedef typename traits::type_traits<val_t>::real_type real_t;
 
             const std::ptrdiff_t m = traits::matrix_size1(A);

Modified: sandbox/boost/numeric/bindings/lapack/geqrf.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/geqrf.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/geqrf.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -153,7 +153,7 @@
        typedef typename A::value_type value_type ;
        const std::ptrdiff_t n = traits::matrix_size2 (a);
        traits::detail::array<value_type> work(std::max<std::ptrdiff_t>(1, n));
- return geqrf( a, tau, workspace.w_ );
+ return geqrf( a, tau, workspace.select(value_type()) );
     }
 
     // Function without workarray as argument

Modified: sandbox/boost/numeric/bindings/lapack/hbev.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/hbev.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/hbev.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -149,10 +149,10 @@
                            integer_t const kd, T* ab, integer_t const ldab, R* w, T* z,
                            integer_t const ldz, detail::workspace1<W> work,
                            integer_t& info ) const {
- assert( traits::vector_size( work.w_ ) >= 3*n-2 );
+ assert( traits::vector_size( work.select(T()) ) >= 3*n-2 );
 
              hbev( jobz, uplo, n, kd, ab, ldab, w, z, ldz,
- traits::vector_storage( work.w_ ),
+ traits::vector_storage( work.select(T()) ),
                    info );
           }
        }; // Hbev< 1 >
@@ -192,12 +192,12 @@
                            integer_t const kd, T* ab, integer_t const ldab, R* w, T* z,
                            integer_t const ldz, detail::workspace2<W,RW> work,
                            integer_t& info ) const {
- assert( traits::vector_size( work.wr_ ) >= 3*n-2 );
- assert( traits::vector_size( work.w_ ) >= n );
+ assert( traits::vector_size( work.select(R()) ) >= 3*n-2 );
+ assert( traits::vector_size( work.select(T()) ) >= n );
 
              hbev( jobz, uplo, n, kd, ab, ldab, w, z, ldz,
- traits::vector_storage( work.w_ ),
- traits::vector_storage( work.wr_ ),
+ traits::vector_storage( work.select(T()) ),
+ traits::vector_storage( work.select(R()) ),
                    info );
           }
        }; // Hbev< 2 >
@@ -266,9 +266,8 @@
            typename traits::matrix_traits<Z>::matrix_structure,
            traits::general_t
>::value));
- std::ptrdiff_t const n = traits::matrix_size2 (ab);
- assert (n == traits::matrix_size1 (z));
- assert (n == traits::matrix_size2 (z));
+ assert (traits::matrix_size2 (ab) == traits::matrix_size1 (z));
+ assert (traits::matrix_size2 (ab) == traits::matrix_size2 (z));
           return detail::hbev( 'V', ab, w, z, work );
        } // hbev()
 

Modified: sandbox/boost/numeric/bindings/lapack/hbevx.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/hbevx.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/hbevx.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -181,13 +181,16 @@
           std::pair<detail::workspace1<W>, detail::workspace1<WI> > work,
           integer_t* ifail, integer_t& info ) const {
 
- assert( traits::vector_size( work.first.w_ ) >= 7*n );
- assert( traits::vector_size( work.second.w_ ) >= 5*n );
+ typedef typename traits::vector_traits<W>::value_type w_value_type ;
+ typedef typename traits::vector_traits<WI>::value_type wi_value_type ;
+
+ assert( traits::vector_size( work.first.select(T()) ) >= 7*n );
+ assert( traits::vector_size( work.second.select(R()) ) >= 5*n );
           hbevx( jobz, range, uplo, n, kd, ab, ldab, q, ldq,
             vl, vu, il, iu, abstol, m,
             w, z, ldz,
- traits::vector_storage( work.first.w_ ),
- traits::vector_storage( work.second.w_ ),
+ traits::vector_storage( work.first.select(T()) ),
+ traits::vector_storage( work.second.select(R()) ),
             ifail, info );
         }
       }; // Hbevx< 1 >
@@ -242,15 +245,15 @@
           std::pair<detail::workspace2<W,RW>, detail::workspace1<WI> > work,
           integer_t* ifail, integer_t& info ) const {
 
- assert( traits::vector_size( work.first.w_ ) >= n );
- assert( traits::vector_size( work.first.wr_ ) >= 7*n );
- assert( traits::vector_size( work.second.w_ ) >= 5*n );
+ assert( traits::vector_size( work.first.select(T()) ) >= n );
+ assert( traits::vector_size( work.first.select(R()) ) >= 7*n );
+ assert( traits::vector_size( work.second.select(integer_t()) ) >= 5*n );
           hbevx( jobz, range, uplo, n, kd, ab, ldab, q, ldq,
             vl, vu, il, iu, abstol, m,
             w, z, ldz,
- traits::vector_storage( work.first.w_ ),
- traits::vector_storage( work.first.wr_ ),
- traits::vector_storage( work.second.w_ ),
+ traits::vector_storage( work.first.select(T()) ),
+ traits::vector_storage( work.first.select(R()) ),
+ traits::vector_storage( work.second.select(integer_t()) ),
             ifail, info );
         }
       }; // Hbevx< 2 >

Modified: sandbox/boost/numeric/bindings/lapack/heev.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/heev.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/heev.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -148,7 +148,7 @@
        typedef typename A::value_type value_type ;
        typedef typename traits::type_traits<value_type>::real_type real_type ;
 
- return detail::heev( jobz, uplo, a, w, workspace.w_, workspace.wr_ );
+ return detail::heev( jobz, uplo, a, w, workspace.select( value_type() ), workspace.select( real_type() ) );
     }
 
   }

Modified: sandbox/boost/numeric/bindings/lapack/heevd.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/heevd.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/heevd.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -168,12 +168,12 @@
           T* a, integer_t const lda,
           R* w, std::pair<detail::workspace1<W>, detail::workspace1<WI> > work, integer_t& info) {
 
- assert (traits::vector_size (work.first.w_) >= jobz=='N' ? 1+2*n : 1+6*n+2*n*n);
- assert (traits::vector_size (work.second.w_) >= jobz=='N' ? 1 : 3+5*n);
+ assert (traits::vector_size (work.first.select(T())) >= jobz=='N' ? 1+2*n : 1+6*n+2*n*n);
+ assert (traits::vector_size (work.second.select(integer_t())) >= jobz=='N' ? 1 : 3+5*n);
 
           heevd( jobz, uplo, n, a, lda, w,
- traits::vector_storage (work.first.w_), traits::vector_size (work.first.w_),
- traits::vector_storage (work.second.w_), traits::vector_size (work.second.w_),
+ traits::vector_storage (work.first.select(T())), traits::vector_size (work.first.select(T())),
+ traits::vector_storage (work.second.select(integer_t())), traits::vector_size (work.second.select(integer_t())),
             info);
         }
       };
@@ -230,14 +230,18 @@
           T* a, integer_t const lda,
           R* w, std::pair<detail::workspace2<WC,WR>, detail::workspace1<WI> > work, integer_t& info) {
 
- assert (traits::vector_size (work.first.w_) >= jobz=='N' ? 1+n : 2*n+n*n);
- assert (traits::vector_size (work.first.wr_) >= jobz=='N' ? n : 1+5*n+2*n*n);
- assert (traits::vector_size (work.second.w_) >= jobz=='N' ? 1 : 3+5*n);
+ assert (traits::vector_size (work.first.select(T())) >= jobz=='N' ? 1+n : 2*n+n*n);
+ assert (traits::vector_size (work.first.select(R())) >= jobz=='N' ? n : 1+5*n+2*n*n);
+ assert (traits::vector_size (work.second.select(integer_t())) >= jobz=='N' ? 1 : 3+5*n);
+
+ typedef typename traits::vector_traits<WR>::value_type wr_value_type ;
+ typedef typename traits::vector_traits<WI>::value_type wi_value_type ;
+ typedef typename traits::vector_traits<WC>::value_type wc_value_type ;
 
           heevd( jobz, uplo, n, a, lda, w,
- traits::vector_storage (work.first.w_), traits::vector_size (work.first.w_),
- traits::vector_storage (work.first.wr_), traits::vector_size (work.first.wr_),
- traits::vector_storage (work.second.w_), traits::vector_size (work.second.w_),
+ traits::vector_storage (work.first.select(T())), traits::vector_size (work.first.select(T())),
+ traits::vector_storage (work.first.select(R())), traits::vector_size (work.first.select(R())),
+ traits::vector_storage (work.second.select(integer_t())), traits::vector_size (work.second.select(integer_t())),
             info);
         }
       };

Modified: sandbox/boost/numeric/bindings/lapack/heevx.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/heevx.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/heevx.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -193,12 +193,12 @@
           R abstol, integer_t& m,
           R* w, T* z, integer_t const ldz, std::pair<detail::workspace1<W>, detail::workspace1<WI> > work, integer_t* ifail, integer_t& info) {
 
- assert (traits::vector_size (work.first.w_) >= 8*n);
- assert (traits::vector_size (work.second.w_) >= 5*n);
+ assert (traits::vector_size (work.first.select(T())) >= 8*n);
+ assert (traits::vector_size (work.second.select(integer_t())) >= 5*n);
 
           heevx( jobz, range, uplo, n, a, lda, vl, vu, il, iu, abstol, m, w, z, ldz,
- traits::vector_storage (work.first.w_), traits::vector_size (work.first.w_),
- traits::vector_storage (work.second.w_),
+ traits::vector_storage (work.first.select(T())), traits::vector_size (work.first.select(T())),
+ traits::vector_storage (work.second.select(integer_t())),
             ifail, info);
         }
       };
@@ -261,14 +261,14 @@
           R abstol, integer_t& m,
           R* w, T* z, integer_t const ldz, std::pair<detail::workspace2<WC,WR>, detail::workspace1<WI> > work, integer_t* ifail, integer_t& info) {
 
- assert (traits::vector_size (work.first.w_) >= 2*n);
- assert (traits::vector_size (work.first.wr_) >= 7*n);
- assert (traits::vector_size (work.second.w_) >= 5*n);
+ assert (traits::vector_size (work.first.select(T())) >= 2*n);
+ assert (traits::vector_size (work.first.select(R())) >= 7*n);
+ assert (traits::vector_size (work.second.select(integer_t())) >= 5*n);
 
           heevx( jobz, range, uplo, n, a, lda, vl, vu, il, iu, abstol, m, w, z, ldz,
- traits::vector_storage (work.first.w_), traits::vector_size (work.first.w_),
- traits::vector_storage (work.first.wr_),
- traits::vector_storage (work.second.w_),
+ traits::vector_storage (work.first.select(T())), traits::vector_size (work.first.select(T())),
+ traits::vector_storage (work.first.select(R())),
+ traits::vector_storage (work.second.select(integer_t())),
             ifail, info);
         }
       };

Modified: sandbox/boost/numeric/bindings/lapack/hegv.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/hegv.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/hegv.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -194,10 +194,10 @@
                  T *a, integer_t const lda, T *b, integer_t const ldb,
                  R *w, detail::workspace1<W> work, integer_t& info ) {
 
- assert (traits::vector_size (work.w_) >= 3*n-1);
+ assert (traits::vector_size (work.select(T())) >= 3*n-1);
 
            detail::hegv(itype, jobz, uplo, n, a, lda, b, ldb, w,
- traits::vector_storage (work.w_), traits::vector_size (work.w_), info);
+ traits::vector_storage (work.select(T())), traits::vector_size (work.select(T())), info);
         }
       };
 
@@ -239,12 +239,12 @@
                  T *a, integer_t const lda, T *b, integer_t const ldb,
                  R *w, detail::workspace2<WC,WR> work, integer_t& info ) {
 
- assert (traits::vector_size (work.w_) >= 2*n-1);
- assert (traits::vector_size (work.wr_) >= 3*n-2);
+ assert (traits::vector_size (work.select( T() )) >= 2*n-1);
+ assert (traits::vector_size (work.select( R() )) >= 3*n-2);
 
            detail::hegv(itype, jobz, uplo, n, a, lda, b, ldb, w,
- traits::vector_storage (work.w_), traits::vector_size (work.w_),
- traits::vector_storage (work.wr_), info);
+ traits::vector_storage (work.select(T())), traits::vector_size (work.select(T())),
+ traits::vector_storage (work.select(R())), info);
         }
       }; } // namespace detail
 

Modified: sandbox/boost/numeric/bindings/lapack/hesv.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/hesv.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/hesv.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -417,8 +417,7 @@
>::value));
 #endif
 
- std::ptrdiff_t const lw = traits::vector_size (w);
- assert (lw >= 1);
+ assert (traits::vector_size (w) >= 1);
       return detail::hetrf (ul, a, i, w);
     }
 

Modified: sandbox/boost/numeric/bindings/lapack/hpsv.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/hpsv.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/hpsv.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -153,7 +153,8 @@
       template <typename HermA, typename IVec, typename Work>
       inline
       int hptrf (char const ul, HermA& a, IVec& i, Work& w, integer_t const lw) {
-
+ assert( 0 ) ;
+ return 0 ;
       }
 
     }

Modified: sandbox/boost/numeric/bindings/lapack/orgqr.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/orgqr.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/orgqr.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -153,7 +153,7 @@
        typedef typename A::value_type value_type ;
        const std::ptrdiff_t n = traits::matrix_size2 (a);
        traits::detail::array<value_type> work(std::max<std::ptrdiff_t>(1, n));
- return orgqr( a, tau, workspace.w_ );
+ return orgqr( a, tau, workspace.select(value_type()) );
     }
 
     // Function without workarray as argument

Modified: sandbox/boost/numeric/bindings/lapack/ormqr.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/ormqr.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/ormqr.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -208,9 +208,9 @@
     // where work_array is an array with the same value_type as a and c .
     template <typename A, typename Tau, typename C, typename Work>
     int ormqr (char side, char trans, const A& a, const Tau& tau, C& c, detail::workspace1<Work> workspace ) {
- typedef typename A::value_type value_type ;
+ typedef typename traits::matrix_traits<A>::value_type value_type ;
 
- return detail::ormqr( side, trans, a, tau, c, workspace.w_ );
+ return detail::ormqr( side, trans, a, tau, c, workspace.select(value_type()) );
     }
 
   }

Modified: sandbox/boost/numeric/bindings/lapack/syev.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/syev.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/syev.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -75,12 +75,12 @@
       template <typename A, typename W, typename Work>
       int syev (char jobz, char uplo, A& a, W& w, Work& work) {
 
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+/*#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
         BOOST_STATIC_ASSERT((boost::is_same<
           typename traits::matrix_traits<A>::matrix_structure,
           traits::general_t
>::value));
-#endif
+#endif*/
 
         integer_t const n = traits::matrix_size1 (a);
         assert ( n>0 );
@@ -131,9 +131,9 @@
     // Function that allocates work arrays
     template <typename A, typename W, typename Work>
     int syev (char jobz, char uplo, A& a, W& w, detail::workspace1<Work> workspace ) {
- typedef typename A::value_type value_type ;
+ typedef typename traits::matrix_traits<A>::value_type value_type ;
 
- return detail::syev(jobz, uplo, a, w, workspace.w_);
+ return detail::syev(jobz, uplo, a, w, workspace.select(value_type()));
     } // syev()
 
     // Function without workarray as argument
@@ -144,7 +144,8 @@
     } // syev()
 
     //
- // With UPLO integrated in matrix type
+ // With UPLO integrated in matrix type (this is not possible
+ // since a contains the eigenvectors afterwards and thus A cannot be symmetric)
     //
     template <typename A, typename W>
     int syev (char jobz, A& a, W& w, optimal_workspace ) {
@@ -152,13 +153,13 @@
 
        std::ptrdiff_t const n = traits::matrix_size1 (a);
        char uplo = traits::matrix_uplo_tag( a ) ;
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+/*#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
        typedef typename traits::matrix_traits<A>::matrix_structure matrix_structure ;
        BOOST_STATIC_ASSERT( (boost::mpl::or_< boost::is_same< matrix_structure, traits::symmetric_t >
                                             , boost::is_same< matrix_structure, traits::hermitian_t >
>::value)
                           ) ;
-#endif
+#endif*/
 
        traits::detail::array<value_type> work( std::max<std::ptrdiff_t>(1,34*n) );
        return detail::syev(jobz, uplo, a, w, work);
@@ -172,13 +173,13 @@
 
        std::ptrdiff_t const n = traits::matrix_size1 (a);
        char uplo = traits::matrix_uplo_tag( a ) ;
-#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
+/*#ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK
        typedef typename traits::matrix_traits<A>::matrix_structure matrix_structure ;
        BOOST_STATIC_ASSERT( (boost::mpl::or_< boost::is_same< matrix_structure, traits::symmetric_t >
                                             , boost::is_same< matrix_structure, traits::hermitian_t >
>::value)
                           ) ;
-#endif
+#endif*/
        traits::detail::array<value_type> work( std::max<std::ptrdiff_t>(1,3*n-1) );
        return detail::syev(jobz, uplo, a, w, work);
     } // syev()
@@ -196,7 +197,7 @@
>::value)
                           ) ;
 #endif
- return detail::syev(jobz, uplo, a, w, workspace.w_);
+ return detail::syev(jobz, uplo, a, w, workspace.select(value_type()));
     } // syev()
 
     // Function without workarray as argument

Modified: sandbox/boost/numeric/bindings/lapack/sysv.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/sysv.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/sysv.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -20,7 +20,6 @@
 #include <boost/numeric/bindings/traits/detail/array.hpp>
 #include "boost/numeric/bindings/traits/ublas_symmetric.hpp"
 #include <boost/numeric/bindings/lapack/ilaenv.hpp>
-#include <boost/numeric/bindings/lapack/workspace.hpp>
 
 
 #ifndef BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK

Modified: sandbox/boost/numeric/bindings/lapack/workspace.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/workspace.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/workspace.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -46,23 +46,63 @@
      namespace detail {
 
         template <typename W>
- struct workspace1 {
- W& w_ ;
+ class workspace1 {
+ public:
+ workspace1(W& w)
+ : w_( w )
+ {}
+
+ public:
+ typedef typename traits::vector_traits<W>::value_type value_type ;
+ W& select( value_type const& ) { return w_ ; }
 
- workspace1(W& w)
- : w_( w )
- {}
+ private:
+ W& w_ ;
         }; // struct workspace1
 
- template <typename W, typename WR>
- struct workspace2 {
- W& w_ ;
- WR& wr_ ;
-
- workspace2(W& w, WR& wr)
- : w_(w)
- , wr_(wr)
- {}
+ template <typename W, typename WRI>
+ class workspace2 {
+ public:
+ workspace2(W& w, WRI& wri)
+ : w_(w)
+ , wri_(wri)
+ {}
+
+ public:
+ typedef typename traits::vector_traits<W>::value_type w_value_type ;
+ W& select( w_value_type const& ) { return w_ ; }
+
+ typedef typename traits::vector_traits<WRI>::value_type wri_value_type ;
+ WRI& select( wri_value_type const& ) { return wri_ ; }
+
+ private:
+ W& w_ ;
+ WRI& wri_ ;
+ }; // struct workspace2
+
+ template <typename W, typename WR, typename WI>
+ class workspace3 {
+ public:
+ workspace3(W& w, WR& wr, WI& wi)
+ : w_(w)
+ , wr_(wr)
+ , wi_(wi)
+ {}
+
+ public:
+ typedef typename traits::vector_traits<W>::value_type w_value_type ;
+ W& select( w_value_type const& ) { return w_ ; }
+
+ typedef typename traits::vector_traits<WR>::value_type wr_value_type ;
+ WR& select( wr_value_type const& ) { return wr_ ; }
+
+ typedef typename traits::vector_traits<WI>::value_type wi_value_type ;
+ WI& select( wi_value_type const& ) { return wi_ ; }
+
+ private:
+ W& w_ ;
+ WR& wr_ ;
+ WI& wi_ ;
         }; // struct workspace2
 
      }
@@ -72,9 +112,22 @@
         return detail::workspace1<W>(w) ;
      } // workspace()
 
- template <typename W, typename WR>
- detail::workspace2<W,WR> workspace(W& w, WR& wr) {
- return detail::workspace2<W,WR>(w, wr) ;
+ //
+ // Two situations:
+ // Real valued: workspace( real array, integer array )
+ // Complex valued: workspace( complex array, real array )
+ //
+ template <typename W, typename WRI>
+ detail::workspace2<W,WRI> workspace(W& w, WRI& wri) {
+ return detail::workspace2<W,WRI>(w, wri) ;
+ } // workspace()
+
+ //
+ // Complex valued: workspace( complex array, real array, integer array )
+ //
+ template <typename W, typename WR, typename WI>
+ detail::workspace3<W,WR,WI> workspace(W& w, WR& wr, WI& wi) {
+ return detail::workspace3<W,WR,WI>(w, wr,wi) ;
      } // workspace()
 
 

Modified: sandbox/boost/numeric/bindings/traits/detail/ublas_uplo.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/detail/ublas_uplo.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/detail/ublas_uplo.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -24,14 +24,25 @@
     struct ublas_uplo {};
     
     template<>
- struct ublas_uplo<boost::numeric::ublas::lower> {
+ struct ublas_uplo<boost::numeric::ublas::lower_tag> {
       typedef lower_t type;
     };
+
     template<>
- struct ublas_uplo<boost::numeric::ublas::upper> {
+ struct ublas_uplo<boost::numeric::ublas::upper_tag> {
+ typedef upper_t type;
+ };
+
+ template<typename I>
+ struct ublas_uplo< boost::numeric::ublas::basic_upper<I> > {
       typedef upper_t type;
     };
 
+ template<typename I>
+ struct ublas_uplo< boost::numeric::ublas::basic_lower<I> > {
+ typedef lower_t type;
+ };
+
   }
 
 }}}}

Modified: sandbox/boost/numeric/bindings/traits/matrix_raw.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/matrix_raw.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/matrix_raw.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -24,73 +24,61 @@
 
   template <typename M>
   BOOST_UBLAS_INLINE
- int matrix_size1 (const M &m) {
- return (int) m.size1();
+ std::ptrdiff_t matrix_num_rows (const M &m) {
+ return (std::ptrdiff_t) m.size1();
   }
   template <typename M>
   BOOST_UBLAS_INLINE
- int matrix_size2 (const M &m) {
- return (int) m.size2();
+ std::ptrdiff_t matrix_num_columns (const M &m) {
+ return (std::ptrdiff_t) m.size2();
   }
 
 #if 0
   // MSVC seems to dislike overloads if there is 'generic' template
   template <typename M>
   BOOST_UBLAS_INLINE
- int matrix_size1 (const ublas::matrix_reference<M> &m) {
- return matrix_size1 (m.expression());
+ std::ptrdiff_t matrix_num_rows (const ublas::matrix_reference<M> &m) {
+ return matrix_num_rows (m.expression());
   }
   template <typename M>
   BOOST_UBLAS_INLINE
- int matrix_size2 (const ublas::matrix_reference<M> &m) {
- return matrix_size2 (m.expression());
+ std::ptrdiff_t matrix_num_columns (const ublas::matrix_reference<M> &m) {
+ return matrix_num_columns (m.expression());
   }
 #endif // 0
 
 
   template <typename T, typename F, typename A>
   BOOST_UBLAS_INLINE
- int matrix_storage_size (const ublas::matrix<T,F,A>& m) {
- return (int) (m.size1() * m.size2());
- }
- template <typename T, std::size_t M, std::size_t N>
- BOOST_UBLAS_INLINE
- int matrix_storage_size (const ublas::c_matrix<T, M, N> &m) {
- return (int) (M * N);
- }
-
-
- template <typename T, typename F, typename A>
- BOOST_UBLAS_INLINE
- int leading_dimension (const ublas::matrix<T,F,A> &m, ublas::row_major_tag) {
- return (int) m.size2();
+ std::ptrdiff_t leading_dimension (const ublas::matrix<T,F,A> &m, ublas::row_major_tag) {
+ return (std::ptrdiff_t) m.size2();
   }
   template <typename T, typename F, typename A>
   BOOST_UBLAS_INLINE
- int leading_dimension (const ublas::matrix<T,F,A> &m, ublas::column_major_tag) {
- return (int) m.size1();
+ std::ptrdiff_t leading_dimension (const ublas::matrix<T,F,A> &m, ublas::column_major_tag) {
+ return (std::ptrdiff_t) m.size1();
   }
   template <typename T, typename F, typename A>
   BOOST_UBLAS_INLINE
- int leading_dimension (const ublas::matrix<T,F,A> &m) {
+ std::ptrdiff_t leading_dimension (const ublas::matrix<T,F,A> &m) {
     typedef ublas::matrix<T,F,A> matrix_t;
     return bindings::traits::leading_dimension
       (m, BOOST_UBLAS_TYPENAME matrix_t::orientation_category());
   }
   template <typename M>
   BOOST_UBLAS_INLINE
- int leading_dimension (const ublas::matrix_reference<M> &m) {
+ std::ptrdiff_t leading_dimension (const ublas::matrix_reference<M> &m) {
     return bindings::traits::leading_dimension (m.expression());
   }
   template <typename M>
   BOOST_UBLAS_INLINE
- int leading_dimension (const ublas::matrix_range<M> &m) {
+ std::ptrdiff_t leading_dimension (const ublas::matrix_range<M> &m) {
     return bindings::traits::leading_dimension (m.data());
   }
   template <typename T, std::size_t M, std::size_t N>
   BOOST_UBLAS_INLINE
- int leading_dimension (const ublas::c_matrix<T, M, N> &m) {
- return (int) N;
+ std::ptrdiff_t leading_dimension (const ublas::c_matrix<T, M, N> &m) {
+ return (std::ptrdiff_t) N;
   }
 
 
@@ -100,72 +88,72 @@
   // MSVC seems to dislike overloads if there is 'generic' template
   template <typename M>
   BOOST_UBLAS_INLINE
- int matrix_stride1 (const M &m) {
+ std::ptrdiff_t matrix_stride1 (const M &m) {
     typedef typename M::functor_type functor_type;
- return (int) functor_type::one1 (m.size1(), m.size2());
+ return (std::ptrdiff_t) functor_type::one1 (m.size1(), m.size2());
   }
   template <typename M>
   BOOST_UBLAS_INLINE
- int matrix_stride2 (const M &m) {
+ std::ptrdiff_t matrix_stride2 (const M &m) {
     typedef typename M::functor_type functor_type;
- return (int) functor_type::one2 (m.size1(), m.size2());
+ return (std::ptrdiff_t) functor_type::one2 (m.size1(), m.size2());
   }
 #endif // 0
 
   template <typename M, typename F, typename A>
   BOOST_UBLAS_INLINE
- int matrix_stride1 (const ublas::matrix<M,F,A> &m) {
- return (int) F::one1 (m.size1(), m.size2());
+ std::ptrdiff_t matrix_stride1 (const ublas::matrix<M,F,A> &m) {
+ return (std::ptrdiff_t) F::one1 (m.size1(), m.size2());
   }
   template <typename M, typename F, typename A>
   BOOST_UBLAS_INLINE
- int matrix_stride2 (const ublas::matrix<M,F,A> &m) {
- return (int) F::one2 (m.size1(), m.size2());
+ std::ptrdiff_t matrix_stride2 (const ublas::matrix<M,F,A> &m) {
+ return (std::ptrdiff_t) F::one2 (m.size1(), m.size2());
   }
   template <typename M>
   BOOST_UBLAS_INLINE
- int matrix_stride1 (const ublas::matrix_reference<M> &m) {
+ std::ptrdiff_t matrix_stride1 (const ublas::matrix_reference<M> &m) {
     return matrix_stride1 (m.expression());
   }
   template <typename M>
   BOOST_UBLAS_INLINE
- int matrix_stride2 (const ublas::matrix_reference<M> &m) {
+ std::ptrdiff_t matrix_stride2 (const ublas::matrix_reference<M> &m) {
     return matrix_stride2 (m.expression());
   }
   template <typename T, std::size_t M, std::size_t N>
   BOOST_UBLAS_INLINE
- int matrix_stride1 (const ublas::c_matrix<T, M, N> &m) { return (int) N; }
+ std::ptrdiff_t matrix_stride1 (const ublas::c_matrix<T, M, N> &m) { return (std::ptrdiff_t) N; }
   template <typename T, std::size_t M, std::size_t N>
   BOOST_UBLAS_INLINE
- int matrix_stride2 (const ublas::c_matrix<T, M, N> &m) { return 1; }
+ std::ptrdiff_t matrix_stride2 (const ublas::c_matrix<T, M, N> &m) { return 1; }
   template <typename M>
   BOOST_UBLAS_INLINE
- int matrix_stride1 (const ublas::matrix_range<M> &m) {
+ std::ptrdiff_t matrix_stride1 (const ublas::matrix_range<M> &m) {
     return matrix_stride1 (m.data());
   }
   template <typename M>
   BOOST_UBLAS_INLINE
- int matrix_stride2 (const ublas::matrix_range<M> &m) {
+ std::ptrdiff_t matrix_stride2 (const ublas::matrix_range<M> &m) {
     return matrix_stride2 (m.data());
   }
   template <typename M>
   BOOST_UBLAS_INLINE
- int matrix_stride1 (const ublas::matrix_slice<M> &m) {
- return (int) (m.stride1() * matrix_stride1 (m.data()));
+ std::ptrdiff_t matrix_stride1 (const ublas::matrix_slice<M> &m) {
+ return (std::ptrdiff_t) (m.stride1() * matrix_stride1 (m.data()));
   }
   template <typename M>
   BOOST_UBLAS_INLINE
- int matrix_stride2 (const ublas::matrix_slice<M> &m) {
- return (int) (m.stride2() * matrix_stride2 (m.data()));
+ std::ptrdiff_t matrix_stride2 (const ublas::matrix_slice<M> &m) {
+ return (std::ptrdiff_t) (m.stride2() * matrix_stride2 (m.data()));
   }
   template <typename M>
   BOOST_UBLAS_INLINE
- int vector_stride (const ublas::matrix_row<M> &v) {
+ std::ptrdiff_t vector_stride (const ublas::matrix_row<M> &v) {
     return matrix_stride2 (v.data());
   }
   template <typename M>
   BOOST_UBLAS_INLINE
- int vector_stride (const ublas::matrix_column<M> &v) {
+ std::ptrdiff_t vector_stride (const ublas::matrix_column<M> &v) {
     return matrix_stride1 (v.data());
   }
 

Modified: sandbox/boost/numeric/bindings/traits/matrix_traits.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/matrix_traits.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/matrix_traits.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -59,7 +59,6 @@
     // std::ptrdiff_t num_columns()
     // std::ptrdiff_t lower_bandwidth() // only banded matrix types
     // std::ptrdiff_t upper_bandwidth() // only banded matrix types
- // std::ptrdiff_t storage_size() // not all matrix types
     // std::ptrdiff_t leading_dimension() // not all matrix types
   };
 
@@ -104,10 +103,6 @@
   
   template <typename M>
   inline
- std::ptrdiff_t matrix_storage_size (M& m) { return matrix_traits<M>::storage_size (m); }
-
- template <typename M>
- inline
   std::ptrdiff_t matrix_stride1 (M& m) { return matrix_traits<M>::stride1 (m); }
 
   template <typename M>

Modified: sandbox/boost/numeric/bindings/traits/ublas_banded.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/ublas_banded.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/ublas_banded.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -69,7 +69,6 @@
     static std::ptrdiff_t num_columns (matrix_type& m) { return m.size2(); }
     static std::ptrdiff_t lower_bandwidth (matrix_type& m) { return m.lower() ; }
     static std::ptrdiff_t upper_bandwidth (matrix_type& m) { return m.upper() ; }
- static std::ptrdiff_t storage_size (matrix_type& m) { return size1 (m) * size2 (m); }
     static std::ptrdiff_t leading_dimension (matrix_type& m) {
       typedef typename identifier_type::orientation_category orientation_category;
       return detail::ublas_banded_ordering<orientation_category>::leading_dimension(m) ;

Modified: sandbox/boost/numeric/bindings/traits/ublas_hermitian.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/ublas_hermitian.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/ublas_hermitian.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -59,9 +59,6 @@
     }
     static std::ptrdiff_t num_rows (matrix_type& hm) { return hm.size1(); }
     static std::ptrdiff_t num_columns (matrix_type& hm) { return hm.size2(); }
- static std::ptrdiff_t storage_size (matrix_type& hm) {
- return (num_rows (hm) + 1) * num_columns (hm) / 2;
- }
   };
 
 
@@ -106,9 +103,6 @@
     }
     static std::ptrdiff_t num_rows (matrix_type& hm) { return hm.size1(); }
     static std::ptrdiff_t num_columns (matrix_type& hm) { return hm.size2(); }
- static std::ptrdiff_t storage_size (matrix_type& hm) {
- return num_rows (hm) * num_columns (hm);
- }
     static std::ptrdiff_t leading_dimension (matrix_type& hm) {
       return matrix_traits<m_type>::leading_dimension (hm.data());
     }

Modified: sandbox/boost/numeric/bindings/traits/ublas_matrix.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/ublas_matrix.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/ublas_matrix.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -68,7 +68,6 @@
     }
     static std::ptrdiff_t num_rows (matrix_type& m) { return m.size1(); }
     static std::ptrdiff_t num_columns (matrix_type& m) { return m.size2(); }
- static std::ptrdiff_t storage_size (matrix_type& m) { return m.size1() * m.size2(); }
     static std::ptrdiff_t leading_dimension (matrix_type& m) {
       // g++ 2.95.4 and 3.0.4 (with -pedantic) dislike
       // identifier_type::functor_type::size2()
@@ -324,7 +323,6 @@
     static pointer storage (matrix_type& m) { return m.data(); }
     static std::ptrdiff_t num_rows (matrix_type& m) { return m.size1(); }
     static std::ptrdiff_t num_columns (matrix_type& m) { return m.size2(); }
- static std::ptrdiff_t storage_size (matrix_type& m) { return M * N; }
     static std::ptrdiff_t leading_dimension (matrix_type& m) { return N; }
 
     // stride1 == distance (m (i, j), m (i+1, j))

Modified: sandbox/boost/numeric/bindings/traits/ublas_symmetric.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/ublas_symmetric.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/ublas_symmetric.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -59,9 +59,6 @@
     }
     static std::ptrdiff_t num_rows (matrix_type& sm) { return sm.size1(); }
     static std::ptrdiff_t num_columns (matrix_type& sm) { return sm.size2(); }
- static std::ptrdiff_t storage_size (matrix_type& sm) {
- return (num_rows (sm) + 1) * num_columns (sm) / 2;
- }
   };
 
 
@@ -91,9 +88,6 @@
     }
     static std::ptrdiff_t num_rows (matrix_type& sm) { return sm.size1(); }
     static std::ptrdiff_t num_columns (matrix_type& sm) { return sm.size2(); }
- static std::ptrdiff_t storage_size (matrix_type& sm) {
- return num_rows (sm) * num_columns (sm);
- }
     static std::ptrdiff_t leading_dimension (matrix_type& sm) {
       return matrix_traits<m_type>::leading_dimension (sm.data());
     }

Modified: sandbox/boost/numeric/bindings/traits/ublas_vector2.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/ublas_vector2.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/ublas_vector2.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -58,7 +58,6 @@
     }
     static std::ptrdiff_t num_rows (matrix_type& v) { return v.size(); }
     static std::ptrdiff_t num_columns (matrix_type&) { return 1; }
- static std::ptrdiff_t storage_size (matrix_type& v) { return v.size(); }
 // static std::ptrdiff_t stride1 (matrix_type& v) { return vector_traits<V>::stride (v); }
 // static std::ptrdiff_t stride2 (matrix_type&) { return 1; }
     static std::ptrdiff_t leading_dimension (matrix_type& v) { return v.size(); }
@@ -90,7 +89,6 @@
     }
     static std::ptrdiff_t num_rows (matrix_type& v) { return v.size(); }
     static std::ptrdiff_t num_columns (matrix_type&) { return 1; }
- static std::ptrdiff_t storage_size (matrix_type& v) { return v.size(); }
 // static std::ptrdiff_t stride1 (matrix_type& v) { return vector_traits<V>::stride (v); }
 // static std::ptrdiff_t stride2 (matrix_type&) { return 1; }
     static std::ptrdiff_t leading_dimension (matrix_type& v) { return v.size(); }
@@ -122,9 +120,6 @@
     static pointer storage (matrix_type& v) { return v.data(); }
     static std::ptrdiff_t num_rows (matrix_type&) { return 1; }
     static std::ptrdiff_t num_columns (matrix_type& v) { return v.size(); }
-// static std::ptrdiff_t stride1 (matrix_type& v) { return vector_traits<V>::stride (v); }
-// static std::ptrdiff_t stride2 (matrix_type&) { return 1; }
- static std::ptrdiff_t storage_size (matrix_type&) { return N; }
     static std::ptrdiff_t leading_dimension (matrix_type&) { return N; }
   };
 

Modified: sandbox/boost/numeric/bindings/traits/vector_raw.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/vector_raw.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/vector_raw.hpp 2009-01-08 05:55:57 EST (Thu, 08 Jan 2009)
@@ -22,8 +22,8 @@
 
   template <typename V>
   BOOST_UBLAS_INLINE
- int vector_size (const V &v) {
- return (int) v.size();
+ std::ptrdiff_t vector_size (const V &v) {
+ return (std::ptrdiff_t) v.size();
   }
 
   ////////////////////////////////////////////////////////////////
@@ -35,7 +35,7 @@
   // MSVC seems to dislike overloads if there is `generic' template
   template <typename V>
   BOOST_UBLAS_INLINE
- int vector_size (const ublas::vector_reference<V> &v) {
+ std::ptrdiff_t vector_size (const ublas::vector_reference<V> &v) {
     return vector_size (v.expression());
   }
 #endif
@@ -44,30 +44,30 @@
   // MSVC seems to dislike overloads if there is `generic' template
   template <typename V>
   BOOST_UBLAS_INLINE
- int vector_stride (const V &v) { return 1; }
+ std::ptrdiff_t vector_stride (const V &v) { return 1; }
 #endif
   template <typename T, typename A>
   BOOST_UBLAS_INLINE
- int vector_stride (const ublas::vector<T,A> &v) { return 1; }
+ std::ptrdiff_t vector_stride (const ublas::vector<T,A> &v) { return 1; }
   template <typename V>
   BOOST_UBLAS_INLINE
- int vector_stride (const ublas::vector_reference<V> &v) {
- return (int) vector_stride (v.expression());
+ std::ptrdiff_t vector_stride (const ublas::vector_reference<V> &v) {
+ return (std::ptrdiff_t) vector_stride (v.expression());
   }
   template <typename T, std::size_t N>
   BOOST_UBLAS_INLINE
- int vector_stride (const ublas::c_vector<T, N> &v) { return 1; }
+ std::ptrdiff_t vector_stride (const ublas::c_vector<T, N> &v) { return 1; }
   template <typename V>
- int vector_stride (const ublas::vector_slice<V>&);
+ std::ptrdiff_t vector_stride (const ublas::vector_slice<V>&);
   template <typename V>
   BOOST_UBLAS_INLINE
- int vector_stride (const ublas::vector_range<V> &v) {
- return (int) vector_stride (v.data());
+ std::ptrdiff_t vector_stride (const ublas::vector_range<V> &v) {
+ return (std::ptrdiff_t) vector_stride (v.data());
   }
   template <typename V>
   BOOST_UBLAS_INLINE
- int vector_stride (const ublas::vector_slice<V> &v) {
- return (int) (v.stride() * vector_stride (v.data()));
+ std::ptrdiff_t vector_stride (const ublas::vector_slice<V> &v) {
+ return (std::ptrdiff_t) (v.stride() * vector_stride (v.data()));
   }
 
 
@@ -226,7 +226,7 @@
 
   template <typename T, typename A>
   BOOST_UBLAS_INLINE
- int vector_stride (const std::vector<T,A> &v) { return 1; }
+ std::ptrdiff_t vector_stride (const std::vector<T,A> &v) { return 1; }
 
 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
   template <typename T, typename A>
@@ -252,7 +252,7 @@
 
   template <typename T>
   BOOST_UBLAS_INLINE
- int vector_stride (const detail::array<T> &a) { return 1; }
+ std::ptrdiff_t vector_stride (const detail::array<T> &a) { return 1; }
 
 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
   template <typename T>


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