Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58077 - in sandbox/numeric_bindings/libs/numeric/bindings/tools: . templates templates/level1
From: rutger_at_[hidden]
Date: 2009-12-01 03:32:00


Author: rutger
Date: 2009-12-01 03:31:58 EST (Tue, 01 Dec 2009)
New Revision: 58077
URL: http://svn.boost.org/trac/boost/changeset/58077

Log:
First sync of python generation scripts for numeric bindings

Added:
   sandbox/numeric_bindings/libs/numeric/bindings/tools/documentation.py (contents, props changed)
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas.qbk (contents, props changed)
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/lapack.qbk (contents, props changed)
Text files modified:
   sandbox/numeric_bindings/libs/numeric/bindings/tools/bindings.py | 44 +++++++++++++++++++++++-
   sandbox/numeric_bindings/libs/numeric/bindings/tools/blas_generator.py | 72 +++++++++++++++++++++++++++++++--------
   sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py | 54 +++++++++++++++++++++++------
   sandbox/numeric_bindings/libs/numeric/bindings/tools/netlib.py | 37 ++++++++++++++------
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas.hpp | 8 ++-
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/asum.hpp | 2 +
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/dotc.hpp | 2 +
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/dotu.hpp | 2 +
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/scal.hpp | 2 +
   9 files changed, 180 insertions(+), 43 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 2009-12-01 03:31:58 EST (Tue, 01 Dec 2009)
@@ -208,6 +208,7 @@
 
     if template_map[ 'PARSERMODE' ] == 'BLAS':
       print "something"
+
     else:
       # problem type = general_eigen, etc.
       # problem properties = the mapped stuff
@@ -228,7 +229,46 @@
     open( dest_file, 'wb' ).write( result )
 
 
+#
+# Generate const-overloads
+#
+
+def generate_const_variants( argument_list ):
+ print "Generating const variants for ", argument_list
+ permute_indices = []
+ result = []
+ static_asserts = []
+
+ for i in range( 0, len(argument_list) ):
+ argument = argument_list[i]
+ if 'const' not in argument[0:5] and '&' in argument:
+ permute_indices.append( i )
+
+ print " To be permuted: ", permute_indices
+
+ for i in range( 0, pow( 2, len( permute_indices ) ) ):
+ #print "i: ", i
+ new_arg_list = []
+ new_arg_list += argument_list
+ new_asserts = []
+ for j in range( 0, len( permute_indices ) ):
+ if ( i & (1<<j) ):
+ #print permute_indices[j], ": const " + argument_list[ permute_indices[ j ] ]
+ new_arg_list[ permute_indices[ j ] ] = "const " + argument_list[ permute_indices[ j ] ]
+ arg = new_arg_list[ permute_indices[ j ] ]
+ new_asserts.append( "BOOST_STATIC_ASSERT( (is_mutable< " +
+ arg[ :arg.find("&" ) ] + " >::value) );" )
+ else:
+ arg = new_arg_list[ permute_indices[ j ] ]
+ new_asserts.append( "BOOST_STATIC_ASSERT( (is_mutable< " +
+ arg[ :arg.find("&" ) ] + " >::value) );" )
+
+ # else:
+ #print permute_indices[j], "don't add const"
+ result.append( new_arg_list )
+ static_asserts.append( new_asserts )
+ #new_arg_list = []
 
-
-
+ #print "result: ", result
+ return result, static_asserts
 

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 2009-12-01 03:31:58 EST (Tue, 01 Dec 2009)
@@ -8,10 +8,7 @@
 # http://www.boost.org/LICENSE_1_0.txt)
 #
 
-import netlib
-import bindings
-import cblas
-import cublas
+import netlib, bindings, cblas, cublas, documentation
 
 import re, os.path, copy
 from types import StringType
@@ -41,7 +38,7 @@
 
  
 #
-# Write the (many) driver routine file(s).
+# Write the (many) routine file(s).
 #
 def write_functions( info_map, group, template_map, base_dir ):
   #
