Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63402 - in sandbox/numeric_bindings: boost/numeric/bindings/lapack/computational boost/numeric/bindings/lapack/driver libs/numeric/bindings/lapack/test libs/numeric/bindings/tools libs/numeric/bindings/tools/templates/computational libs/numeric/bindings/tools/templates/driver
From: thomas.klimpel_at_[hidden]
Date: 2010-06-27 19:25:03


Author: klimpel
Date: 2010-06-27 19:25:01 EDT (Sun, 27 Jun 2010)
New Revision: 63402
URL: http://svn.boost.org/trac/boost/changeset/63402

Log:
Now gbsv, gbsvx, gbtrf and gbtrs are at least no longer worse than in bindings-v1. Whether they are good now is a totally different question.
Added:
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/gbtrf.hpp (contents, props changed)
Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/gbtrf.hpp | 8 ++++--
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/gbtrs.hpp | 6 +++-
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/gbsv.hpp | 12 +++++----
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/gbsvx.hpp | 48 +++++++++++++++++++++------------------
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/ggglm.hpp | 8 +++---
   sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_gbsv.cpp | 7 +----
   sandbox/numeric_bindings/libs/numeric/bindings/tools/bindings.py | 2
   sandbox/numeric_bindings/libs/numeric/bindings/tools/netlib.py | 11 +++++++++
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/gbtrs.hpp | 2 +
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/driver/gbsv.hpp | 2 +
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/driver/gbsvx.hpp | 2 +
   11 files changed, 66 insertions(+), 42 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/gbtrf.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/gbtrf.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/gbtrf.hpp 2010-06-27 19:25:01 EDT (Sun, 27 Jun 2010)
@@ -122,7 +122,8 @@
         BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAB >::value) );
         BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIPIV >::value) );
         BOOST_ASSERT( bindings::bandwidth_lower(ab) >= 0 );
- BOOST_ASSERT( bindings::bandwidth_upper(ab) >= 0 );
+ BOOST_ASSERT( bindings::bandwidth_upper(ab)-
+ bindings::bandwidth_lower(ab) >= 0 );
         BOOST_ASSERT( bindings::size(ipiv) >= std::min<
                 std::ptrdiff_t >(bindings::size_row(ab),
                 bindings::size_column(ab)) );
@@ -133,8 +134,9 @@
         BOOST_ASSERT( bindings::stride_major(ab) >= 2 );
         return detail::gbtrf( bindings::size_row(ab),
                 bindings::size_column(ab), bindings::bandwidth_lower(ab),
- bindings::bandwidth_upper(ab), bindings::begin_value(ab),
- bindings::stride_major(ab), bindings::begin_value(ipiv) );
+ bindings::bandwidth_upper(ab)-bindings::bandwidth_lower(ab),
+ bindings::begin_value(ab), bindings::stride_major(ab),
+ bindings::begin_value(ipiv) );
     }
 
 };

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/gbtrs.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/gbtrs.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/gbtrs.hpp 2010-06-27 19:25:01 EDT (Sun, 27 Jun 2010)
@@ -140,7 +140,8 @@
                 MatrixB >::type >::type >::value) );
         BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixB >::value) );
         BOOST_ASSERT( bindings::bandwidth_lower_op(ab, trans()) >= 0 );
- BOOST_ASSERT( bindings::bandwidth_upper_op(ab, trans()) >= 0 );
+ BOOST_ASSERT( bindings::bandwidth_upper_op(ab, trans())-
+ bindings::bandwidth_lower_op(ab, trans()) >= 0 );
         BOOST_ASSERT( bindings::size(ipiv) >= bindings::size_column_op(ab,
                 trans()) );
         BOOST_ASSERT( bindings::size_column(b) >= 0 );
@@ -154,7 +155,8 @@
                 bindings::size_column_op(ab, trans())) );
         return detail::gbtrs( trans(), bindings::size_column_op(ab, trans()),
                 bindings::bandwidth_lower_op(ab, trans()),
- bindings::bandwidth_upper_op(ab, trans()),
+ bindings::bandwidth_upper_op(ab, trans())-
+ bindings::bandwidth_lower_op(ab, trans()),
                 bindings::size_column(b), bindings::begin_value(ab),
                 bindings::stride_major(ab), bindings::begin_value(ipiv),
                 bindings::begin_value(b), bindings::stride_major(b) );

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/gbsv.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/gbsv.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/gbsv.hpp 2010-06-27 19:25:01 EDT (Sun, 27 Jun 2010)
@@ -132,7 +132,8 @@
         BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIPIV >::value) );
         BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixB >::value) );
         BOOST_ASSERT( bindings::bandwidth_lower(ab) >= 0 );
