--- blas2.hpp.orig 2009-03-03 03:24:25.000000000 +0000 +++ blas2.hpp 2009-03-03 03:28:32.000000000 +0000 @@ -5,6 +5,7 @@ // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // +// Modified to include dtrsv by Kian Ming A. Chai (3 Mar 2009) #ifndef BOOST_BINDINGS_BLAS_BLAS2_HPP #define BOOST_BINDINGS_BLAS_BLAS2_HPP @@ -84,6 +85,27 @@ namespace boost { namespace numeric { na detail::ger( m, n, alpha, x_ptr, stride_x, y_ptr, stride_y, a_ptr, lda ); } + + // Added by K.M.A Chai (3 Mar 2009) + // x <- A^{-1} x + // ! CAUTION this function assumes that all matrices involved are column-major matrices + template < typename matrix_type, typename vector_type_x > + void trsv(const char UPLO, const char TRANS, const char DIAG, const matrix_type &a, vector_type_x& x) + { + assert(UPLO == 'U' || UPLO == 'L'); + + typedef typename vector_type_x::value_type value_type ; + const int n = traits::matrix_size1 (a); + const int lda = traits::leading_dimension (a); + const int stride_x = traits::vector_stride( x ) ; + // FIXME: Add some asserts here? + + const value_type *a_ptr = traits::matrix_storage( a ) ; + value_type *x_ptr = traits::vector_storage( x ) ; + + detail::trsv( UPLO, TRANS, DIAG, n, a_ptr, lda, x_ptr, stride_x); + } + /* // A <- alpha * x * trans(y) ( outer product ), alpha, x and y are complex-valued template < typename vector_type_x, typename vector_type_y, typename value_type, typename matrix_type >