@@ -213,7 +210,20 @@
       # Level 2 replacements
       # some special stuff is done here, such as replacing real_type with a
       # type-traits deduction, etc..
- level2_template = level2_template.replace( "$LEVEL2", ", ".join( level2_arg_list ) )
+ # more important: all non-const and const variants of functions are written here
+ level2_functions = []
+ level2_arg_lists, level2_static_asserts = bindings.generate_const_variants( level2_arg_list )
+ for level2_idx in range( 0, len( level2_arg_lists ) ):
+ level2_function = level2_template.replace( "$LEVEL2", \
+ ", ".join( level2_arg_lists[ level2_idx ] ) )
+ if len( level2_static_asserts ) > 0:
+ level2_function = level2_function.replace( "$STATIC_ASSERTS", \
+ "\n".join( level2_static_asserts[ level2_idx ] ) )
+ level2_functions.append( level2_function )
+
+ level2_template = "\n".join( level2_functions )
+
+ #level2_template = level2_template.replace( "$LEVEL2", ", ".join( level2_arg_list ) )
 
       if len(level1_type_arg_list)>0:
         first_typename = level1_type_arg_list[0].split(" ")[-1]
@@ -226,6 +236,7 @@
       level2_template = level2_template.replace( "$CALL_LEVEL1", ", ".join( call_level1_arg_list ) )
       level2_template = level2_template.replace( "$TYPES", ", ".join( level1_type_arg_list ) )
       level2_template = level2_template.replace( '$RETURN_STATEMENT', info_map[ subroutine ][ 'return_statement' ] )
+ level2_template = level2_template.replace( '\n $STATIC_ASSERTS', '' )
 
       level1_map[ value_type ] = bindings.proper_indent( level1_template )
       level2_map[ value_type ] = bindings.proper_indent( level2_template )
@@ -281,6 +292,27 @@
 
 
 #
+# Write the many (low-level) documentation files
+#
+def write_documentation( info_map, group, template_map, base_dir ):
+
+ for group_name, subroutines in group.iteritems():
+ filename = group_name.lower() + '.qbk'
+ result = template_map[ 'blas.qbk' ]
+
+ result = result.replace( '$GROUPNAME', group_name )
+ result = result.replace( '$groupname', group_name.lower() )
+
+ result = result.replace( '$SUBROUTINES', documentation.readable_join( subroutines ) )
+
+ result = result.replace( '$header', 'boost/numeric/bindings/blas/' + group_name.lower() + '.hpp' )
+
+ result = result.replace( '$DISPATCH_TABLE', documentation.write_dispatch_table( subroutines, info_map ) )
+ result = result.replace( '$BLAS_FRIENDLY_NAME', documentation.blas_friendly_name( group_name, info_map, template_map ) )
+
+ open( os.path.join( base_dir, filename ), 'wb' ).write( result )
+
+#
 # Write the (many) driver routine test cases to cpp files.
 #
 def write_test_case( info_map, group, template_map, base_dir, level_name ):
@@ -325,8 +357,9 @@
 cblas_h_path = './blas-1.2/cblas/src/cblas.h'
 cublas_h_path = './cublas.h'
 template_src_path = './templates'
-bindings_target_path = '../../../../boost/numeric/bindings/blas/'
+bindings_impl_target_path = '../../../../boost/numeric/bindings/blas/'
 test_target_path = '../test/lapack/'
+bindings_doc_target_path = '../doc/blas/'
 
 # Unable to find zdrot in cblas.h and cublas.h
 # Unable to find crotg, csrot, in cblas.h
@@ -335,7 +368,7 @@
 templates = {}
 templates[ 'PARSERMODE' ] = 'BLAS'
 for root, dirs, files in os.walk( template_src_path ):
- right_file = re.compile( '^.+\.(cpp|h|hpp|txt)$' )
+ right_file = re.compile( '^.+\.(cpp|h|hpp|txt|qbk)$' )
   for template_file in files:
     if right_file.match( template_file ) != None:
       path_to_template_file = os.path.join( root, template_file )
