Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65144 - in sandbox/numeric_bindings: boost/numeric/bindings/lapack/computational libs/numeric/bindings/tools libs/numeric/bindings/tools/templates/computational
From: rutger_at_[hidden]
Date: 2010-08-31 02:54:07


Author: rutger
Date: 2010-08-31 02:53:59 EDT (Tue, 31 Aug 2010)
New Revision: 65144
URL: http://svn.boost.org/trac/boost/changeset/65144

Log:
applied fixes for tgsen in the templates. Do not convert fortran_int_t to the integer type in the workspace query functions if they are passed by reference.

Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgsen.hpp | 24 ++++++++++++++++--------
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trsen.hpp | 2 +-
   sandbox/numeric_bindings/libs/numeric/bindings/tools/netlib.py | 9 +++++++--
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgsen.hpp | 16 ++++++++++++----
   4 files changed, 36 insertions(+), 15 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgsen.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgsen.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgsen.hpp 2010-08-31 02:53:59 EDT (Tue, 31 Aug 2010)
@@ -313,11 +313,13 @@
     // workspace-array work.
     //
     static std::ptrdiff_t min_size_work( const std::ptrdiff_t ijob,
- const std::ptrdiff_t n, std::ptrdiff_t& m ) {
+ const std::ptrdiff_t n, fortran_int_t& m ) {
         if ( ijob == 1 || ijob == 2 || ijob == 4 )
             return std::max< std::ptrdiff_t >(4*n+16, 2*m*(n-m));
- else // if ( ijob == 3 || ijob == 5 )
+ else if ( ijob == 3 || ijob == 5 )
             return std::max< std::ptrdiff_t >(4*n+16, 4*m*(n-m));
+ else // ijob == 0
+ return std::max< std::ptrdiff_t >(1, 4*n+16);
     }
 
     //
@@ -325,11 +327,13 @@
     // workspace-array iwork.
     //
     static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t ijob,
- const std::ptrdiff_t n, std::ptrdiff_t& m ) {
+ const std::ptrdiff_t n, fortran_int_t& m ) {
         if ( ijob == 1 || ijob == 2 || ijob == 4 )
             return std::max< std::ptrdiff_t >(1, n+6);
- else // if ( ijob == 3 || ijob == 5 )
+ else if ( ijob == 3 || ijob == 5 )
             return std::max< std::ptrdiff_t >(2*m*(n-m), n+6);
+ else // ijob == 0
+ return 1;
     }
 };
 
@@ -488,11 +492,13 @@
     // workspace-array work.
     //
     static std::ptrdiff_t min_size_work( const std::ptrdiff_t ijob,
- const std::ptrdiff_t n, std::ptrdiff_t& m ) {
+ const std::ptrdiff_t n, fortran_int_t& m ) {
         if ( ijob == 1 || ijob == 2 || ijob == 4 )
             return std::max< std::ptrdiff_t >(1, 2*m*(n-m));
- else // if ( ijob == 3 || ijob == 5 )
+ else if ( ijob == 3 || ijob == 5 )
             return std::max< std::ptrdiff_t >(1, 4*m*(n-m));
+ else // ijob == 0
+ return 1;
     }
 
     //
@@ -500,11 +506,13 @@
     // workspace-array iwork.
     //
     static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t ijob,
- const std::ptrdiff_t n, std::ptrdiff_t& m ) {
+ const std::ptrdiff_t n, fortran_int_t& m ) {
         if ( ijob == 1 || ijob == 2 || ijob == 4 )
             return std::max< std::ptrdiff_t >(1, n+2);
- else // if ( ijob == 3 || ijob == 5 )
+ else if ( ijob == 3 || ijob == 5 )
             return std::max< std::ptrdiff_t >(2*m*(n-m), n+2);
+ else // ijob == 0
+ return 1;
     }
 };
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trsen.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trsen.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trsen.hpp 2010-08-31 02:53:59 EDT (Tue, 31 Aug 2010)
@@ -189,7 +189,7 @@
     // workspace-array work.
     //
     static std::ptrdiff_t min_size_work( const char job, const std::ptrdiff_t n,
- std::ptrdiff_t& m ) {
+ fortran_int_t& m ) {
         if ( job == 'N' )
             return 1;
         else if ( job == 'E' )

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-08-31 02:53:59 EDT (Tue, 31 Aug 2010)
@@ -619,8 +619,13 @@
     type_result = []
     for arg in properties[ 'assert_size_args' ]:
       if arg_map.has_key( arg ):
- cpp_type_code = level0_type( arg, arg_map[ arg ] ).replace( library_integer_type,
- "$INTEGER_TYPE" )
+ #
+ # replace the library integer type, unless it's a reference to a
+ # library int type. Can only replaced if we're dealing with by-value.
+ #
+ cpp_type_code = level0_type( arg, arg_map[ arg ] )
+ if '&' not in cpp_type_code:
+ cpp_type_code = cpp_type_code.replace( library_integer_type, "$INTEGER_TYPE" )
         #cpp_type_code = cpp_type( arg, arg_map[ arg ] ).replace( library_integer_type,
             #"$INTEGER_TYPE" )
         code_result += [ cpp_type_code ]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgsen.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgsen.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgsen.hpp 2010-08-31 02:53:59 EDT (Tue, 31 Aug 2010)
@@ -5,23 +5,31 @@
 $TEMPLATE[tgsen.real.min_size_work]
 if ( ijob == 1 || ijob == 2 || ijob == 4 )
     return std::max< $INTEGER_TYPE >(4*n+16, 2*m*(n-m));
-else // if ( ijob == 3 || ijob == 5 )
+else if ( ijob == 3 || ijob == 5 )
     return std::max< $INTEGER_TYPE >(4*n+16, 4*m*(n-m));
+else // ijob == 0
+ return std::max< std::ptrdiff_t >(1, 4*n+16);
 $TEMPLATE[tgsen.complex.min_size_work]
 if ( ijob == 1 || ijob == 2 || ijob == 4 )
     return std::max< $INTEGER_TYPE >(1, 2*m*(n-m));
-else // if ( ijob == 3 || ijob == 5 )
+else if ( ijob == 3 || ijob == 5 )
     return std::max< $INTEGER_TYPE >(1, 4*m*(n-m));
+else // ijob == 0
+ return 1;
 $TEMPLATE[tgsen.all.min_size_iwork.args]
 IJOB,N,M
 $TEMPLATE[tgsen.real.min_size_iwork]
 if ( ijob == 1 || ijob == 2 || ijob == 4 )
     return std::max< $INTEGER_TYPE >(1, n+6);
-else // if ( ijob == 3 || ijob == 5 )
+else if ( ijob == 3 || ijob == 5 )
     return std::max< $INTEGER_TYPE >(2*m*(n-m), n+6);
+else // ijob == 0
+ return 1;
 $TEMPLATE[tgsen.complex.min_size_iwork]
 if ( ijob == 1 || ijob == 2 || ijob == 4 )
     return std::max< $INTEGER_TYPE >(1, n+2);
-else // if ( ijob == 3 || ijob == 5 )
+else if ( ijob == 3 || ijob == 5 )
     return std::max< $INTEGER_TYPE >(2*m*(n-m), n+2);
+else // ijob == 0
+ return 1;
 $TEMPLATE[end]


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