Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60762 - in sandbox/numeric_bindings/libs/numeric/bindings/tools: . templates templates/level1
From: rutger_at_[hidden]
Date: 2010-03-22 04:53:10


Author: rutger
Date: 2010-03-22 04:53:08 EDT (Mon, 22 Mar 2010)
New Revision: 60762
URL: http://svn.boost.org/trac/boost/changeset/60762

Log:
Renamed return_type to result_type for eventual compatibility with result_of

Text files modified:
   sandbox/numeric_bindings/libs/numeric/bindings/tools/bindings.py | 2 +-
   sandbox/numeric_bindings/libs/numeric/bindings/tools/blas_generator.py | 4 ++--
   sandbox/numeric_bindings/libs/numeric/bindings/tools/cblas.py | 4 ++--
   sandbox/numeric_bindings/libs/numeric/bindings/tools/cublas.py | 2 +-
   sandbox/numeric_bindings/libs/numeric/bindings/tools/netlib.py | 24 ++++++++++++------------
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas.hpp | 12 ++++++------
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas_transform.hpp | 2 +-
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/asum.hpp | 2 +-
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/iamax.hpp | 2 +-
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/nrm2.hpp | 2 +-
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/prec_dot.hpp | 2 +-
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/singleton_blas.hpp | 2 +-
   12 files changed, 30 insertions(+), 30 deletions(-)

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-03-22 04:53:08 EDT (Mon, 22 Mar 2010)
@@ -178,7 +178,7 @@
 
       template = template.replace( "$SUBROUTINE", k )
       template = template.replace( "$ARGUMENTS", ", ".join( arg_list ) )
- template = template.replace( '$RETURN_TYPE', global_info_map[ k ][ 'return_value_type' ] )
+ template = template.replace( '$RESULT_TYPE', global_info_map[ k ][ 'return_value_type' ] )
       template = template.replace( '$RETURN_STATEMENT', global_info_map[ k ][ 'return_statement' ] )
       template = template.replace( "$LIBRARY_INT_TYPE", "fortran_int_t" )
       content += proper_indent( template )

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-03-22 04:53:08 EDT (Mon, 22 Mar 2010)
@@ -147,7 +147,7 @@
         sub_template = sub_template.replace( "$CUBLAS_ROUTINE", cublas_routine )
 
         sub_template = sub_template.replace( '$groupname', group_name.lower() )
- sub_template = sub_template.replace( '$RETURN_TYPE', info_map[ subroutine ][ 'return_value_type' ] )
+ sub_template = sub_template.replace( '$RESULT_TYPE', info_map[ subroutine ][ 'return_value_type' ] )
         sub_template = sub_template.replace( '$RETURN_STATEMENT', info_map[ subroutine ][ 'return_statement' ] )
         sub_template = bindings.search_replace( sub_template, group_name.lower() + '.level0.gsub', template_map )
 
@@ -329,7 +329,7 @@
       level1_template = level1_template.replace( "$LEVEL1", ", ".join( level1_arg_list ) )
       level1_template = level1_template.replace( "$TYPES", ", ".join( level1_type_arg_list ) )
       level1_template = level1_template.replace( "$ASSERTS", "\n ".join( sorted( level1_assert_list ) ) )
- level1_template = level1_template.replace( '$RETURN_TYPE', info_map[ subroutine ][ 'level1_return_type' ] )
+ level1_template = level1_template.replace( '$RESULT_TYPE', info_map[ subroutine ][ 'level1_result_type' ] )
       level1_template = level1_template.replace( '$RETURN_STATEMENT', info_map[ subroutine ][ 'return_statement' ] )
       level1_template = level1_template.replace( "$KEYWORDS", ", ".join( keyword_type_list ) )
 

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/cblas.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/cblas.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/cblas.py 2010-03-22 04:53:08 EDT (Mon, 22 Mar 2010)
@@ -30,7 +30,7 @@
 
     for match in re.compile( '(void|float|int|double|CBLAS_INDEX) +' + prefix + '([^\(]+)\(([^\)]+)\)', re.M | re.S ).findall( source ):
         print "----"
- return_type = match[0]
+ result_type = match[0]
         fortran_routine = match[1].split("_sub")[0].upper().strip()
         c_routine = prefix + match[1]
 
@@ -97,7 +97,7 @@
                     else:
                         info_map[ fortran_routine ][ "argument_map" ][ arg ][ "code" ][ "call_" + prefix + "header" ] = call_cblas_header
                 else:
- if arg == 'INFO' and return_type == 'int':
+ if arg == 'INFO' and result_type == 'int':
                         info_map[ fortran_routine ][ "argument_map" ][ arg ][ "code" ][ "call_" + prefix + "header" ] = None
                         print "INFO is the return type, adding it with code None"
                     elif arg == 'WORK' or arg == 'LWORK':

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/cublas.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/cublas.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/cublas.py 2010-03-22 04:53:08 EDT (Mon, 22 Mar 2010)
@@ -21,7 +21,7 @@
     for match in re.compile( '^(cuComplex|cuDoubleComplex|float|double|void|int) ?CUBLASAPI ?cublas([SDCZI][a-z0-9]+) ?\(([^\)]+)\)', re.M | re.S ).findall( source ):
         print "----"
 
- return_type = match[0]
+ result_type = match[0]
         blas_routine = match[1].upper().strip()
         print "CUBLAS routine:", match[1], " BLAS equivalent:", blas_routine
 

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-03-22 04:53:08 EDT (Mon, 22 Mar 2010)
@@ -44,7 +44,7 @@
 
 templates = {}
 
-def return_type( fortran_type ):
+def result_type( fortran_type ):
   m_type_map = global_type_map
   m_type_map[ 'COMPLEX' ] = complex_float_type
   m_type_map[ 'COMPLEX*16' ] = complex_double_type
@@ -914,7 +914,7 @@
   subroutine_group_name = None
   subroutine_value_type = None
   subroutine_precision = None
- subroutine_return_type = None
+ subroutine_result_type = None
 
   code_line_nr = 0
   while code_line_nr < len(code) and not subroutine_found:
@@ -924,9 +924,9 @@
       subroutine_name = match_subroutine_name.group( 2 )
       subroutine_arguments = match_subroutine_name.group( 3 ).replace( ' ', '' ).split( "," )
       if match_subroutine_name.group(1) != 'SUBROUTINE':
- subroutine_return_type = (" ".join( match_subroutine_name.group(1).split(" ")[0:-1] )).strip()
- while ' ' in subroutine_return_type:
- subroutine_return_type = subroutine_return_type.replace( ' ', ' ' )
+ subroutine_result_type = (" ".join( match_subroutine_name.group(1).split(" ")[0:-1] )).strip()
+ while ' ' in subroutine_result_type:
+ subroutine_result_type = subroutine_result_type.replace( ' ', ' ' )
 
     code_line_nr += 1
 
@@ -970,7 +970,7 @@
   print "Group name: ", subroutine_group_name
   print "Variant: ", subroutine_value_type
   print "Precision: ", subroutine_precision
- print "Return: ", subroutine_return_type
+ print "Return: ", subroutine_result_type
 
   # Now we have the names of the arguments. The code following the subroutine statement are
   # the argument declarations. Parse those right now, splitting these examples
@@ -1643,21 +1643,21 @@
   info_map[ 'purpose' ] = subroutine_purpose
   info_map[ 'value_type' ] = subroutine_value_type
   info_map[ 'group_name' ] = subroutine_group_name
- info_map[ 'return_type' ] = subroutine_return_type
+ info_map[ 'result_type' ] = subroutine_result_type
   info_map[ 'precision' ] = subroutine_precision
   info_map[ 'argument_map' ] = argument_map
   info_map[ 'grouped_arguments' ] = grouped_arguments
- if subroutine_return_type != None:
- info_map[ 'return_value_type' ] = return_type( subroutine_return_type )
- info_map[ 'level1_return_type' ] = 'value_type'
+ if subroutine_result_type != None:
+ info_map[ 'return_value_type' ] = result_type( subroutine_result_type )
+ info_map[ 'level1_result_type' ] = 'value_type'
     info_map[ 'return_statement' ] = 'return '
   else:
     info_map[ 'return_value_type' ] = 'void'
- info_map[ 'level1_return_type' ] = 'void'
+ info_map[ 'level1_result_type' ] = 'void'
     info_map[ 'return_statement' ] = ''
 
   # Enable overrides of direct info-map stuff.
- for key_name in [ 'level1_return_type' ]:
+ for key_name in [ 'level1_result_type' ]:
         my_key = subroutine_group_name.lower() + '.' + subroutine_value_type + '.' + key_name
         if my_has_key( my_key, template_map ):
             user_value = template_map[ my_has_key( my_key, template_map ) ].strip()

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas.hpp 2010-03-22 04:53:08 EDT (Mon, 22 Mar 2010)
@@ -81,7 +81,7 @@
 // * $SPECIALIZATION value-type.
 //
 template< $TYPES >