@@ -386,18 +419,25 @@
 
 print routines
 
-
-bindings.write_names_header( function_info_map, routines, templates, bindings_target_path + 'detail/blas_names.h' )
-bindings.write_header( function_info_map, routines, templates, bindings_target_path + 'detail/blas.h' )
+bindings.write_names_header( function_info_map, routines, templates, bindings_impl_target_path + 'detail/blas_names.h' )
+bindings.write_header( function_info_map, routines, templates, bindings_impl_target_path + 'detail/blas.h' )
 
 for level, level_properties in routines.iteritems():
- target_path = bindings_target_path + level
- if not os.path.exists( target_path ):
- print "Creating directory " + target_path
- os.mkdir( target_path )
+ impl_target_path = bindings_impl_target_path + level
+ if not os.path.exists( impl_target_path ):
+ print "Creating directory " + impl_target_path
+ os.mkdir( impl_target_path )
+
+ doc_target_path = bindings_doc_target_path + level
+ if not os.path.exists( doc_target_path ):
+ print "Creating directory " + doc_target_path
+ os.mkdir( doc_target_path )
 
   print level_properties
 
   if level_properties.has_key( 'routines_by_value_type' ):
     print "has key..."
- write_functions( function_info_map, level_properties[ 'routines_by_value_type' ], templates, target_path )
+ write_functions( function_info_map, level_properties[ 'routines_by_value_type' ], templates, impl_target_path )
+ write_documentation( function_info_map, level_properties[ 'routines_by_value_type' ], templates, doc_target_path )
+
+

Added: sandbox/numeric_bindings/libs/numeric/bindings/tools/documentation.py
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/documentation.py 2009-12-01 03:31:58 EST (Tue, 01 Dec 2009)
@@ -0,0 +1,93 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2008 Thomas Klimpel and Rutger ter Borg
+#
+# 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)
+#
+
+import re
+
+routine_value_type = \
+ { 'C' : 'complex<float>',
+ 'Z' : 'complex<double>',
+ 'D' : 'double',
+ 'S' : 'float' }
+
+matrix_structure = \
+ { 'G' : 'generic',
+ 'H' : 'hermitian',
+ 'S' : 'symmetric',
+ 'T' : 'triangular' }
+
+matrix_layout = \
+ { 'B' : ', banded, ',
+ 'E' : '',
+ 'P' : ', packed, ',
+ 'Y' : '',
+ 'R' : '' }
+
+blas_op = \
+ { 'MV' : ' matrix-vector operation',
+ 'MM' : ' matrix-matrix operation',
+ 'R' : ' rank-1 update',
+ 'R2' : ' rank-2 update'
+ }
+
+def readable_join( some_tuple, last_word = "and" ):
+
+ if len( some_tuple ) == 1:
+ return some_tuple[0]
+ if len( some_tuple ) == 2:
+ return some_tuple[0] + " " + last_word + " " + some_tuple[1]
+ return ", ".join( some_tuple[:-1] ) + ", " + last_word + " " + some_tuple[-1]
+
+
+def write_dispatch_table( subroutines, info_map ):
+ result = ""
+ result += "[ [ Value type ] [BLAS routine] [CBLAS routine] [CUBLAS routine] ]\n"
+ for subroutine in subroutines:
+ cblas_routine = ''
+ if 'cblas_routine' in info_map[ subroutine ]:
+ cblas_routine = info_map[ subroutine ][ 'cblas_routine' ]
+ else:
+ cblas_routine = 'Not available'
+ cublas_routine = ''
+ if 'cublas_routine' in info_map[ subroutine ]:
+ cublas_routine = info_map[ subroutine ][ 'cublas_routine' ]
+ else:
+ cublas_routine = 'Not available'
+
+ result += "[ "
+ result += "[`" + routine_value_type[ subroutine[0] ] + "`]"
+ result += "[" + subroutine + "]"
+ result += "[" + cblas_routine + "]"
+ result += "[" + cublas_routine + "]"
+
+ result += " ]\n"
+ return result
+
+
+
+
+def blas_friendly_name( group_name, info_map, template_map ):
+
+ possible_key = group_name.lower() + ".friendly_name"
+ if possible_key in template_map:
+ return template_map[ possible_key ]
+
+ result = ""
+
+ if group_name[0] in matrix_structure and \
+ group_name[1] in matrix_layout and \
+ group_name[2:] in blas_op:
+ result += matrix_structure[ group_name[0] ]
+ result += matrix_layout[ group_name[1] ]
+ result += blas_op[ group_name[2:] ]
+ else:
+ result += "TODO"
+
+ return result
+

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 2009-12-01 03:31:58 EST (Tue, 01 Dec 2009)
@@ -8,8 +8,7 @@
 # http://www.boost.org/LICENSE_1_0.txt)
 #
 
