Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63095 - in sandbox/numeric_bindings/libs/numeric/bindings/tools: . templates/computational
From: thomas.klimpel_at_[hidden]
Date: 2010-06-19 07:07:00


Author: klimpel
Date: 2010-06-19 07:06:58 EDT (Sat, 19 Jun 2010)
New Revision: 63095
URL: http://svn.boost.org/trac/boost/changeset/63095

Log:
improved automatic minimum workspace size determination for some routines in lapack/computational
Text files modified:
   sandbox/numeric_bindings/libs/numeric/bindings/tools/netlib.py | 6 +++++-
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/stedc.hpp | 36 +++++++++++++++++++++++++++++++++++-
   2 files changed, 40 insertions(+), 2 deletions(-)

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-06-19 07:06:58 EDT (Sat, 19 Jun 2010)
@@ -772,7 +772,8 @@
 def match_assert_ge( argument_map, text_field ):
   #print "Match assert GE..."
   match_it = re.compile( ' +[A-Z]+[ ]{0,3}(>=|must be at least)[ ]{0,3}([0-9]|(min|max|MIN|MAX|[\(\)\,0-9A-Z\+\*\-])+)' ).findall( text_field )
- if len( match_it ) == 1:
+ if len( match_it ) == 1 or \
+ (len( match_it ) == 2 and re.compile( 'For optimum performance' ).search( text_field ) != None):
     print "Match assert GE:", match_it
     #print match_it
     #if len( match_it[ 0 ][ 2 ] ) > 0:
@@ -1586,6 +1587,9 @@
           if not argument_map[ referring_argument_name ].has_key( 'workspace_query_by' ):
             argument_map[ referring_argument_name ][ 'workspace_query_by' ] = []
           argument_map[ referring_argument_name ][ 'workspace_query_by' ] += [ argument_name ]
+ if 'assert_ge' in argument_properties and not 'assert_size_args' in argument_map[ referring_argument_name ]:
+ argument_map[ referring_argument_name ][ 'assert_size' ] = argument_properties[ 'assert_ge' ]
+ argument_map[ referring_argument_name ][ 'assert_size_args' ] = nested_list_args( argument_properties[ 'assert_ge' ] )
 
     if 'trait_of' in argument_properties:
       rererring_argument_type = argument_properties[ 'trait_type' ]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/stedc.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/stedc.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/stedc.hpp 2010-06-19 07:06:58 EDT (Sat, 19 Jun 2010)
@@ -1,5 +1,39 @@
+$TEMPLATE[stedc.all.N.trait]
+size,D
 $TEMPLATE[stedc.all.min_size_iwork.args]
 COMPZ,N
 $TEMPLATE[stedc.all.min_size_iwork]
-// some formula
+if ( compz == 'N' || n <= 1 ) {
+ return 1;
+} else if ( compz == 'V' ) {
+ return 6 + 6*n + 5*n*static_cast<$INTEGER_TYPE>(std::ceil(std::log(n)/std::log(2)));
+} else { // compz == 'I'
+ return 3 + 5*n;
+}
+$TEMPLATE[stedc.all.min_size_work.args]
+COMPZ,N
+$TEMPLATE[stedc.real.min_size_work]
+if ( compz == 'N' || n <= 1 ) {
+ return 1;
+} else if ( compz == 'V' ) {
+ return 1 + 3*n + 2*n*static_cast<$INTEGER_TYPE>(std::ceil(std::log(n)/std::log(2))) + 3*n*n;
+} else { // compz == 'I'
+ return 1 + 4*n + n*n;
+}
+$TEMPLATE[stedc.complex.min_size_work]
+if ( compz == 'N' || compz == 'I' || n <= 1 ) {
+ return 1;
+} else { // compz == 'V'
+ return n*n;
+}
+$TEMPLATE[stedc.complex.min_size_rwork.args]
+COMPZ,N
+$TEMPLATE[stedc.complex.min_size_rwork]
+if ( compz == 'N' || n <= 1 ) {
+ return 1;
+} else if ( compz == 'V' ) {
+ return 1 + 3*n + 2*n*static_cast<$INTEGER_TYPE>(std::ceil(std::log(n)/std::log(2))) + 3*n*n;
+} else { // compz == 'I'
+ return 1 + 4*n + 2*n*n;
+}
 $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