-inline $RETURN_TYPE $groupname( $LEVEL0 ) {
+inline $RESULT_TYPE $groupname( $LEVEL0 ) {
     $STATIC_ASSERTS
     $RETURN_STATEMENTBLAS_$SUBROUTINE( $CALL_BLAS_HEADER );
 }
@@ -93,7 +93,7 @@
 // * $SPECIALIZATION value-type.
 //
 template< $TYPES >
-inline $RETURN_TYPE $groupname( $LEVEL0 ) {
+inline $RESULT_TYPE $groupname( $LEVEL0 ) {
     $RETURN_STATEMENT$CBLAS_ROUTINE( $CALL_CBLAS_HEADER );
 }
 
@@ -104,7 +104,7 @@
 // * $SPECIALIZATION value-type.
 //
 template< $TYPES >
-inline $RETURN_TYPE $groupname( $LEVEL0 ) {
+inline $RESULT_TYPE $groupname( $LEVEL0 ) {
     $STATIC_ASSERTS
     $RETURN_STATEMENT$CUBLAS_ROUTINE( $CALL_CUBLAS_HEADER );
 }
@@ -119,7 +119,7 @@
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;
- typedef $RETURN_TYPE return_type;
+ typedef $RESULT_TYPE result_type;
 
 $INCLUDE_TEMPLATES
     //
@@ -128,7 +128,7 @@
     // * Asserts that most arguments make sense.
     //
     template< $TYPES >
- static return_type invoke( $LEVEL1 ) {
+ static result_type invoke( $LEVEL1 ) {
         namespace bindings = ::boost::numeric::bindings;
         $TYPEDEFS
         $STATIC_ASSERTS
@@ -142,7 +142,7 @@
 $COMMENTS
 //
 template< $TYPES >
-inline typename $groupname_impl< typename $NAMESPACEvalue_type< $FIRST_TYPENAME >::type >::return_type
+inline typename $groupname_impl< typename $NAMESPACEvalue_type< $FIRST_TYPENAME >::type >::result_type
 $groupname( $LEVEL2 ) {
     $RETURN_STATEMENT$groupname_impl< typename $NAMESPACEvalue_type< $FIRST_TYPENAME >::type >::invoke( $CALL_LEVEL1 );
 }

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas_transform.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas_transform.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas_transform.hpp 2010-03-22 04:53:08 EDT (Mon, 22 Mar 2010)
@@ -1,7 +1,7 @@
 $TEMPLATE[template_blas_transform]
     // high-level transform typedefs and functions
     template< typename MatrixA, typename VectorX, typename VectorY >
- static return_type transform( MatrixA& A, VectorX& x, VectorY& y, const value_type alpha, const value_type beta ) {
+ static result_type transform( MatrixA& A, VectorX& x, VectorY& y, const value_type alpha, const value_type beta ) {
         invoke( $KEYWORDS );
     }
 $TEMPLATE[end]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/asum.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/asum.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/asum.hpp 2010-03-22 04:53:08 EDT (Mon, 22 Mar 2010)
@@ -1,6 +1,6 @@
 $TEMPLATE[asum.all.remove_argument_value_type_prepend]
 X
-$TEMPLATE[asum.all.level1_return_type]
+$TEMPLATE[asum.all.level1_result_type]
 real_type
 $TEMPLATE[asum.all.arguments]
  N (input) INTEGER

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/iamax.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/iamax.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/iamax.hpp 2010-03-22 04:53:08 EDT (Mon, 22 Mar 2010)
@@ -8,6 +8,6 @@
 stride,X
 $TEMPLATE[iamax.all.N.trait]
 size,X
-$TEMPLATE[iamax.all.level1_return_type]
+$TEMPLATE[iamax.all.level1_result_type]
 std::ptrdiff_t
 $TEMPLATE[end]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/nrm2.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/nrm2.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/nrm2.hpp 2010-03-22 04:53:08 EDT (Mon, 22 Mar 2010)
@@ -1,6 +1,6 @@
 $TEMPLATE[nrm2.all.remove_argument_value_type_prepend]
 X
-$TEMPLATE[nrm2.all.level1_return_type]
+$TEMPLATE[nrm2.all.level1_result_type]
 real_type
 $TEMPLATE[nrm2.all.arguments]
  N (input) INTEGER

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/prec_dot.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/prec_dot.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/prec_dot.hpp 2010-03-22 04:53:08 EDT (Mon, 22 Mar 2010)
@@ -18,6 +18,6 @@
 stride,X
 $TEMPLATE[prec_dot.all.INCY.trait]
 stride,Y
-$TEMPLATE[prec_dot.all.level1_return_type]
+$TEMPLATE[prec_dot.all.level1_result_type]
 double
 $TEMPLATE[end]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/singleton_blas.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/singleton_blas.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/singleton_blas.hpp 2010-03-22 04:53:08 EDT (Mon, 22 Mar 2010)
@@ -24,7 +24,7 @@
 #endif
 
 $TEMPLATE[blas.h_function]
-$RETURN_TYPE BLAS_$SUBROUTINE( $ARGUMENTS );
+$RESULT_TYPE BLAS_$SUBROUTINE( $ARGUMENTS );
 $TEMPLATE[blas_names.h]
 //
 // Copyright (c) 2003--2009


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