-import netlib
-import bindings
+import netlib, bindings, documentation
 
 import re, os.path, copy
 from types import StringType
@@ -416,6 +415,29 @@
     open( os.path.join( base_dir, filename ), 'wb' ).write( result )
 
 #
+# Write the many (low-level) documentation files
+#
+def write_documentation( info_map, group, template_map, base_dir ):
+
+ for group_name, subroutines in group.iteritems():
+ filename = group_name.lower() + '.qbk'
+ result = template_map[ 'lapack.qbk' ]
+
+ result = result.replace( '$GROUPNAME', group_name )
+ result = result.replace( '$groupname', group_name.lower() )
+
+ result = result.replace( '$SUBROUTINES', documentation.readable_join( subroutines ) )
+
+ result = result.replace( '$header', 'boost/numeric/bindings/blas/' + group_name.lower() + '.hpp' )
+
+ result = result.replace( '$DISPATCH_TABLE', documentation.write_dispatch_table( subroutines, info_map ) )
+ #result = result.replace( '$BLAS_FRIENDLY_NAME', documentation.blas_friendly_name( group_name, info_map, template_map ) )
+
+ print "Writing " + base_dir + "/" + filename
+ open( os.path.join( base_dir, filename ), 'wb' ).write( result )
+
+
+#
 # Write the (many) driver routine test cases to cpp files.
 #
 def write_test_case( info_map, group, template_map, base_dir, level_name ):
@@ -458,13 +480,14 @@
 
 lapack_src_path = './lapack-3.2.0/SRC'
 template_src_path = './templates'
-bindings_target_path = '../../../../boost/numeric/bindings/lapack/'
+bindings_impl_target_path = '../../../../boost/numeric/bindings/lapack/'
 test_target_path = '../test/lapack/'
+bindings_doc_target_path = '../doc/lapack/'
 
 templates = {}
 templates[ 'PARSERMODE' ] = 'LAPACK'
 for root, dirs, files in os.walk( template_src_path ):
- right_file = re.compile( '^.+\.(cpp|h|hpp|txt)$' )
+ right_file = re.compile( '^.+\.(cpp|h|hpp|txt|qbk)$' )
   for template_file in files:
     if right_file.match( template_file ) != None:
       path_to_template_file = os.path.join( root, template_file )
@@ -561,21 +584,30 @@
 print routines
 
 
-bindings.write_names_header( function_info_map, routines, templates, bindings_target_path + 'detail/lapack_names.h' )
-bindings.write_header( function_info_map, routines, templates, bindings_target_path + 'detail/lapack.h' )
+bindings.write_names_header( function_info_map, routines, templates, bindings_impl_target_path + 'detail/lapack_names.h' )
+bindings.write_header( function_info_map, routines, templates, bindings_impl_target_path + 'detail/lapack.h' )
+
+bindings.write_include_hierarchy( function_info_map, routines, templates, bindings_impl_target_path )
 
-bindings.write_include_hierarchy( function_info_map, routines, templates, bindings_target_path )
 
 for level, level_properties in routines.iteritems():
