|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58545 - in sandbox/numeric_bindings/libs/numeric/bindings/tools: . templates
From: rutger_at_[hidden]
Date: 2009-12-28 10:15:49
Author: rutger
Date: 2009-12-28 10:15:49 EST (Mon, 28 Dec 2009)
New Revision: 58545
URL: http://svn.boost.org/trac/boost/changeset/58545
Log:
overload generation for lapack_generator, minor bugfixes
Text files modified:
sandbox/numeric_bindings/libs/numeric/bindings/tools/blas_generator.py | 2 +-
sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py | 14 +++++++++++++-
sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/lapack.hpp | 9 ++++++---
3 files changed, 20 insertions(+), 5 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 2009-12-28 10:15:49 EST (Mon, 28 Dec 2009)
@@ -315,7 +315,7 @@
", ".join( level2_arg_lists[ level2_idx ] ) )
if len( "".join(level2_comments[ level2_idx ] ) ) > 0:
level2_function = level2_function.replace( "$COMMENTS", \
- "\n ".join( level2_comments[ level2_idx ] ) )
+ "\n".join( level2_comments[ level2_idx ] ) )
level2_functions.append( level2_function )
level2_template = "\n".join( level2_functions )
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-28 10:15:49 EST (Mon, 28 Dec 2009)
@@ -273,7 +273,19 @@
# 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_comments = 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( "".join(level2_comments[ level2_idx ] ) ) > 0:
+ level2_function = level2_function.replace( "$COMMENTS", \
+ "\n".join( level2_comments[ level2_idx ] ) )
+ level2_functions.append( level2_function )
+
+ level2_template = "\n".join( level2_functions )
+ level2_template = level2_template.replace( "$COMMENTS\n", "" )
# Determine a right type to select for real or complex variants
first_typename = ''
Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/lapack.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/lapack.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/lapack.hpp 2009-12-28 10:15:49 EST (Mon, 28 Dec 2009)
@@ -158,7 +158,8 @@
invoke( $CALL_LEVEL1, minimal_workspace() );
$TEMPLATE[level2_workspace]
//
-// Overloaded function for $groupname
+// Overloaded function for $groupname. Its overload differs for
+$COMMENTS
// * User-defined workspace
//
template< $TYPES, typename Workspace >
@@ -169,7 +170,8 @@
}
//
-// Overloaded function for $groupname
+// Overloaded function for $groupname. Its overload differs for
+$COMMENTS
// * Default workspace-type (optimal)
//
template< $TYPES >
@@ -213,7 +215,8 @@
$TEMPLATE[level2_noworkspace]
//
-// Overloaded function for $groupname
+// Overloaded function for $groupname. Its overload differs for
+$COMMENTS
//
template< $TYPES >
inline integer_t $groupname( $LEVEL2 ) {
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