12 template<
typename Index,
typename Scalar,
int StorageOrder,
bool ConjugateLhs,
bool ConjugateRhs>
17 typedef internal::const_blas_data_mapper<Scalar,Index,StorageOrder> LhsMapper;
18 typedef internal::const_blas_data_mapper<Scalar,Index,RowMajor> RhsMapper;
20 internal::general_matrix_vector_product
22 rows, cols, LhsMapper(lhs, lhsStride), RhsMapper(rhs, rhsIncr), res, resIncr, alpha);
30 static const functype func[4] = {
40 const Scalar*
a =
reinterpret_cast<const Scalar*
>(pa);
41 const Scalar*
b =
reinterpret_cast<const Scalar*
>(pb);
42 Scalar*
c =
reinterpret_cast<Scalar*
>(
pc);
43 Scalar
alpha = *
reinterpret_cast<const Scalar*
>(
palpha);
44 Scalar beta = *
reinterpret_cast<const Scalar*
>(pbeta);
49 else if(*m<0) info = 2;
50 else if(*
n<0) info = 3;
52 else if(*incb==0) info = 8;
53 else if(*incc==0) info = 11;
75 if(code>=4 || func[code]==0)
78 func[code](actual_m, actual_n,
a, *
lda, actual_b, 1, actual_c, 1,
alpha);
80 if(actual_b!=b)
delete[] actual_b;
81 if(actual_c!=c)
delete[]
copy_back(actual_c,c,actual_m,*incc);
88 typedef void (*functype)(
int,
const Scalar *,
int, Scalar *);
89 static const functype func[16] = {
120 const Scalar*
a =
reinterpret_cast<const Scalar*
>(pa);
121 Scalar*
b =
reinterpret_cast<Scalar*
>(pb);
127 else if(*
n<0) info = 4;
129 else if(*incb==0) info = 8;
135 int code =
OP(*opa) | (
UPLO(*uplo) << 2) | (
DIAG(*diag) << 3);
136 func[code](*
n,
a, *
lda, actual_b);
138 if(actual_b!=b)
delete[]
copy_back(actual_b,b,*n,*incb);
147 typedef void (*functype)(
int,
int,
const Scalar *,
int,
const Scalar *,
int, Scalar *,
int,
const Scalar&);
148 static const functype func[16] = {
179 const Scalar*
a =
reinterpret_cast<const Scalar*
>(pa);
180 Scalar*
b =
reinterpret_cast<Scalar*
>(pb);
186 else if(*
n<0) info = 4;
188 else if(*incb==0) info = 8;
199 int code =
OP(*opa) | (
UPLO(*uplo) << 2) | (
DIAG(*diag) << 3);
200 if(code>=16 || func[code]==0)
206 if(actual_b!=b)
delete[] actual_b;
226 int coeff_rows = *kl+*ku+1;
230 else if(*m<0) info = 2;
231 else if(*
n<0) info = 3;
232 else if(*kl<0) info = 4;
233 else if(*ku<0) info = 5;
234 else if(*
lda<coeff_rows) info = 8;
235 else if(*
incx==0) info = 10;
236 else if(*
incy==0) info = 13;
260 for(
int j=0; j<nb; ++j)
264 int len = end - start + 1;
265 int offset = (*ku) - j + start;
267 make_vector(actual_y+start,len) += (alpha*actual_x[j]) * mat_coeffs.col(j).segment(offset,len);
268 else if(
OP(*trans)==
TR)
269 actual_y[j] += alpha * ( mat_coeffs.col(j).segment(offset,len).transpose() *
make_vector(actual_x+start,len) ).value();
271 actual_y[j] += alpha * ( mat_coeffs.col(j).segment(offset,len).adjoint() *
make_vector(actual_x+start,len) ).value();
274 if(actual_x!=x)
delete[] actual_x;
275 if(actual_y!=y)
delete[]
copy_back(actual_y,y,actual_m,*
incy);
292 int coeff_rows = *k + 1;
298 else if(*
n<0) info = 4;
299 else if(*k<0) info = 5;
300 else if(*
lda<coeff_rows) info = 7;
301 else if(*
incx==0) info = 9;
314 int ku =
UPLO(*uplo)==UPPER ? *k : 0;
315 int kl =
UPLO(*uplo)==LOWER ? *k : 0;
317 for(
int j=0; j<*
n; ++j)
321 int len = end - start + 1;
322 int offset = (ku) - j + start;
325 make_vector(actual_y+start,len) += (
alpha*actual_x[j]) * mat_coeffs.col(j).segment(offset,len);
326 else if(
OP(*trans)==
TR)
327 actual_y[j] +=
alpha * ( mat_coeffs.col(j).segment(offset,len).transpose() *
make_vector(actual_x+start,len) ).value();
329 actual_y[j] +=
alpha * ( mat_coeffs.col(j).segment(offset,len).adjoint() *
make_vector(actual_x+start,len) ).value();
332 if(actual_x!=x)
delete[] actual_x;
353 static const functype func[16] = {
384 Scalar*
a =
reinterpret_cast<Scalar*
>(pa);
385 Scalar*
x =
reinterpret_cast<Scalar*
>(
px);
386 int coeff_rows = *k+1;
392 else if(*
n<0) info = 4;
393 else if(*k<0) info = 5;
394 else if(*
lda<coeff_rows) info = 7;
395 else if(*
incx==0) info = 9;
399 if(*
n==0 || (*k==0 &&
DIAG(*diag)==
UNIT))
406 int code =
OP(*op) | (
UPLO(*uplo) << 2) | (
DIAG(*diag) << 3);
407 if(code>=16 || func[code]==0)
410 func[code](*
n, *k,
a, *
lda, actual_x);
412 if(actual_x!=x)
delete[]
copy_back(actual_x,x,actual_n,*
incx);
426 typedef void (*functype)(
int,
const Scalar*,
const Scalar*, Scalar*,
Scalar);
427 static const functype func[16] = {
458 Scalar* ap =
reinterpret_cast<Scalar*
>(pap);
459 Scalar*
x =
reinterpret_cast<Scalar*
>(
px);
465 else if(*
n<0) info = 4;
466 else if(*
incx==0) info = 7;
477 int code =
OP(*opa) | (
UPLO(*uplo) << 2) | (
DIAG(*diag) << 3);
478 if(code>=16 || func[code]==0)
481 func[code](*
n, ap, actual_x, res.
data(),
Scalar(1));
484 if(actual_x!=x)
delete[] actual_x;
501 typedef void (*functype)(
int,
const Scalar*, Scalar*);
502 static const functype func[16] = {
533 Scalar* ap =
reinterpret_cast<Scalar*
>(pap);
534 Scalar*
x =
reinterpret_cast<Scalar*
>(
px);
540 else if(*
n<0) info = 4;
541 else if(*
incx==0) info = 7;
547 int code =
OP(*opa) | (
UPLO(*uplo) << 2) | (
DIAG(*diag) << 3);
548 func[code](*
n, ap, actual_x);
T * get_compact_vector(T *x, int n, int incx)
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
int EIGEN_BLAS_FUNC() gbmv(char *trans, int *m, int *n, int *kl, int *ku, RealScalar *palpha, RealScalar *pa, int *lda, RealScalar *px, int *incx, RealScalar *pbeta, RealScalar *py, int *incy)
int EIGEN_BLAS_FUNC() tpsv(char *uplo, char *opa, char *diag, int *n, RealScalar *pap, RealScalar *px, int *incx)
T * copy_back(T *x_cpy, T *x, int n, int incx)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
A matrix or vector expression mapping an existing array of data.
int RealScalar int RealScalar int RealScalar * pc
RealScalar RealScalar int * incx
int EIGEN_BLAS_FUNC() trmv(const char *uplo, const char *opa, const char *diag, const int *n, const RealScalar *pa, const int *lda, RealScalar *pb, const int *incb)
NumTraits< Scalar >::Real RealScalar
int EIGEN_BLAS_FUNC() swap(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
int EIGEN_BLAS_FUNC() trsv(const char *uplo, const char *opa, const char *diag, const int *n, const RealScalar *pa, const int *lda, RealScalar *pb, const int *incb)
int RealScalar int RealScalar * py
int EIGEN_BLAS_FUNC() gemv(const char *opa, const int *m, const int *n, const RealScalar *palpha, const RealScalar *pa, const int *lda, const RealScalar *pb, const int *incb, const RealScalar *pbeta, RealScalar *pc, const int *incc)
EIGEN_WEAK_LINKING int xerbla_(const char *msg, int *info, int)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
RealScalar RealScalar * px
int EIGEN_BLAS_FUNC() tbsv(char *uplo, char *op, char *diag, int *n, int *k, RealScalar *pa, int *lda, RealScalar *px, int *incx)
Map< Matrix< T, Dynamic, 1 >, 0, InnerStride< Dynamic > > make_vector(T *data, int size, int incr)
#define EIGEN_BLAS_FUNC(X)
void run(Expr &expr, Dev &dev)
int RealScalar int RealScalar int * incy
int EIGEN_BLAS_FUNC() tpmv(char *uplo, char *opa, char *diag, int *n, RealScalar *pap, RealScalar *px, int *incx)
static void run(Index rows, Index cols, const Scalar *lhs, Index lhsStride, const Scalar *rhs, Index rhsIncr, Scalar *res, Index resIncr, Scalar alpha)