- target_path = bindings_target_path + level
- if not os.path.exists( target_path ):
- os.mkdir( target_path )
+ impl_target_path = bindings_impl_target_path + level
+ if not os.path.exists( impl_target_path ):
+ print "Creating directory " + impl_target_path
+ os.mkdir( impl_target_path )
+
+ doc_target_path = bindings_doc_target_path + level
+ if not os.path.exists( doc_target_path ):
+ print "Creating directory " + doc_target_path
+ os.mkdir( doc_target_path )
+
   #if not os.path.exists( test_target_path + level ):
   # os.mkdir( test_target_path + level )
 
   for problem_type, problem_properties in level_properties.iteritems():
     if problem_properties.has_key( 'routines_by_value_type' ):
- write_functions( function_info_map, problem_properties[ 'routines_by_value_type' ], templates, target_path )
+ write_functions( function_info_map, problem_properties[ 'routines_by_value_type' ], templates, impl_target_path )
+ write_documentation( function_info_map, problem_properties[ 'routines_by_value_type' ], templates, doc_target_path )
 
       #write_test_case( function_info_map, problem_properties[ 'routines_by_value_type' ], templates, test_target_path + level, level )
 

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 2009-12-01 03:31:58 EST (Tue, 01 Dec 2009)
@@ -113,13 +113,13 @@
     if properties[ 'trait_type' ] == 'lda':
       result = "traits::leading_dimension(" + properties[ 'trait_of' ].lower() + ")"
     if properties[ 'trait_type' ] == 'num_columns':
- result = "traits::matrix_num_columns(" + properties[ 'trait_of' ].lower() + ")"
+ result = "num_columns(" + properties[ 'trait_of' ].lower() + ")"
     if properties[ 'trait_type' ] == 'num_rows':
- result = "traits::matrix_num_rows(" + properties[ 'trait_of' ].lower() + ")"
+ result = "num_rows(" + properties[ 'trait_of' ].lower() + ")"
     if properties[ 'trait_type' ] == 'trans_num_columns':
       result = "(" + properties[ 'trait_of' ][0].lower() + "=='N' ? " + \
- "traits::matrix_num_columns(" + properties[ 'trait_of' ][1].lower() + ") : " + \
- "traits::matrix_num_rows(" + properties[ 'trait_of' ][1].lower() + "))"
+ "num_columns(" + properties[ 'trait_of' ][1].lower() + ") : " + \
+ "num_rows(" + properties[ 'trait_of' ][1].lower() + "))"
     if properties[ 'trait_type' ] == 'size':
       my_name = properties[ 'trait_of' ].lower()
       referring_to_properties = arg_map[ properties[ 'trait_of' ] ]
@@ -173,8 +173,8 @@
         "_traits< $FIRST_TYPENAME >::value_type >::real_type" )
     if properties[ 'value_type' ][ 0:7] == 'COMPLEX' or \
       properties[ 'value_type' ] == 'DOUBLE COMPLEX':
- result = result.replace( "value_type", "typename traits::$TYPEOF_FIRST_TYPENAME" + \
- "_traits< $FIRST_TYPENAME >::value_type" )
+ result = result.replace( "value_type", "typename tensor_traits" + \
+ "< $FIRST_TYPENAME >::value_type" )
   return result
 
 
@@ -218,12 +218,12 @@
 def level1_static_assert( name, properties ):
   result = None
   if 'workspace' not in properties[ 'io' ]:
- if properties[ 'type' ] == 'matrix':
- result = "typename traits::matrix_traits< " + level1_typename( name, properties ).replace( "typename ", "") + " >::value_type"
- elif properties[ 'type' ] == 'vector':
- result = "typename traits::vector_traits< " + level1_typename( name, properties ).replace( "typename ", "") + " >::value_type"
+ if properties[ 'type' ] == 'matrix' or properties[ 'type' ] == 'vector':
+ #result = level1_typename( name, properties ).replace( "typename ", "" )
+ result = "typename tensor_traits< " + level1_typename( name, properties ).replace( "typename ", "" ) + " >::value_type"
     elif properties[ 'type' ] == 'scalar':