- BOOST_ASSERT( bindings::bandwidth_upper(ab) >= 0 );
+ BOOST_ASSERT( bindings::bandwidth_upper(ab)-
+ bindings::bandwidth_lower(ab) >= 0 );
         BOOST_ASSERT( bindings::size(ipiv) >= bindings::size_column(ab) );
         BOOST_ASSERT( bindings::size_column(ab) >= 0 );
         BOOST_ASSERT( bindings::size_column(b) >= 0 );
@@ -144,10 +145,11 @@
         BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
                 bindings::size_column(ab)) );
         return detail::gbsv( bindings::size_column(ab),
- bindings::bandwidth_lower(ab), bindings::bandwidth_upper(ab),
- bindings::size_column(b), bindings::begin_value(ab),
- bindings::stride_major(ab), bindings::begin_value(ipiv),
- bindings::begin_value(b), bindings::stride_major(b) );
+ bindings::bandwidth_lower(ab), bindings::bandwidth_upper(ab)-
+ bindings::bandwidth_lower(ab), bindings::size_column(b),
+ bindings::begin_value(ab), bindings::stride_major(ab),
+ bindings::begin_value(ipiv), bindings::begin_value(b),
+ bindings::stride_major(b) );
     }
 
 };

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/gbsvx.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/gbsvx.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/gbsvx.hpp 2010-06-27 19:25:01 EDT (Sun, 27 Jun 2010)
@@ -207,7 +207,8 @@
         BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorFERR >::value) );
         BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorBERR >::value) );
         BOOST_ASSERT( bindings::bandwidth_lower(ab) >= 0 );
- BOOST_ASSERT( bindings::bandwidth_upper(ab) >= 0 );
+ BOOST_ASSERT( bindings::bandwidth_upper(ab)-
+ bindings::bandwidth_lower(ab) >= 0 );
         BOOST_ASSERT( bindings::size(berr) >= bindings::size_column(b) );
         BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
                 min_size_iwork( bindings::size_column(ab) ));
@@ -224,8 +225,8 @@
         BOOST_ASSERT( bindings::size_minor(x) == 1 ||
                 bindings::stride_minor(x) == 1 );
         BOOST_ASSERT( bindings::stride_major(ab) >=
- bindings::bandwidth_lower(ab)+bindings::bandwidth_upper(ab)+
- 1 );
+ bindings::bandwidth_lower(ab)+bindings::bandwidth_upper(ab)-
+ bindings::bandwidth_lower(ab)+1 );
         BOOST_ASSERT( bindings::stride_major(afb) >= 2 );
         BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
                 bindings::size_column(ab)) );
@@ -235,14 +236,15 @@
                 equed == 'B' );
         BOOST_ASSERT( fact == 'F' || fact == 'N' || fact == 'E' );
         return detail::gbsvx( fact, trans(), bindings::size_column(ab),
- bindings::bandwidth_lower(ab), bindings::bandwidth_upper(ab),
- bindings::size_column(b), bindings::begin_value(ab),
- bindings::stride_major(ab), bindings::begin_value(afb),
- bindings::stride_major(afb), bindings::begin_value(ipiv),
- equed, bindings::begin_value(r), bindings::begin_value(c),
- bindings::begin_value(b), bindings::stride_major(b),
- bindings::begin_value(x), bindings::stride_major(x), rcond,
- bindings::begin_value(ferr), bindings::begin_value(berr),
+ bindings::bandwidth_lower(ab), bindings::bandwidth_upper(ab)-
+ bindings::bandwidth_lower(ab), bindings::size_column(b),
+ bindings::begin_value(ab), bindings::stride_major(ab),
+ bindings::begin_value(afb), bindings::stride_major(afb),
+ bindings::begin_value(ipiv), equed, bindings::begin_value(r),
+ bindings::begin_value(c), bindings::begin_value(b),
+ bindings::stride_major(b), bindings::begin_value(x),
+ bindings::stride_major(x), rcond, bindings::begin_value(ferr),
+ bindings::begin_value(berr),
                 bindings::begin_value(work.select(real_type())),
                 bindings::begin_value(work.select(fortran_int_t())) );
     }
@@ -368,7 +370,8 @@
         BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorFERR >::value) );
         BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorBERR >::value) );
         BOOST_ASSERT( bindings::bandwidth_lower(ab) >= 0 );
- BOOST_ASSERT( bindings::bandwidth_upper(ab) >= 0 );
+ BOOST_ASSERT( bindings::bandwidth_upper(ab)-
+ bindings::bandwidth_lower(ab) >= 0 );
         BOOST_ASSERT( bindings::size(berr) >= bindings::size_column(b) );
         BOOST_ASSERT( bindings::size(work.select(real_type())) >=
                 min_size_rwork( bindings::size_column(ab) ));
