Boost logo

Boost-Commit :

From: karl.meerbergen_at_[hidden]
Date: 2008-09-01 10:34:27


Author: karlmeerbergen
Date: 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
New Revision: 48511
URL: http://svn.boost.org/trac/boost/changeset/48511

Log:
changed size1, size2 into num_rows, num_columns
added mumps driver for 4.8.0

Added:
   sandbox/boost/numeric/bindings/mumps/mumps_driver_4_8_0.hpp (contents, props changed)
Text files modified:
   sandbox/boost/numeric/bindings/lapack/ptsv.hpp | 8 ++--
   sandbox/boost/numeric/bindings/mumps/mumps_driver.hpp | 2
   sandbox/boost/numeric/bindings/mumps/mumps_driver_4_6_4.hpp | 6 +-
   sandbox/boost/numeric/bindings/traits/detail/array.hpp | 3 +
   sandbox/boost/numeric/bindings/traits/detail/array_impl.hpp | 9 ++--
   sandbox/boost/numeric/bindings/traits/detail/ublas_ordering.hpp | 24 ++++++------
   sandbox/boost/numeric/bindings/traits/matrix_traits.hpp | 39 +++++++++++++--------
   sandbox/boost/numeric/bindings/traits/sparse_traits.hpp | 26 +++++++++-----
   sandbox/boost/numeric/bindings/traits/transpose.hpp | 8 ++++
   sandbox/boost/numeric/bindings/traits/ublas_banded.hpp | 16 ++++----
   sandbox/boost/numeric/bindings/traits/ublas_hermitian.hpp | 26 +++++++-------
   sandbox/boost/numeric/bindings/traits/ublas_matrix.hpp | 70 ++++++++++++++++++++--------------------
   sandbox/boost/numeric/bindings/traits/ublas_sparse.hpp | 6 +-
   sandbox/boost/numeric/bindings/traits/ublas_symmetric.hpp | 18 +++++-----
   sandbox/boost/numeric/bindings/traits/ublas_vector.hpp | 6 +-
   sandbox/boost/numeric/bindings/traits/ublas_vector2.hpp | 24 ++++++------
   sandbox/boost/numeric/bindings/traits/vector_traits.hpp | 8 ++--
   sandbox/libs/numeric/bindings/lapack/test/utils.h | 10 ++--
   18 files changed, 168 insertions(+), 141 deletions(-)