- result = "TODO"
+ result = "TODO HOOK"
+ #result = "typename tensor_traits< " + level1_type( name, properties ) + " >::value_type"
   return result
 
 
@@ -305,6 +305,13 @@
   print "ERROR: Don't know what to do!!"
   return 'ERROR'
 
+
+#
+#
+# TODO Fix this is multiple conditions are true, make
+# sure multiple combinations of asserts are possible
+#
+#
 def level1_assert( name, properties, arg_map ):
   result = None
   
@@ -318,6 +325,14 @@
     
   if properties.has_key( 'assert_ge' ) and not properties.has_key( 'workspace_query_for' ):
     result = "BOOST_ASSERT( " + call_level0_type( name, properties, arg_map ) + " >= " + expand_nested_list( properties[ 'assert_ge' ], arg_map ) + ' );'
+
+ #if properties[ 'type' ] == 'vector' and properties[ 'call_level1' ] != None:
+ #result = "BOOST_ASSERT( min_tensor_rank( " + call_level1_type( name, properties ) + \
+ #" ) <= 1 );"
+
+ #if properties[ 'type' ] == 'matrix':
+ #result = "BOOST_ASSERT( min_tensor_rank( " + call_level1_type( name, properties ) + \
+ #" ) <= 2 );"
       
   if 'workspace' in properties[ 'io' ]:
     min_workspace_call = min_workspace_call_type( name, properties, arg_map )

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 2009-12-01 03:31:58 EST (Tue, 01 Dec 2009)
@@ -64,7 +64,7 @@
 struct $groupname_impl {
 
     typedef ValueType value_type;
- typedef typename traits::type_traits<ValueType>::real_type real_type;
+ typedef typename remove_imaginary<ValueType>::type real_type;
     typedef $RETURN_TYPE return_type;
 
 $INCLUDE_TEMPLATES
@@ -72,15 +72,17 @@
     template< $TYPES >
     static return_type invoke( $LEVEL1 ) {
         $STATIC_ASSERTS
+ $ASSERTS
         $RETURN_STATEMENTdetail::$groupname( $CALL_LEVEL0 );
     }
 };
 $TEMPLATE[blas_level2]
 // generic template function to call $groupname
 template< $TYPES >
-inline typename $groupname_impl< typename traits::$TYPEOF_FIRST_TYPENAME_traits< $FIRST_TYPENAME >::value_type >::return_type
+inline typename $groupname_impl< typename tensor_traits< $FIRST_TYPENAME >::value_type >::return_type
 $groupname( $LEVEL2 ) {
- typedef typename traits::$TYPEOF_FIRST_TYPENAME_traits< $FIRST_TYPENAME >::value_type value_type;
+ typedef typename tensor_traits< $FIRST_TYPENAME >::value_type value_type;
+ $STATIC_ASSERTS
     $RETURN_STATEMENT$groupname_impl< value_type >::invoke( $CALL_LEVEL1 );
 }
 $TEMPLATE[end]

Added: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas.qbk
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas.qbk 2009-12-01 03:31:58 EST (Tue, 01 Dec 2009)
@@ -0,0 +1,69 @@
+$TEMPLATE[blas.qbk]
+
+[section x$GROUPNAME]
+
+[section Prototype]
+[endsect]
+
+[section Description]
+
+Numeric_bindings routine $groupname, or $BLAS_FRIENDLY_NAME, is a value-type based
+dispatching routine to routines in BLAS. It's name, $groupname, is made
+up by stripping the first character from the BLAS routines
+$SUBROUTINES.
+
+A $BLAS_FRIENDLY_NAME is defined as
+equation stuff here
+
+where A is a matrix with a symmetric data structure, B is a matrix, C is an
+integer containing ..., and x and y are vectors.
+
+Compile-time dispatching of this routine is determind by the value type of tensor A,
+and should be the same type the numeric_bindings meta-function `typename tensor_traits<A>::value_type`.
+Table xx illustrates to which specific routines this dispatching will take place.
+
+[table x$GROUPNAME dispatching of routines
+$DISPATCH_TABLE
+]
+
+[endsect]
+
+[section Definition]
+Defined in header [headerref $header].
+[endsect]
+
+[section Parameters or Requirements on Types]
+
+The tensor_traits<>::value_type of A, B, and C should be the same.
+Tensor C should be mutable.
+
+[endsect]
+
+[section Complexity]
+[endsect]
+
+[section Example]
+``
+#include <$header>
+using namespace boost::numeric::bindings;
+
+blas::$groupname( x, y, z );
+
+``
+
+this will output
+
+``
+[5] 0 1 2 3 4 5
+``
+
+[endsect]
+
+[section Notes]
+[endsect]
+
+[section See Also]
+[endsect]
+
+[endsect]
+$TEMPLATE[end]