@@ -385,8 +388,8 @@
         BOOST_ASSERT( bindings::size_minor(x) == 1 ||
                 bindings::stride_minor(x) == 1 );
         BOOST_ASSERT( bindings::stride_major(ab) >=
- bindings::bandwidth_lower(ab)+bindings::bandwidth_upper(ab)+
- 1 );
+ bindings::bandwidth_lower(ab)+bindings::bandwidth_upper(ab)-
+ bindings::bandwidth_lower(ab)+1 );
         BOOST_ASSERT( bindings::stride_major(afb) >= 2 );
         BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
                 bindings::size_column(ab)) );
@@ -396,14 +399,15 @@
                 equed == 'B' );
         BOOST_ASSERT( fact == 'F' || fact == 'N' || fact == 'E' );
         return detail::gbsvx( fact, trans(), bindings::size_column(ab),
- bindings::bandwidth_lower(ab), bindings::bandwidth_upper(ab),
- bindings::size_column(b), bindings::begin_value(ab),
- bindings::stride_major(ab), bindings::begin_value(afb),
- bindings::stride_major(afb), bindings::begin_value(ipiv),
- equed, bindings::begin_value(r), bindings::begin_value(c),
- bindings::begin_value(b), bindings::stride_major(b),
- bindings::begin_value(x), bindings::stride_major(x), rcond,
- bindings::begin_value(ferr), bindings::begin_value(berr),
+ bindings::bandwidth_lower(ab), bindings::bandwidth_upper(ab)-
+ bindings::bandwidth_lower(ab), bindings::size_column(b),
+ bindings::begin_value(ab), bindings::stride_major(ab),
+ bindings::begin_value(afb), bindings::stride_major(afb),
+ bindings::begin_value(ipiv), equed, bindings::begin_value(r),
+ bindings::begin_value(c), bindings::begin_value(b),
+ bindings::stride_major(b), bindings::begin_value(x),
+ bindings::stride_major(x), rcond, bindings::begin_value(ferr),
+ bindings::begin_value(berr),
                 bindings::begin_value(work.select(value_type())),
                 bindings::begin_value(work.select(real_type())) );
     }

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/ggglm.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/ggglm.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/ggglm.hpp 2010-06-27 19:25:01 EDT (Sun, 27 Jun 2010)
@@ -170,8 +170,8 @@
                 bindings::size_row(a), bindings::size_column(b) ));
         BOOST_ASSERT( bindings::size(x) >= bindings::size_column(a) );
         BOOST_ASSERT( bindings::size(y) >= bindings::size_column(b) );
- BOOST_ASSERT( bindings::size_column(b) >=
- bindings::size_row(a)-bindings::size_column(a) );
+ BOOST_ASSERT( bindings::size_column(b) >= bindings::size_row(a)-
+ bindings::size_column(a) );
         BOOST_ASSERT( bindings::size_minor(a) == 1 ||
                 bindings::stride_minor(a) == 1 );
         BOOST_ASSERT( bindings::size_minor(b) == 1 ||
@@ -290,8 +290,8 @@
                 bindings::size_row(a), bindings::size_column(b) ));
         BOOST_ASSERT( bindings::size(x) >= bindings::size_column(a) );
         BOOST_ASSERT( bindings::size(y) >= bindings::size_column(b) );
