Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59191 - in sandbox/numeric_bindings/libs/numeric/bindings/tools: . templates/computational
From: rutger_at_[hidden]
Date: 2010-01-21 03:44:19


Author: rutger
Date: 2010-01-21 03:44:18 EST (Thu, 21 Jan 2010)
New Revision: 59191
URL: http://svn.boost.org/trac/boost/changeset/59191

Log:
added support for exceptional case of getrs

Added:
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/getrs.hpp (contents, props changed)
Text files modified:
   sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py | 15 +++++++++++++++
   1 files changed, 15 insertions(+), 0 deletions(-)

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-21 03:44:18 EST (Thu, 21 Jan 2010)
@@ -242,6 +242,7 @@
         matrix_wo_trans = []
         matrix_wo_trans_arg = []
         matrix_with_trans = []
+ matrix_wo_trans_arg_removed = []
         for matrix_arg in info_map[ subroutine ][ 'grouped_arguments' ][ 'by_type' ][ 'matrix' ]:
             if 'ref_trans' in info_map[ subroutine ][ 'argument_map' ][ matrix_arg ]:
                 has_trans = True
@@ -265,6 +266,7 @@
                 ' >::type order;' )
             includes += [ '#include <boost/numeric/bindings/data_order.hpp>' ]
             del matrix_wo_trans[0]
+ matrix_wo_trans_arg_removed = [ matrix_wo_trans_arg[0] ]
             del matrix_wo_trans_arg[0]
           else:
             typedef_list.insert( 0, 'typedef typename detail::default_order< ' + matrix_with_trans[0] + \
@@ -304,6 +306,19 @@
                     # and this makes sure we're only adding an include if the function is really used.
                     includes += [ '#include <boost/numeric/bindings/is_column_major.hpp>' ]
 
+ # In case of, e.g., getrs, MatrixB should be column major for CLAPACK, too.
+ # This is not detected because MatrixA may be row major and transposed to column_major ordering.
+ # So, MatrixB should be column_major although it is determining the order.
+ # I.e., the order should be column_major. Look in the template system for these overrides.
+ for matrix_arg in matrix_wo_trans_arg_removed:
+ my_key = group_name.lower() + '.' + value_type + '.' + matrix_arg + '.is_column_major'
+ print "Looking for column_major override ", my_key
+ if netlib.my_has_key( my_key, template_map ):
+ assert_line = 'BOOST_STATIC_ASSERT( (bindings::is_column_major< ' + \
+ info_map[ subroutine ][ 'argument_map' ][ matrix_arg ][ 'code' ][ 'level_1_static_assert' ] + ' >::value) );'
+ level1_static_assert_list += [ assert_line ]
+ includes += [ '#include <boost/numeric/bindings/is_column_major.hpp>' ]
+
       #
       # Add an include in case of the uplo or diag options
       #

Added: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/getrs.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/getrs.hpp 2010-01-21 03:44:18 EST (Thu, 21 Jan 2010)
@@ -0,0 +1,2 @@
+$TEMPLATE[getrs.all.B.is_column_major]
+$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