Added: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/lapack.qbk
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/lapack.qbk 2009-12-01 03:31:58 EST (Tue, 01 Dec 2009)
@@ -0,0 +1,69 @@
+$TEMPLATE[lapack.qbk]
+
+[section x$GROUPNAME]
+
+[section Prototype]
+[endsect]
+
+[section Description]
+
+Numeric_bindings routine $groupname, or $BLAS_FRIENDLY_NAME, is a value-type based
+dispatching routine to routines in BLAS. It's name, $groupname, is made
+up by stripping the first character from the BLAS routines
+$SUBROUTINES.
+
+A $BLAS_FRIENDLY_NAME is defined as
+equation stuff here
+
+where A is a matrix with a symmetric data structure, B is a matrix, C is an
+integer containing ..., and x and y are vectors.
+
+Compile-time dispatching of this routine is determind by the value type of tensor A,
+and should be the same type the numeric_bindings meta-function `typename tensor_traits<A>::value_type`.
+Table xx illustrates to which specific routines this dispatching will take place.
+
+[table x$GROUPNAME dispatching of routines
+$DISPATCH_TABLE
+]
+
+[endsect]
+
+[section Definition]
+Defined in header [headerref $header].
+[endsect]
+
+[section Parameters or Requirements on Types]
+
+The tensor_traits<>::value_type of A, B, and C should be the same.
+Tensor C should be mutable.
+
+[endsect]
+
+[section Complexity]
+[endsect]
+
+[section Example]
+``
+#include <$header>
+using namespace boost::numeric::bindings;
+
+lapack::$groupname( x, y, z );
+
+``
+
+this will output
+
+``
+[5] 0 1 2 3 4 5
+``
+
+[endsect]
+
+[section Notes]
+[endsect]
+
+[section See Also]
+[endsect]
+
+[endsect]
+$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 2009-12-01 03:31:58 EST (Tue, 01 Dec 2009)
@@ -6,4 +6,6 @@
  INCX (input) INTEGER
            The increment of X
  X (input) DATATYPE array of length (N)
+$TEMPLATE[asum.friendly_name]
+absolute sum
 $TEMPLATE[end]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/dotc.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/dotc.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/dotc.hpp 2009-12-01 03:31:58 EST (Tue, 01 Dec 2009)
@@ -9,4 +9,6 @@
            The increment of Y
  X (input) DATATYPE
  Y (input) DATATYPE
+$TEMPLATE[dotc.friendly_name]
+TODO
 $TEMPLATE[end]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/dotu.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/dotu.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/dotu.hpp 2009-12-01 03:31:58 EST (Tue, 01 Dec 2009)
@@ -9,4 +9,6 @@
            The increment of Y
  X (input) DATATYPE
  Y (input) DATATYPE
+$TEMPLATE[dotu.friendly_name]
+TODO
 $TEMPLATE[end]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/scal.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/scal.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/scal.hpp 2009-12-01 03:31:58 EST (Tue, 01 Dec 2009)
@@ -9,4 +9,6 @@
  A (input) DATATYPE
 $TEMPLATE[scal.all.cblas_alias]
 A,ALPHA
+$TEMPLATE[scal.friendly_name]
+scale
 $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