Modified: sandbox/boost/numeric/bindings/lapack/ptsv.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/lapack/ptsv.hpp (original)
+++ sandbox/boost/numeric/bindings/lapack/ptsv.hpp 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -79,10 +79,10 @@
     inline int ptsv( D& d, E& e, B& b ) {
       int const n = traits::vector_size(d) ;
       assert( n==traits::vector_size(e)+1 ) ;
- assert( n==traits::matrix_size1(b) ) ;
+ assert( n==traits::matrix_num_rows(b) ) ;
 
       int info ;
- detail::ptsv( n, traits::matrix_size2 (b)
+ detail::ptsv( n, traits::matrix_num_columns (b)
                   , traits::vector_storage(d)
                   , traits::vector_storage(e)
                   , traits::matrix_storage(b)
@@ -190,10 +190,10 @@
     int pttrs (char uplo, D const& d, E const& e, MatrB& b) {
       int const n = traits::vector_size (d);
       assert (n == traits::vector_size (e) + 1);
- assert (n == traits::matrix_size1 (b));
+ assert (n == traits::matrix_num_rows (b));
       
       int info;
- detail::pttrs (uplo, n, traits::matrix_size2 (b),
+ detail::pttrs (uplo, n, traits::matrix_num_columns (b),
                      traits::vector_storage (d),
                      traits::vector_storage (e),
                      traits::matrix_storage (b),

Modified: sandbox/boost/numeric/bindings/mumps/mumps_driver.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/mumps/mumps_driver.hpp (original)
+++ sandbox/boost/numeric/bindings/mumps/mumps_driver.hpp 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -9,6 +9,6 @@
 #ifndef BOOST_NUMERIC_BINDINGS_MUMPS_MUMPS_DRIVER_HPP
 #define BOOST_NUMERIC_BINDINGS_MUMPS_MUMPS_DRIVER_HPP
 
-#include <boost/numeric/bindings/mumps/mumps_driver_4_6_4.hpp>
+#include <boost/numeric/bindings/mumps/mumps_driver_4_8_0.hpp>
 
 #endif

Modified: sandbox/boost/numeric/bindings/mumps/mumps_driver_4_6_4.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/mumps/mumps_driver_4_6_4.hpp (original)
+++ sandbox/boost/numeric/bindings/mumps/mumps_driver_4_6_4.hpp 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -210,8 +210,8 @@
   template <typename M>
   void matrix_integer_data( mumps<M>& data, M& m ) {
     BOOST_STATIC_ASSERT( (1 == boost::numeric::bindings::traits::sparse_matrix_traits<M>::index_base) ) ;
- data.n = boost::numeric::bindings::traits::spmatrix_size1( m ) ;
- assert( boost::numeric::bindings::traits::spmatrix_size2( m ) == data.n ) ;
+ data.n = boost::numeric::bindings::traits::spmatrix_num_rows( m ) ;
+ assert( boost::numeric::bindings::traits::spmatrix_num_columns( m ) == data.n ) ;
 
     data.nz = boost::numeric::bindings::traits::spmatrix_num_nonzeros( m ) ;
     detail::indices( typename boost::numeric::bindings::traits::sparse_matrix_traits<M>::ordering_type(), data.irn, data.jcn, m ) ;
@@ -238,7 +238,7 @@
   template <typename M, typename X>
   void rhs_sol_value_data( mumps<M>& data, X& x ) {
     data.rhs = detail::cast_2_mumps( boost::numeric::bindings::traits::matrix_storage( x ) ) ;
- data.nrhs = boost::numeric::bindings::traits::matrix_size2( x ) ;
+ data.nrhs = boost::numeric::bindings::traits::matrix_num_columns( x ) ;
     data.lrhs = boost::numeric::bindings::traits::leading_dimension( x ) ;
   } // matrix_rhs_sol_value_data()
 

Added: sandbox/boost/numeric/bindings/mumps/mumps_driver_4_8_0.hpp
==============================================================================
--- (empty file)
+++ sandbox/boost/numeric/bindings/mumps/mumps_driver_4_8_0.hpp 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -0,0 +1,261 @@
+//
+// Copyright Karl Meerbergen 2008
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_NUMERIC_BINDINGS_MUMPS_MUMPS_DRIVER_4_6_4_HPP
+#define BOOST_NUMERIC_BINDINGS_MUMPS_MUMPS_DRIVER_4_6_4_HPP
+
+#include <smumps_c.hpp>
+#include <cmumps_c.hpp>
+#include <dmumps_c.hpp>
+#include <4.6.4/zmumps_c.hpp>
+#include <boost/numeric/bindings/traits/sparse_traits.hpp>
+#include <boost/numeric/bindings/traits/matrix_traits.hpp>
+#include <boost/numeric/bindings/traits/type_traits.hpp>
+#include <boost/static_assert.hpp>
+#include <complex>
+#include <cassert>
+
+//
+// This file contains a C++ driver for MUMPS
+//
+// The templated class mumps<M> is a wrapper for the corresponding C struct.
+// The class contains constructor and destructor that call mumps with JOB=-1 and JOB=-2
+// respectively.
+//
+// The function driver() calls MUMPS. The user must set the parameters of the data manually.
+//
+// The following functions are very helpful in this respect, since they extract pointer and size
+// data using the Boost Bindings.
+//
+// void matrix_integer_data() : to set the integer data of the matrix.
+// void matrix_value_data() : to set the values of the matrix.
+// void rhs_sol_value_data() : to set the right-hand side and solution vectors in the case of a dense solution vector.
+//
+
+namespace boost { namespace numeric { namespace bindings { namespace mumps {
+
+ namespace detail {
+ //
+ // Type and Driver
+ //
+ template <class T>
+ struct mumps_type {
+ } ;
+
+ template <class T>
+ struct mumps_call {
+ } ;
+
+ template <class T>
+ struct mumps_internal_value_type {
+ typedef T type ;
+ } ;
+
+ //
+ // Specialization for float
+ //
+
+ template <>
+ struct mumps_type< float > {
+ typedef SMUMPS_STRUC_C type ;
+ } ;
+
+ template <>
+ struct mumps_call< float > {
+ void operator() ( SMUMPS_STRUC_C& struc ) const {
+ smumps_c( &struc ) ;
+ }
+ } ;
+
+ //
+ // Specialization for double
+ //
+
+ template <>
+ struct mumps_type< double > {
+ typedef DMUMPS_STRUC_C type ;
+ } ;
+
+ template <>
+ struct mumps_call< double > {
+ void operator() ( DMUMPS_STRUC_C& struc ) const {
+ dmumps_c( &struc ) ;
+ }
+ } ;
+
+ //
+ // Specialization for complex<float>
+ //
+
+ template <>
+ struct mumps_type< std::complex< float > > {
+ typedef CMUMPS_STRUC_C type ;
+ } ;
+
+ template <>
+ struct mumps_call< std::complex< float > > {
+ void operator() ( CMUMPS_STRUC_C& struc ) const {
+ cmumps_c( &struc ) ;
+ }
+ } ;
+
+ template <>
+ struct mumps_internal_value_type< std::complex<float> > {
+ typedef mumps_complex type ;
+ } ;
+
+ //
+ // Specialization for complex<double>
+ //
+
+ template <>
+ struct mumps_type< std::complex< double > > {
+ typedef ZMUMPS_STRUC_C type ;
+ } ;
+
+ template <>
+ struct mumps_call< std::complex< double > > {
+ void operator() ( ZMUMPS_STRUC_C& struc ) const {
+ zmumps_c( &struc ) ;
+ }
+ } ;
+
+ template <>
+ struct mumps_internal_value_type< std::complex<double> > {
+ typedef mumps_double_complex type ;
+ } ;
+
+ //
+ // Symmetry map
+ //
+
+ template <class T>
+ struct mumps_sym {
+ } ;
+
+ template <>
+ struct mumps_sym< boost::numeric::bindings::traits::symmetric_t > {
+ static int const value = 2 ;
+ } ;
+
+ template <>
+ struct mumps_sym< boost::numeric::bindings::traits::general_t > {
+ static int const value = 0 ;
+ } ;
+
+ //
+ // Get index pointers
+ //
+ template <typename M>
+ void indices( boost::numeric::bindings::traits::row_major_t, int*& rows, int*& cols, M const& m ) {
+ rows = const_cast<int*>( boost::numeric::bindings::traits::spmatrix_index1_storage( m ) ) ;
+ cols = const_cast<int*>( boost::numeric::bindings::traits::spmatrix_index2_storage( m ) ) ;
+ }
+
+ template <typename M>
+ void indices( boost::numeric::bindings::traits::column_major_t, int*& rows, int*& cols, M const& m ) {
+ cols = const_cast<int*>( boost::numeric::bindings::traits::spmatrix_index1_storage( m ) ) ;
+ rows = const_cast<int*>( boost::numeric::bindings::traits::spmatrix_index2_storage( m ) ) ;
+ }
+
+ // Pointer Cast
+ float* cast_2_mumps( float* p ) { return p ; }
+ double* cast_2_mumps( double* p ) { return p ; }
+ mumps_double_complex* cast_2_mumps( std::complex<double>* p ) { return reinterpret_cast<mumps_double_complex*>( p ) ; }
+ mumps_complex* cast_2_mumps( std::complex<float>* p ) { return reinterpret_cast<mumps_complex*>( p ) ; }
+ } // namespace detail
+
+
+
+ //
+ // Generic MUMPS data for any value_type
+ //
+ template <typename M>
+ struct mumps
+ : detail::mumps_type< typename boost::numeric::bindings::traits::sparse_matrix_traits<M>::value_type >::type
+ {
+ typedef typename boost::numeric::bindings::traits::sparse_matrix_traits<M>::value_type value_type ;
+ typedef typename detail::mumps_type< typename boost::numeric::bindings::traits::sparse_matrix_traits<M>::value_type >::type c_struct_type ;
+
+ //
+ // Initialize MUMPS solver
+ // Pass a communicator (comm=-987654 means choose default)
+ // Pass 'par': default = 1: host is involved in factorization
+ //
+ mumps( int comm_fortran=-987654, int par=1 )
+ {
+ this->job = -1 ;
+ this->par = par ;
+ this->comm_fortran = comm_fortran ;
+ this->sym = detail::mumps_sym< typename boost::numeric::bindings::traits::sparse_matrix_traits<M>::matrix_structure >::value ;
+ detail::mumps_call<value_type>() ( *this ) ;
+ }
+
+ // Destroy the solver
+ ~mumps() {
+ this->job = -2 ;
+ detail::mumps_call<value_type>() ( *this ) ;
+ }
+ } ;
+
+
+ //
+ // Copy the matrix integer data (matrix order, structure) to the MUMPS struct
+ //
+ template <typename M>
+ void matrix_integer_data( mumps<M>& data, M& m ) {
+ BOOST_STATIC_ASSERT( (1 == boost::numeric::bindings::traits::sparse_matrix_traits<M>::index_base) ) ;
+ data.n = boost::numeric::bindings::traits::spmatrix_num_rows( m ) ;
+ assert( boost::numeric::bindings::traits::spmatrix_num_columns( m ) == data.n ) ;
+
+ data.nz = boost::numeric::bindings::traits::spmatrix_num_nonzeros( m ) ;
+ detail::indices( typename boost::numeric::bindings::traits::sparse_matrix_traits<M>::ordering_type(), data.irn, data.jcn, m ) ;
+
+ data.nz_loc = boost::numeric::bindings::traits::spmatrix_num_nonzeros( m ) ;
+ detail::indices( typename boost::numeric::bindings::traits::sparse_matrix_traits<M>::ordering_type(), data.irn_loc, data.jcn_loc, m ) ;
+ } // matrix_integer_data()
+
+
+ //
+ // Copy the values pointer to the MUMPS struct
+ //
+ template <typename M>
+ void matrix_value_data( mumps<M>& data, M& m ) {
+ data.a = detail::cast_2_mumps( boost::numeric::bindings::traits::spmatrix_value_storage( m ) ) ;
+ data.a_loc = detail::cast_2_mumps( boost::numeric::bindings::traits::spmatrix_value_storage( m ) ) ;
+ } // matrix_value_data()
+
+
+ //
+ // Copy the right-hand side / solution pointer to the MUMPS struct
+ // in case of a dense undistributed right-hand side and solution.
+ //
+ template <typename M, typename X>
+ void rhs_sol_value_data( mumps<M>& data, X& x ) {
+ data.rhs = detail::cast_2_mumps( boost::numeric::bindings::traits::matrix_storage( x ) ) ;
+ data.nrhs = boost::numeric::bindings::traits::matrix_num_columns( x ) ;
+ data.lrhs = boost::numeric::bindings::traits::leading_dimension( x ) ;
+ } // matrix_rhs_sol_value_data()
+
+
+ //
+ // Call the MUMPS driver for the given MUMPS struct.
+ //
+ template <typename M>
+ int driver( mumps<M>& data ) {
+ assert( data.job>=1 ? data.irn!=0 : true ) ;
+ assert( data.job>=1 ? data.jcn!=0 : true ) ;
+ assert( data.job>=2 ? data.a!=0 : true ) ;
+ assert( data.job>=3 ? data.rhs!=0 : true ) ;
+ detail::mumps_call<typename M::value_type>() ( static_cast<typename mumps<M>::c_struct_type&>( data ) ) ;
+ return data.info[0] ;
+ } // driver()
+
+} } } } // namespace boost::numeric::bindings::mumps
+
+#endif

Modified: sandbox/boost/numeric/bindings/traits/detail/array.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/detail/array.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/detail/array.hpp 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -25,10 +25,11 @@
   template <typename T>
   struct vector_traits<detail::array<T> > {
     typedef T value_type;
+ typedef std::ptrdiff_t size_type;
     typedef T* pointer;
 
     static pointer storage (detail::array<T>& a) { return a.storage(); }
- static int size (detail::array<T>& a) { return a.size(); }
+ static size_type size (detail::array<T>& a) { return a.size(); }
   };
   
 

Modified: sandbox/boost/numeric/bindings/traits/detail/array_impl.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/detail/array_impl.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/detail/array_impl.hpp 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -47,14 +47,15 @@
     template <typename T>
     class array : private noncopyable {
     public:
+ typedef std::ptrdiff_t size_type ;
 
- array (int n) {
+ array (size_type n) {
         stg = new (std::nothrow) T[n];
         sz = (stg != 0) ? n : 0;
       }
       ~array() { delete[] stg; }
 
- int size() const { return sz; }
+ size_type size() const { return sz; }
       bool valid() const { return stg != 0; }
       void resize (int n) {
         delete[] stg;
@@ -69,8 +70,8 @@
       T const& operator[] (int i) const { return stg[i]; }
 
     private:
- int sz;
- T* stg;
+ size_type sz;
+ T* stg;
     };
 
   }}

Modified: sandbox/boost/numeric/bindings/traits/detail/ublas_ordering.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/detail/ublas_ordering.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/detail/ublas_ordering.hpp 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -29,17 +29,17 @@
       typedef boost::numeric::ublas::row_major functor_type;
 
       template <typename M>
- static int leading_dimension( M const& m ) {
+ static typename M::size_type leading_dimension( M const& m ) {
         return m.size2() ;
       }
 
       template <typename M>
- static int stride1( M const& m ) {
+ static typename M::size_type stride1( M const& m ) {
         return m.size2() ;
       }
 
       template <typename M>
- static int stride2( M const& m ) {
+ static typename M::size_type stride2( M const& m ) {
         return 1 ;
       }
     };
@@ -50,17 +50,17 @@
       typedef boost::numeric::ublas::column_major functor_type;
 
       template <typename M>
- static int leading_dimension( M const& m ) {
+ static typename M::size_type leading_dimension( M const& m ) {
         return m.size1() ;
       }
 
       template <typename M>
- static int stride1( M const& m ) {
+ static typename M::size_type stride1( M const& m ) {
         return 1 ;
       }
 
       template <typename M>
- static int stride2( M const& m ) {
+ static typename M::size_type stride2( M const& m ) {
         return m.size1() ;
       }
     };
@@ -72,17 +72,17 @@
     struct ublas_banded_ordering<boost::numeric::ublas::row_major_tag> {
 
       template <typename M>
- static int leading_dimension( M const& m ) {
+ static typename M::size_type leading_dimension( M const& m ) {
         return m.lower() + m.upper() + 1 ;
       }
 
       template <typename M>
- static int stride1( M const& m ) {
+ static typename M::size_type stride1( M const& m ) {
         return 1 ;
       }
 
       template <typename M>
- static int stride2( M const& m ) {
+ static typename M::size_type stride2( M const& m ) {
         return leading_dimension(m)-1 ;
       }
     };
@@ -91,17 +91,17 @@
     struct ublas_banded_ordering<boost::numeric::ublas::column_major_tag> {
 
       template <typename M>
- static int leading_dimension( M const& m ) {
+ static typename M::size_type leading_dimension( M const& m ) {
         return m.size2() ;
       }
 
       template <typename M>
- static int stride1( M const& m ) {
+ static typename M::size_type stride1( M const& m ) {
         return leading_dimension(m) ;
       }
 
       template <typename M>
- static int stride2( M const& m ) {
+ static typename M::size_type stride2( M const& m ) {
         return 1-leading_dimension(m) ;
       }
     };

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 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -55,12 +55,12 @@
     // uplo_type
     // static functions:
     // pointer storage()
- // int size1()
- // int size2()
- // int lower_bandwidth() // only banded matrix types
- // int upper_bandwidth() // only banded matrix types
- // int storage_size() // not all matrix types
- // int leading_dimension() // not all matrix types
+ // std::ptrdiff_t num_rows()
+ // 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
   };
 
   // matrix structure tags:
@@ -96,35 +96,35 @@
   
   template <typename M>
   inline
- int matrix_size1 (M& m) { return matrix_traits<M>::size1 (m); }
-
+ std::ptrdiff_t matrix_num_rows (M& m) { return matrix_traits<M>::num_rows (m); }
+
   template <typename M>
   inline
- int matrix_size2 (M& m) { return matrix_traits<M>::size2 (m); }
+ std::ptrdiff_t matrix_num_columns (M& m) { return matrix_traits<M>::num_columns (m); }
   
   template <typename M>
   inline
- int matrix_storage_size (M& m) { return matrix_traits<M>::storage_size (m); }
+ std::ptrdiff_t matrix_storage_size (M& m) { return matrix_traits<M>::storage_size (m); }
   
   template <typename M>
   inline
- int matrix_stride1 (M& m) { return matrix_traits<M>::stride1 (m); }
+ std::ptrdiff_t matrix_stride1 (M& m) { return matrix_traits<M>::stride1 (m); }
 
   template <typename M>
   inline
- int matrix_stride2 (M& m) { return matrix_traits<M>::stride2 (m); }
+ std::ptrdiff_t matrix_stride2 (M& m) { return matrix_traits<M>::stride2 (m); }
 
   template <typename M>
   inline
- int matrix_upper_bandwidth (M& m) { return matrix_traits<M>::upper_bandwidth (m); }
+ std::ptrdiff_t matrix_upper_bandwidth (M& m) { return matrix_traits<M>::upper_bandwidth (m); }
 
   template <typename M>
   inline
- int matrix_lower_bandwidth (M& m) { return matrix_traits<M>::lower_bandwidth (m); }
+ std::ptrdiff_t matrix_lower_bandwidth (M& m) { return matrix_traits<M>::lower_bandwidth (m); }
   
   template <typename M>
   inline
- int leading_dimension (M& m) {
+ std::ptrdiff_t leading_dimension (M& m) {
     return matrix_traits<M>::leading_dimension (m);
   }
   
@@ -142,6 +142,15 @@
       return detail::matrix_uplo_tag (uplo_t());
   }
   
+ // Retain for older bindings:
+ template <typename M>
+ inline
+ std::ptrdiff_t matrix_size1 (M& m) { return matrix_traits<M>::num_rows (m); }
+
+ template <typename M>
+ inline
+ std::ptrdiff_t matrix_size2 (M& m) { return matrix_traits<M>::num_columns (m); }
+
 }}}}
 
 #else // BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS

Modified: sandbox/boost/numeric/bindings/traits/sparse_traits.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/sparse_traits.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/sparse_traits.hpp 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -59,9 +59,9 @@
     // - coordinate, row major: column indices of nonzeros
     // value_pointer value_storage()
     // - array of nonzeros
- // int size1()
- // int size2()
- // int num_nonzeros()
+ // std::ptrdiff_t num_rows()
+ // std::ptrdiff_t num_columns()
+ // std::ptrdiff_t num_nonzeros()
   };
 
 
@@ -95,20 +95,28 @@
   spmatrix_value_storage (M& m) {
     return sparse_matrix_traits<M>::value_storage (m);
   }
-
+
   template <typename M>
   inline
- int spmatrix_size1 (M& m) { return sparse_matrix_traits<M>::size1 (m); }
+ std::ptrdiff_t spmatrix_num_rows (M& m) { return sparse_matrix_traits<M>::num_rows (m); }
   template <typename M>
   inline
- int spmatrix_size2 (M& m) { return sparse_matrix_traits<M>::size2 (m); }
-
+ std::ptrdiff_t spmatrix_num_columns (M& m) { return sparse_matrix_traits<M>::num_columns (m); }
+
   template <typename M>
   inline
- int spmatrix_num_nonzeros (M& m) {
+ std::ptrdiff_t spmatrix_num_nonzeros (M& m) {
     return sparse_matrix_traits<M>::num_nonzeros (m);
   }
-
+
+ // Retain for older codes
+
+ template <typename M>
+ inline
+ std::ptrdiff_t spmatrix_size1 (M& m) { return sparse_matrix_traits<M>::num_rows (m); }
+ template <typename M>
+ inline
+ std::ptrdiff_t spmatrix_size2 (M& m) { return sparse_matrix_traits<M>::num_columns (m); }
   
 }}}}
 

Modified: sandbox/boost/numeric/bindings/traits/transpose.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/transpose.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/transpose.hpp 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -1,3 +1,11 @@
+//
+// Copyright Kresimir Fresl, Toon Knapen, and Karl Meerbergen 2002, 2003
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
 #ifndef BOOST_BINDINGS_TRANSPOSE_HPP
 #define BOOST_BINDINGS_TRANSPOSE_HPP
 

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 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -65,23 +65,23 @@
       typedef typename detail::generate_const<M,ArrT>::type array_type ;
       return vector_traits<array_type>::storage (m.data());
     }
- static int size1 (matrix_type& m) { return m.size1(); }
- static int size2 (matrix_type& m) { return m.size2(); }
- static int lower_bandwidth (matrix_type& m) { return m.lower() ; }
- static int upper_bandwidth (matrix_type& m) { return m.upper() ; }
- static int storage_size (matrix_type& m) { return size1 (m) * size2 (m); }
- static int leading_dimension (matrix_type& m) {
+ static std::ptrdiff_t size1 (matrix_type& m) { return m.size1(); }
+ static std::ptrdiff_t size2 (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) ;
     }
 
     // stride1 == distance (m (i, j), m (i+1, j))
- static int stride1 (matrix_type& m) {
+ static std::ptrdiff_t stride1 (matrix_type& m) {
       typedef typename identifier_type::orientation_category orientation_category;
       return detail::ublas_banded_ordering<orientation_category>::stride1(m) ;
     }
     // stride2 == distance (m (i, j), m (i, j+1))
- static int stride2 (matrix_type& m) {
+ static std::ptrdiff_t stride2 (matrix_type& m) {
       typedef typename identifier_type::orientation_category orientation_category;
       return detail::ublas_banded_ordering<orientation_category>::stride2(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 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -57,22 +57,22 @@
       typedef typename detail::generate_const<M,A>::type array_type ;
       return vector_traits<array_type>::storage (hm.data());
     }
- static int size1 (matrix_type& hm) { return hm.size1(); }
- static int size2 (matrix_type& hm) { return hm.size2(); }
- static int storage_size (matrix_type& hm) {
- return (size1 (hm) + 1) * size2 (hm) / 2;
+ 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;
     }
   };
 
 
   namespace detail {
      template <typename M>
- int matrix_bandwidth( M const& m, upper_t ) {
+ std::ptrdiff_t matrix_bandwidth( M const& m, upper_t ) {
         return matrix_traits<M const>::upper_bandwidth( m ) ;
      }
 
      template <typename M>
- int matrix_bandwidth( M const& m, lower_t ) {
+ std::ptrdiff_t matrix_bandwidth( M const& m, lower_t ) {
         // When the lower triangular band matrix is stored the
         // upper bandwidth must be zero
         assert( 0 == matrix_traits<M const>::upper_bandwidth( m ) ) ;
@@ -104,19 +104,19 @@
     static pointer storage (matrix_type& hm) {
       return matrix_traits<m_type>::storage (hm.data());
     }
- static int size1 (matrix_type& hm) { return hm.size1(); }
- static int size2 (matrix_type& hm) { return hm.size2(); }
- static int storage_size (matrix_type& hm) {
- return size1 (hm) * size2 (hm);
+ 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 int leading_dimension (matrix_type& hm) {
+ static std::ptrdiff_t leading_dimension (matrix_type& hm) {
       return matrix_traits<m_type>::leading_dimension (hm.data());
     }
     // For banded M
- static int upper_bandwidth(matrix_type& hm) {
+ static std::ptrdiff_t upper_bandwidth(matrix_type& hm) {
        return detail::matrix_bandwidth( hm.data(), uplo_type() );
     }
- static int lower_bandwidth(matrix_type& hm) {
+ static std::ptrdiff_t lower_bandwidth(matrix_type& hm) {
        return detail::matrix_bandwidth( hm.data(), uplo_type() );
     }
   };

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 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -66,10 +66,10 @@
       typedef typename detail::generate_const<M,ArrT>::type array_type ;
       return vector_traits<array_type>::storage (m.data());
     }
- static int size1 (matrix_type& m) { return m.size1(); }
- static int size2 (matrix_type& m) { return m.size2(); }
- static int storage_size (matrix_type& m) { return size1 (m) * size2 (m); }
- static int leading_dimension (matrix_type& m) {
+ 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 size1 (m) * size2 (m); }
+ 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()
       //return functor_t::size_m (m.size1(), m.size2());
@@ -77,12 +77,12 @@
     }
 
     // stride1 == distance (m (i, j), m (i+1, j))
- static int stride1 (matrix_type& m) {
+ static std::ptrdiff_t stride1 (matrix_type& m) {
       //return functor_t::one1 (m.size1(), m.size2());
       return detail::ublas_ordering<orientation_category>::stride1( m ) ;
     }
     // stride2 == distance (m (i, j), m (i, j+1))
- static int stride2 (matrix_type& m) {
+ static std::ptrdiff_t stride2 (matrix_type& m) {
       //return functor_t::one2 (m.size1(), m.size2());
       return detail::ublas_ordering<orientation_category>::stride2( m ) ;
     }
@@ -113,23 +113,23 @@
       return matrix_traits<m_type>::storage (mr.expression());
     }
 
- static int size1 (matrix_type& mr) { return mr.size1(); }
- static int size2 (matrix_type& mr) { return mr.size2(); }
- static int leading_dimension (matrix_type& mr) {
+ static std::ptrdiff_t num_rows (matrix_type& mr) { return mr.size1(); }
+ static std::ptrdiff_t num_columns (matrix_type& mr) { return mr.size2(); }
+ static std::ptrdiff_t leading_dimension (matrix_type& mr) {
       return matrix_traits<m_type>::leading_dimension (mr.expression());
     }
 
- static int stride1 (matrix_type& mr) {
+ static std::ptrdiff_t stride1 (matrix_type& mr) {
       return matrix_traits<m_type>::stride1 (mr.expression());
     }
- static int stride2 (matrix_type& mr) {
+ static std::ptrdiff_t stride2 (matrix_type& mr) {
       return matrix_traits<m_type>::stride2 (mr.expression());
     }
     // Only for banded matrices
- static int upper_bandwidth(matrix_type& mr) {
+ static std::ptrdiff_t upper_bandwidth(matrix_type& mr) {
       return matrix_traits<m_type>::upper_bandwidth(mr.expression());
     }
- static int lower_bandwidth(matrix_type& mr) {
+ static std::ptrdiff_t lower_bandwidth(matrix_type& mr) {
       return matrix_traits<m_type>::lower_bandwidth(mr.expression());
     }
   };
@@ -164,23 +164,23 @@
       return ptr;
     }
 
- static int size1 (matrix_type& mr) { return mr.size1(); }
- static int size2 (matrix_type& mr) { return mr.size2(); }
- static int leading_dimension (matrix_type& mr) {
+ static std::ptrdiff_t num_rows (matrix_type& mr) { return mr.size1(); }
+ static std::ptrdiff_t num_columns (matrix_type& mr) { return mr.size2(); }
+ static std::ptrdiff_t leading_dimension (matrix_type& mr) {
       return matrix_traits<m_type>::leading_dimension (mr.data());
     }
 
- static int stride1 (matrix_type& mr) {
+ static std::ptrdiff_t stride1 (matrix_type& mr) {
       return matrix_traits<m_type>::stride1 (mr.data());
     }
- static int stride2 (matrix_type& mr) {
+ static std::ptrdiff_t stride2 (matrix_type& mr) {
       return matrix_traits<m_type>::stride2 (mr.data());
     }
     // For band matrices only
- static int upper_bandwidth (matrix_type& mr) {
+ static std::ptrdiff_t upper_bandwidth (matrix_type& mr) {
        return matrix_traits<m_type>::upper_bandwidth(mr.data());
     }
- static int lower_bandwidth (matrix_type& mr) {
+ static std::ptrdiff_t lower_bandwidth (matrix_type& mr) {
        return matrix_traits<m_type>::lower_bandwidth(mr.data());
     }
   };
@@ -214,27 +214,27 @@
       return ptr;
     }
 
- static int size1 (matrix_type& ms) { return ms.size1(); }
- static int size2 (matrix_type& ms) { return ms.size2(); }
+ static std::ptrdiff_t num_rows (matrix_type& ms) { return ms.size1(); }
+ static std::ptrdiff_t num_columns (matrix_type& ms) { return ms.size2(); }
 
   private:
- static int ld (int s1, int s2, boost::numeric::ublas::row_major_tag) {
+ static std::ptrdiff_t ld (std::ptrdiff_t s1, std::ptrdiff_t s2, boost::numeric::ublas::row_major_tag) {
       return s1;
     }
- static int ld (int s1, int s2, boost::numeric::ublas::column_major_tag) {
+ static std::ptrdiff_t ld (std::ptrdiff_t s1, std::ptrdiff_t s2, boost::numeric::ublas::column_major_tag) {
       return s2;
     }
   public:
- static int leading_dimension (matrix_type& ms) {
+ static std::ptrdiff_t leading_dimension (matrix_type& ms) {
       typedef typename identifier_type::orientation_category oc_t;
       return ld (ms.stride1(), ms.stride2(), oc_t())
         * matrix_traits<m_type>::leading_dimension (ms.data());
     }
 
- static int stride1 (matrix_type& ms) {
+ static std::ptrdiff_t stride1 (matrix_type& ms) {
       return ms.stride1() * matrix_traits<m_type>::stride1 (ms.data());
     }
- static int stride2 (matrix_type& ms) {
+ static std::ptrdiff_t stride2 (matrix_type& ms) {
       return ms.stride2() * matrix_traits<m_type>::stride2 (ms.data());
     }
 
@@ -267,7 +267,7 @@
       ptr += mr.index() * matrix_traits<m_type>::stride1 (mt);
       return ptr;
     }
- static int stride (vector_type& mr) {
+ static std::ptrdiff_t stride (vector_type& mr) {
       return matrix_traits<m_type>::stride2 (mr.data());
     }
   };
@@ -297,7 +297,7 @@
       ptr += mc.index() * matrix_traits<m_type>::stride2 (mt);
       return ptr;
     }
- static int stride (vector_type& mc) {
+ static std::ptrdiff_t stride (vector_type& mc) {
       return matrix_traits<m_type>::stride1 (mc.data());
     }
   };
@@ -322,15 +322,15 @@
     typedef typename detail::generate_const<Matr,T>::type* pointer;
 
     static pointer storage (matrix_type& m) { return m.data(); }
- static int size1 (matrix_type& m) { return m.size1(); }
- static int size2 (matrix_type& m) { return m.size2(); }
- static int storage_size (matrix_type& m) { return M * N; }
- static int leading_dimension (matrix_type& m) { return N; }
+ 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))
- static int stride1 (matrix_type& m) { return N; }
+ static std::ptrdiff_t stride1 (matrix_type& m) { return N; }
     // stride2 == distance (m (i, j), m (i, j+1))
- static int stride2 (matrix_type& m) { return 1; }
+ static std::ptrdiff_t stride2 (matrix_type& m) { return 1; }
   };
 
 #endif // BOOST_NUMERIC_BINDINGS_FORTRAN

Modified: sandbox/boost/numeric/bindings/traits/ublas_sparse.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/ublas_sparse.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/ublas_sparse.hpp 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -77,9 +77,9 @@
       return vector_traits<val_array_t>::storage (cm.value_data());
     }
 
- static int size1 (matrix_type& cm) { return cm.size1(); }
- static int size2 (matrix_type& cm) { return cm.size2(); }
- static int num_nonzeros (matrix_type& cm) {
+ static std::ptrdiff_t size1 (matrix_type& cm) { return cm.size1(); }
+ static std::ptrdiff_t size2 (matrix_type& cm) { return cm.size2(); }
+ static std::ptrdiff_t num_nonzeros (matrix_type& cm) {
       return cm.nnz();
       // Joerg, this isn't very intuitive :o(
       // return cm.non_zeros();

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 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -57,10 +57,10 @@
       typedef typename detail::generate_const<M,A>::type array_type ;
       return vector_traits<array_type>::storage (sm.data());
     }
- static int size1 (matrix_type& sm) { return sm.size1(); }
- static int size2 (matrix_type& sm) { return sm.size2(); }
- static int storage_size (matrix_type& sm) {
- return (size1 (sm) + 1) * size2 (sm) / 2;
+ 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;
     }
   };
 
@@ -89,12 +89,12 @@
     static pointer storage (matrix_type& sm) {
       return matrix_traits<m_type>::storage (sm.data());
     }
- static int size1 (matrix_type& sm) { return sm.size1(); }
- static int size2 (matrix_type& sm) { return sm.size2(); }
- static int storage_size (matrix_type& sm) {
- return size1 (sm) * size2 (sm);
+ 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 int leading_dimension (matrix_type& 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_vector.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/ublas_vector.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/ublas_vector.hpp 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -65,7 +65,7 @@
     static pointer storage (vector_type& v) {
       return vector_traits<vct_t>::storage (v.expression());
     }
- static int stride (vector_type& v) {
+ static std::ptrdiff_t stride (vector_type& v) {
       return vector_traits<vct_t>::stride (v.expression());
     }
   };
@@ -93,7 +93,7 @@
       ptr += vr.start() * vector_traits<v_type>::stride (vr.data());
       return ptr;
     }
- static int stride (vector_type& vr) {
+ static std::ptrdiff_t stride (vector_type& vr) {
       return vector_traits<v_type>::stride (vr.data());
     }
   };
@@ -122,7 +122,7 @@
       ptr += vs.start() * vector_traits<v_type>::stride (vs.data());
       return ptr;
     }
- static int stride (vector_type& vs) {
+ static std::ptrdiff_t stride (vector_type& vs) {
       return vs.stride() * vector_traits<v_type>::stride (vs.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 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -56,10 +56,10 @@
       typedef typename detail::generate_const<V,ArrT>::type array_type;
       return vector_traits<array_type>::storage (v.data());
     }
- static int size1 (matrix_type& v) { return v.size(); }
- static int size2 (matrix_type&) { return 1; }
- static int storage_size (matrix_type& v) { return v.size(); }
- static int leading_dimension (matrix_type& v) { return v.size(); }
+ static std::ptrdiff_t size1 (matrix_type& v) { return v.size(); }
+ static std::ptrdiff_t size2 (matrix_type&) { return 1; }
+ static std::ptrdiff_t storage_size (matrix_type& v) { return v.size(); }
+ static std::ptrdiff_t leading_dimension (matrix_type& v) { return v.size(); }
   };
 
 
@@ -86,10 +86,10 @@
     static pointer storage (matrix_type& v) {
       return vector_traits<V>::storage (v);
     }
- static int size1 (matrix_type& v) { return v.size(); }
- static int size2 (matrix_type&) { return 1; }
- static int storage_size (matrix_type& v) { return v.size(); }
- static int leading_dimension (matrix_type& v) { return v.size(); }
+ static std::ptrdiff_t size1 (matrix_type& v) { return v.size(); }
+ static std::ptrdiff_t size2 (matrix_type&) { return 1; }
+ static std::ptrdiff_t storage_size (matrix_type& v) { return v.size(); }
+ static std::ptrdiff_t leading_dimension (matrix_type& v) { return v.size(); }
   };
 
 
@@ -116,10 +116,10 @@
     typedef typename detail::generate_const<V,T>::type* pointer;
 
     static pointer storage (matrix_type& v) { return v.data(); }
- static int size1 (matrix_type&) { return 1; }
- static int size2 (matrix_type& v) { return v.size(); }
- static int storage_size (matrix_type&) { return N; }
- static int leading_dimension (matrix_type&) { return N; }
+ static std::ptrdiff_t size1 (matrix_type&) { return 1; }
+ static std::ptrdiff_t size2 (matrix_type& v) { return v.size(); }
+ static std::ptrdiff_t storage_size (matrix_type&) { return N; }
+ static std::ptrdiff_t leading_dimension (matrix_type&) { return N; }
   };
 
 #endif // BOOST_NUMERIC_BINDINGS_FORTRAN

Modified: sandbox/boost/numeric/bindings/traits/vector_traits.hpp
==============================================================================
--- sandbox/boost/numeric/bindings/traits/vector_traits.hpp (original)
+++ sandbox/boost/numeric/bindings/traits/vector_traits.hpp 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -37,8 +37,8 @@
     typedef typename detail::generate_const<V,value_type>::type* pointer; // if V is const, pointer will be a const value_type*
 
     static pointer storage (V& v) { return &v[0]; }
- static int size (V& v) { return static_cast<int>(v.size()); }
- static int stride (V&) { return 1; }
+ static std::ptrdiff_t size (V& v) { return static_cast<std::ptrdiff_t>(v.size()); }
+ static std::ptrdiff_t stride (V&) { return 1; }
   };
 
   // vector_detail_traits is used to implement specializations of vector_traits.
@@ -73,13 +73,13 @@
 
   template <typename V>
   inline
- int vector_size (V& v) {
+ std::ptrdiff_t vector_size (V& v) {
     return vector_traits<V>::size (v);
   }
 
   template <typename V>
   inline
- int vector_stride (V& v) {
+ std::ptrdiff_t vector_stride (V& v) {
     return vector_traits<V>::stride (v);
   }
 

Modified: sandbox/libs/numeric/bindings/lapack/test/utils.h
==============================================================================
--- sandbox/libs/numeric/bindings/lapack/test/utils.h (original)
+++ sandbox/libs/numeric/bindings/lapack/test/utils.h 2008-09-01 10:34:26 EDT (Mon, 01 Sep 2008)
@@ -138,9 +138,9 @@
 template <typename F, typename M>
 void init_m (M& m, F f = F()) {
   size_t sz1
- = boost::numeric::bindings::traits::matrix_traits<M>::size1 (m);
+ = boost::numeric::bindings::traits::matrix_traits<M>::num_rows (m);
   size_t sz2
- = boost::numeric::bindings::traits::matrix_traits<M>::size2 (m);
+ = boost::numeric::bindings::traits::matrix_traits<M>::num_columns (m);
   for (std::size_t i = 0; i < sz1; ++i)
     for (std::size_t j = 0; j < sz2; ++j)
       elem_m (m, i, j) = f (i, j);
@@ -149,7 +149,7 @@
 template <typename M>
 void init_symm (M& m, char uplo = 'f') {
   size_t n
- = boost::numeric::bindings::traits::matrix_traits<M>::size1 (m);
+ = boost::numeric::bindings::traits::matrix_traits<M>::num_rows (m);
   for (size_t i = 0; i < n; ++i) {
     elem_m (m, i, i) = n;
     for (size_t j = i + 1; j < n; ++j) {
@@ -169,9 +169,9 @@
   if (ch)
     std::cout << ch << ":\n";
   size_t sz1
- = boost::numeric::bindings::traits::matrix_traits<M const>::size1 (m);
+ = boost::numeric::bindings::traits::matrix_traits<M const>::num_rows (m);
   size_t sz2
- = boost::numeric::bindings::traits::matrix_traits<M const>::size2 (m);
+ = boost::numeric::bindings::traits::matrix_traits<M const>::num_columns (m);
   for (std::size_t i = 0 ; i < sz1 ; ++i) {
     for (std::size_t j = 0 ; j < sz2 ; ++j)
       std::cout << elem_m (m, i, j) << " ";


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