31 #ifndef SHARK_LINALG_BLAS_KERNELS_CBLAS_TRSV_HPP 32 #define SHARK_LINALG_BLAS_KERNELS_CBLAS_TRSV_HPP 38 namespace shark {
namespace blas{
namespace bindings {
40 CBLAS_ORDER order, CBLAS_UPLO uplo,
41 CBLAS_TRANSPOSE transA, CBLAS_DIAG unit,
43 float const *A,
int lda,
float *b,
int strideX
45 cblas_strsv(order, uplo, transA, unit,n, A, lda, b, strideX);
49 CBLAS_ORDER order, CBLAS_UPLO uplo,
50 CBLAS_TRANSPOSE transA, CBLAS_DIAG unit,
52 double const *A,
int lda,
double *b,
int strideX
54 cblas_dtrsv(order, uplo, transA, unit,n, A, lda, b, strideX);
58 CBLAS_ORDER order, CBLAS_UPLO uplo,
59 CBLAS_TRANSPOSE transA, CBLAS_DIAG unit,
61 std::complex<float>
const *A,
int lda, std::complex<float> *b,
int strideX
63 cblas_ctrsv(order, uplo, transA, unit,n,
64 reinterpret_cast<cblas_float_complex_type const *>(A), lda,
65 reinterpret_cast<cblas_float_complex_type *>(b), strideX);
68 CBLAS_ORDER order, CBLAS_UPLO uplo,
69 CBLAS_TRANSPOSE transA, CBLAS_DIAG unit,
71 std::complex<double>
const *A,
int lda, std::complex<double> *b,
int strideX
73 cblas_ztrsv(order, uplo, transA, unit,n,
74 reinterpret_cast<cblas_double_complex_type const *>(A), lda,
75 reinterpret_cast<cblas_double_complex_type *>(b), strideX);
80 template <
bool Upper,
bool Unit,
typename TriangularA,
typename V>
82 matrix_expression<TriangularA>
const &A,
83 vector_expression<V> &b,
88 CBLAS_DIAG cblasUnit = Unit?CblasUnit:CblasNonUnit;
89 CBLAS_ORDER
const storOrd= (CBLAS_ORDER)storage_order<typename TriangularA::orientation>::value;
90 CBLAS_UPLO uplo = Upper?CblasUpper:CblasLower;
93 int const n = A().size1();
95 trsv(storOrd, uplo, CblasNoTrans,cblasUnit, n,
97 traits::leading_dimension(A),
103 template<
class Storage1,
class Storage2,
class T1,
class T2>
104 struct optimized_trsv_detail{
105 typedef boost::mpl::false_ type;
108 struct optimized_trsv_detail<
109 dense_tag, dense_tag,
112 typedef boost::mpl::true_ type;
115 struct optimized_trsv_detail<
116 dense_tag, dense_tag,
119 typedef boost::mpl::true_ type;
123 struct optimized_trsv_detail<
124 dense_tag, dense_tag,
125 std::complex<double>, std::complex<double>
127 typedef boost::mpl::true_ type;
130 struct optimized_trsv_detail<
131 dense_tag, dense_tag,
132 std::complex<float>, std::complex<float>
134 typedef boost::mpl::true_ type;
137 template<
class M,
class V>
138 struct has_optimized_trsv
139 :
public optimized_trsv_detail<
140 typename M::storage_category,
141 typename V::storage_category,
142 typename M::value_type,
143 typename V::value_type