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;
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;
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);
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;
325 make_vector(actual_y+start,len) += (
alpha*actual_x[
j]) * mat_coeffs.col(
j).segment(offset,len);
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;
407 if(code>=16 || func[code]==0)
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;
478 if(code>=16 || func[code]==0)
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;
548 func[
code](*
n, ap, actual_x);
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)
Matrix diag(const std::vector< Matrix > &Hs)
A matrix or vector expression mapping an existing array of data.
int RealScalar int RealScalar int RealScalar * pc
RealScalar RealScalar int * incx
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
T * copy_back(T *x_cpy, T *x, int n, int incx)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate offset
#define EIGEN_BLAS_FUNC(X)
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
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)
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)
T * get_compact_vector(T *x, int n, int incx)
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)
NumTraits< Scalar >::Real RealScalar
Map< Matrix< T, Dynamic, 1 >, 0, InnerStride< Dynamic > > make_vector(T *data, int size, int incr)
void run(Expr &expr, Dev &dev)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
void swap(mpfr::mpreal &x, mpfr::mpreal &y)
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)