- BOOST_ASSERT( bindings::size_column(b) >=
- bindings::size_row(a)-bindings::size_column(a) );
+ BOOST_ASSERT( bindings::size_column(b) >= bindings::size_row(a)-
+ bindings::size_column(a) );
         BOOST_ASSERT( bindings::size_minor(a) == 1 ||
                 bindings::stride_minor(a) == 1 );
         BOOST_ASSERT( bindings::size_minor(b) == 1 ||

Modified: sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_gbsv.cpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_gbsv.cpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_gbsv.cpp 2010-06-27 19:25:01 EDT (Sun, 27 Jun 2010)
@@ -12,9 +12,6 @@
 namespace lapack = boost::numeric::bindings::lapack;
 namespace bindings = boost::numeric::bindings;
 
-static const char NORMAL = 'N';
-static const char TRANSPOSE = 'T';
-
 // solves the equation Ax = B, and puts the solution in B
 // A is mutated by this routine
 template <typename MatrA, typename MatrB>
@@ -25,7 +22,7 @@
   integer_t const kl = bindings::bandwidth_lower (a);
   integer_t const ku = bindings::bandwidth_upper (a) - kl;
   std::vector<integer_t> piv(a.size1());
- int ret = lapack::gbtrf(bindings::size_row(a), bindings::size_column(a), kl, ku, a, piv);
+ int ret = lapack::gbtrf(/*kl, ku, */a, piv);
   if (ret < 0) {
     //CStdString err;
     //err.Format("banded::Solve: argument %d in DGBTRF had an illegal value", -ret);
@@ -39,7 +36,7 @@
     throw std::runtime_error("banded::Solve: the (%d,%d) diagonal element is 0 after DGBTRF");
   }
 
- ret = lapack::gbtrs(NORMAL, bindings::size_row(a), kl, ku, a, piv, b);
+ ret = lapack::gbtrs(/*kl, ku, */a, piv, b);
   if (ret < 0) {
     //CStdString err;
     //err.Format("banded::Solve: argument %d in DGBTRS had an illegal value", -ret);

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/bindings.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/bindings.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/bindings.py 2010-06-27 19:25:01 EDT (Sun, 27 Jun 2010)
@@ -57,7 +57,7 @@
 def proper_indent( input_string ):
   max_chars = 80
   all_results = []
- find_delim = re.compile( "([\,\+/]|\|\||>=|< |std::log\(|work\()[ ]*" )
+ find_delim = re.compile( "([\,\+\-/]|\|\||>=|< |std::log\(|work\()[ ]*" )
   for input_line in input_string.splitlines():
     result = ''
     # extra indentation size is 8

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/netlib.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/netlib.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/netlib.py 2010-06-27 19:25:01 EDT (Sun, 27 Jun 2010)
@@ -217,6 +217,17 @@
         result = "$NAMESPACEbandwidth_upper_op(" + properties[ 'trait_of' ][ 0 ].lower() + \
             ", " + arg_map[ properties[ 'trait_of' ][ 0 ] ][ 'ref_trans' ].lower() + "())"
 
+ if properties[ 'trait_type' ] == 'num_super_sub':
+ if 'ref_trans' not in arg_map[ properties[ 'trait_of' ][ 0 ] ]:
+ result = "$NAMESPACEbandwidth_upper(" + properties[ 'trait_of' ][ 0 ].lower() + \
+ ")-$NAMESPACEbandwidth_lower(" + properties[ 'trait_of' ][ 0 ].lower() + \
+ ")"
+ else:
+ result = "$NAMESPACEbandwidth_upper_op(" + properties[ 'trait_of' ][ 0 ].lower() + \
+ ", " + arg_map[ properties[ 'trait_of' ][ 0 ] ][ 'ref_trans' ].lower() + \
+ "())-$NAMESPACEbandwidth_lower_op(" + properties[ 'trait_of' ][ 0 ].lower() + \
+ ", " + arg_map[ properties[ 'trait_of' ][ 0 ] ][ 'ref_trans' ].lower() + "())"
+
     if properties[ 'trait_type' ] == 'num_super_uplo' or \
        properties[ 'trait_type' ] == 'num_sub_uplo':
         result = "$NAMESPACEbandwidth(" + properties[ 'trait_of' ][ 0 ].lower() + \

Added: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/gbtrf.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/gbtrf.hpp 2010-06-27 19:25:01 EDT (Sun, 27 Jun 2010)
@@ -0,0 +1,3 @@
+$TEMPLATE[gbtrf.all.KU.trait]
+num_super_sub,AB
+$TEMPLATE[end]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/gbtrs.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/gbtrs.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/gbtrs.hpp 2010-06-27 19:25:01 EDT (Sun, 27 Jun 2010)
@@ -1,3 +1,5 @@
 $TEMPLATE[gbtrs.all.TRANS.trait_of]
 AB
+$TEMPLATE[gbtrs.all.KU.trait]
+num_super_sub,AB
 $TEMPLATE[end]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/driver/gbsv.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/driver/gbsv.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/driver/gbsv.hpp 2010-06-27 19:25:01 EDT (Sun, 27 Jun 2010)
@@ -1,5 +1,7 @@
 $TEMPLATE[gbsv.all.N.trait_of]
 AB
+$TEMPLATE[gbsv.all.KU.trait]
+num_super_sub,AB
 $TEMPLATE[gbsv.all.include_templates]
 lapack_solve_pivot1
 $TEMPLATE[end]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/driver/gbsvx.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/driver/gbsvx.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/driver/gbsvx.hpp 2010-06-27 19:25:01 EDT (Sun, 27 Jun 2010)
@@ -1,3 +1,5 @@
+$TEMPLATE[gbsvx.all.KU.trait]
+num_super_sub,AB
 $TEMPLATE[gbsvx.real.min_size_iwork.args]
 N
 $TEMPLATE[gbsvx.real.min_size_iwork]


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