Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51871 - sandbox/numeric_bindings/boost/numeric/bindings/lapack
From: rutger_at_[hidden]
Date: 2009-03-20 12:44:19


Author: rutger
Date: 2009-03-20 12:44:18 EDT (Fri, 20 Mar 2009)
New Revision: 51871
URL: http://svn.boost.org/trac/boost/changeset/51871

Log:
updated latest lapack/solve.hpp file

Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/solve.hpp | 56 ++++++++++++++++++++++++++++++----------
   1 files changed, 42 insertions(+), 14 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/solve.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/solve.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/solve.hpp 2009-03-20 12:44:18 EDT (Fri, 20 Mar 2009)
@@ -9,9 +9,11 @@
 #ifndef BOOST_NUMERIC_BINDINGS_LAPACK_SOLVE_HPP
 #define BOOST_NUMERIC_BINDINGS_LAPACK_SOLVE_HPP
 
+#include <boost/numeric/bindings/traits/traits.hpp>
+#include <boost/numeric/bindings/traits/detail/array.hpp>
 #include <boost/numeric/bindings/lapack/driver/gesv.hpp>
-#include <boost/numeric/bindings/lapack/driver/gbsv.hpp>
-#include <boost/numeric/bindings/lapack/driver/gtsv.hpp>
+//#include <boost/numeric/bindings/lapack/driver/gbsv.hpp>
+//#include <boost/numeric/bindings/lapack/driver/gtsv.hpp>
 #include <boost/numeric/bindings/lapack/driver/hesv.hpp>
 #include <boost/numeric/bindings/lapack/driver/hpsv.hpp>
 #include <boost/numeric/bindings/lapack/driver/posv.hpp>
@@ -21,18 +23,25 @@
 #include <boost/numeric/bindings/lapack/driver/sysv.hpp>
 #include <boost/numeric/bindings/lapack/driver/spsv.hpp>
 
+#include <boost/numeric/bindings/lapack/keywords.hpp>
+#include <boost/numeric/bindings/lapack/detail/null_vector.hpp>
+
+#include <boost/mpl/at.hpp>
 #include <boost/mpl/map.hpp>
 
+#include <boost/parameter/preprocessor.hpp>
+
 namespace mpl = boost::mpl;
 
 namespace boost {
 namespace numeric {
 namespace bindings {
+namespace lapack {
 
-template< typename MatrixA, typename MatrixB, typename Workspace >
-inline integer_t solve( MatrixA& a, MatrixB& b, Workspace work = optimal_workspace() ) {
- typedef typename traits::matrix_traits< MatrixA >::value_type value_type;
- typedef typename traits::matrix_traits< MatrixA >::matrix_structure matrix_structure;
+template< typename Matrix >
+struct solve_dispatcher {
+ typedef typename traits::matrix_traits< Matrix >::value_type value_type;
+ typedef typename traits::matrix_traits< Matrix >::matrix_structure matrix_structure;
 
     typedef typename mpl::map<
         mpl::pair< traits::general_t, gesv_impl< value_type > >,
@@ -40,16 +49,35 @@
         mpl::pair< traits::symmetric_packed_t, spsv_impl< value_type > >,
         mpl::pair< traits::hermitian_t, hesv_impl< value_type > >,
         mpl::pair< traits::hermitian_packed_t, hpsv_impl< value_type > >,
- mpl::pair< traits::banded_t, gbsv_impl< value_type > >,
- mpl::pair< traits::unknown_structure_t, gesv_impl< value_type > > > dispatch_map;
+ // mpl::pair< traits::banded_t, gbsv_impl< value_type > >,
+ mpl::pair< traits::unknown_structure_t, gesv_impl< value_type > > > simple_map;
 
- typedef typename mpl::at< dispatch_map, matrix_structure >::type driver_routine;
+ typedef typename mpl::at< simple_map, matrix_structure >::type simple;
 
- int info(0);
- driver_routine::compute( a, b, info, work );
- return info;
-}
+ // placeholder for pivot vector type,
+ // will dispatch to this type and a null_vector
+ typedef traits::detail::array< integer_t > pivot_type;
+
+};
+
+BOOST_PARAMETER_FUNCTION(
+ (void), // return type
+ solve, // name of the resulting function template
+ keywords::tag, // tags namespace
+ (required
+ (in_out(A), *)
+ (in_out(B), *)
+ )
+ (optional
+ (in_out(pivot), *,
+ typename solve_dispatcher< A_type >::pivot_type( traits::matrix_num_columns(A) ) )
+ )
+ ) {
+ typedef typename solve_dispatcher< A_type >::simple routine;
+ integer_t info(0);
+ routine::solve( A, B, pivot, info );
+ }
 
-}}} // namespace boost::numeric::bindings::lapack
+}}}} // namespace boost::numeric::bindings::lapack
 
 #endif


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