Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59073 - sandbox/numeric_bindings/libs/numeric/bindings/tools
From: rutger_at_[hidden]
Date: 2010-01-16 10:33:41


Author: rutger
Date: 2010-01-16 10:33:40 EST (Sat, 16 Jan 2010)
New Revision: 59073
URL: http://svn.boost.org/trac/boost/changeset/59073

Log:
order of typedefs improved in both generators (uplo follows trans follows order)

Text files modified:
   sandbox/numeric_bindings/libs/numeric/bindings/tools/blas_generator.py | 14 ++++++++++----
   sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py | 11 +++++++++--
   sandbox/numeric_bindings/libs/numeric/bindings/tools/netlib.py | 6 +++++-
   3 files changed, 24 insertions(+), 7 deletions(-)

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/blas_generator.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/blas_generator.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/blas_generator.py 2010-01-16 10:33:40 EST (Sat, 16 Jan 2010)
@@ -253,7 +253,7 @@
       # Add an include in case of the uplo or diag options
       #
       if 'UPLO' in info_map[ subroutine ][ 'arguments' ]:
- includes += [ '#include <boost/numeric/bindings/data_side.hpp>' ]
+ includes += [ '#include <boost/numeric/bindings/uplo_tag.hpp>' ]
       if 'DIAG' in info_map[ subroutine ][ 'arguments' ]:
         includes += [ '#include <boost/numeric/bindings/diag_tag.hpp>' ]
 
@@ -301,7 +301,14 @@
         if info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'level_1_assert' ] != []:
           level1_assert_list += info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'level_1_assert' ]
         if info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'typedef' ] != None:
- typedef_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'typedef' ] ]
+ # make sure trans tags always preceed other tags, as they may be dependant
+ if 'TRANS' in arg:
+ at_i = 0
+ if len(typedef_list)>0 and '_order<' in typedef_list[0]:
+ at_i = 1
+ typedef_list.insert( at_i, info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'typedef' ] )
+ else:
+ typedef_list.append( info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'typedef' ] )
         if info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'level_2' ] != None:
           level2_arg_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'level_2' ] ]
         if 'banded' in info_map[ subroutine ][ 'argument_map' ][ arg ]:
@@ -482,8 +489,7 @@
 
 # Unable to find zdrot in cblas.h and cublas.h
 # Unable to find crotg, csrot, in cblas.h
-#skip_blas_files = []
-skip_blas_files = [ 'crotg.f', 'zrotg.f' ]
+skip_blas_files = []
 
 templates = {}
 templates[ 'PARSERMODE' ] = 'BLAS'

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py 2010-01-16 10:33:40 EST (Sat, 16 Jan 2010)
@@ -236,7 +236,7 @@
       # Add an include in case of the uplo or diag options
       #
       if 'UPLO' in info_map[ subroutine ][ 'arguments' ]:
- includes += [ '#include <boost/numeric/bindings/data_side.hpp>' ]
+ includes += [ '#include <boost/numeric/bindings/uplo_tag.hpp>' ]
       if 'DIAG' in info_map[ subroutine ][ 'arguments' ]:
         includes += [ '#include <boost/numeric/bindings/diag_tag.hpp>' ]
       if 'TRANS' in info_map[ subroutine ][ 'arguments' ]:
@@ -287,7 +287,14 @@
         if info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'opt_workspace_query' ] != None:
           workspace_query_arg_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'opt_workspace_query' ] ]
         if info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'typedef' ] != None:
- typedef_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'typedef' ] ]
+ # make sure trans tags always preceed other tags, as they may be dependant
+ if 'TRANS' in arg:
+ at_i = 0
+ if len(typedef_list)>0 and '_order<' in typedef_list[0]:
+ at_i = 1
+ typedef_list.insert( at_i, info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'typedef' ] )
+ else:
+ typedef_list.append( info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'typedef' ] )
         if info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'keyword_type' ] != None:
           keyword_type_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'keyword_type' ] ]
         if 'banded' in info_map[ subroutine ][ 'argument_map' ][ arg ]:

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-01-16 10:33:40 EST (Sat, 16 Jan 2010)
@@ -511,8 +511,12 @@
         if properties[ 'trait_type' ] == 'uplo':
             matrix_type = level1_typename( properties[ 'trait_of' ][ 0 ],
                 arg_map[ properties[ 'trait_of' ][ 0 ] ] ).replace( "typename ", "" )
- result = 'typedef typename result_of::data_side< ' + \
+ if 'ref_trans' not in arg_map[ properties[ 'trait_of' ][ 0 ] ]:
+ result = 'typedef typename result_of::uplo_tag< ' + \
                     matrix_type + ' >::type ' + name.lower() + ';'
+ else:
+ result = 'typedef typename result_of::uplo_tag< ' + \
+ matrix_type + ', trans >::type ' + name.lower() + ';'
         if properties[ 'trait_type' ] == 'diag':
             matrix_type = level1_typename( properties[ 'trait_of' ][ 0 ],
                 arg_map[ properties[ 'trait_of' ][ 0 ] ] ).replace( "typename ", "" )


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