16 typedef void (*functype)(
DenseIndex,
DenseIndex,
DenseIndex,
const Scalar *,
DenseIndex,
const Scalar *,
DenseIndex, Scalar *,
DenseIndex,
DenseIndex,
Scalar, internal::level3_blocking<Scalar,Scalar>&,
Eigen::internal::GemmParallelInfo<DenseIndex>*);
17 static const functype
func[12] = {
41 const Scalar*
a =
reinterpret_cast<const Scalar*
>(pa);
42 const Scalar*
b =
reinterpret_cast<const Scalar*
>(pb);
43 Scalar*
c =
reinterpret_cast<Scalar*
>(
pc);
44 Scalar
alpha = *
reinterpret_cast<const Scalar*
>(
palpha);
45 Scalar beta = *
reinterpret_cast<const Scalar*
>(pbeta);
50 else if(*
m<0) info = 3;
51 else if(*
n<0) info = 4;
52 else if(*k<0) info = 5;
59 if (*
m == 0 || *n == 0)
65 else matrix(c, *
m, *n, *ldc) *= beta;
71 internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic> blocking(*
m,*n,*k,1,
true);
73 int code =
OP(*opa) | (
OP(*opb) << 2);
74 func[
code](*
m, *
n, *k,
a, *
lda,
b, *ldb,
c, 1, *ldc,
alpha, blocking, 0);
83 static const functype
func[32] = {
142 const Scalar*
a =
reinterpret_cast<const Scalar*
>(pa);
143 Scalar*
b =
reinterpret_cast<Scalar*
>(pb);
144 Scalar
alpha = *
reinterpret_cast<const Scalar*
>(
palpha);
151 else if(*
m<0) info = 5;
152 else if(*
n<0) info = 6;
165 internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic,4> blocking(*
m,*n,*
m,1,
false);
170 internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic,4> blocking(*
m,*n,*n,1,
false);
187 typedef void (*functype)(
DenseIndex,
DenseIndex,
DenseIndex,
const Scalar *,
DenseIndex,
const Scalar *,
DenseIndex, Scalar *,
DenseIndex,
DenseIndex,
const Scalar&, internal::level3_blocking<Scalar,Scalar>&);
188 static const functype
func[32] = {
190 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0, true, ColMajor,false,ColMajor,false,ColMajor,1>::run),
192 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0, true, RowMajor,false,ColMajor,false,ColMajor,1>::run),
194 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0, true, RowMajor,Conj, ColMajor,false,ColMajor,1>::run),
197 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0, false,ColMajor,false,ColMajor,false,ColMajor,1>::run),
199 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0, false,ColMajor,false,RowMajor,false,ColMajor,1>::run),
201 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0, false,ColMajor,false,RowMajor,Conj, ColMajor,1>::run),
204 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0, true, ColMajor,false,ColMajor,false,ColMajor,1>::run),
206 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0, true, RowMajor,false,ColMajor,false,ColMajor,1>::run),
208 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0, true, RowMajor,Conj, ColMajor,false,ColMajor,1>::run),
211 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|0, false,ColMajor,false,ColMajor,false,ColMajor,1>::run),
213 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0, false,ColMajor,false,RowMajor,false,ColMajor,1>::run),
215 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|0, false,ColMajor,false,RowMajor,Conj, ColMajor,1>::run),
218 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,true, ColMajor,false,ColMajor,false,ColMajor,1>::run),
220 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,true, RowMajor,false,ColMajor,false,ColMajor,1>::run),
222 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,true, RowMajor,Conj, ColMajor,false,ColMajor,1>::run),
225 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,false,ColMajor,false,ColMajor,false,ColMajor,1>::run),
227 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,false,ColMajor,false,RowMajor,false,ColMajor,1>::run),
229 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,false,ColMajor,false,RowMajor,Conj, ColMajor,1>::run),
232 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,true, ColMajor,false,ColMajor,false,ColMajor,1>::run),
234 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,true, RowMajor,false,ColMajor,false,ColMajor,1>::run),
236 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,true, RowMajor,Conj, ColMajor,false,ColMajor,1>::run),
239 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Lower|UnitDiag,false,ColMajor,false,ColMajor,false,ColMajor,1>::run),
241 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,false,ColMajor,false,RowMajor,false,ColMajor,1>::run),
243 (
internal::product_triangular_matrix_matrix<Scalar,DenseIndex,Upper|UnitDiag,false,ColMajor,false,RowMajor,Conj, ColMajor,1>::run),
247 const Scalar*
a =
reinterpret_cast<const Scalar*
>(pa);
248 Scalar*
b =
reinterpret_cast<Scalar*
>(pb);
249 Scalar
alpha = *
reinterpret_cast<const Scalar*
>(
palpha);
256 else if(*
m<0) info = 5;
257 else if(*
n<0) info = 6;
270 matrix(b,*
m,*n,*ldb).setZero();
274 internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic,4> blocking(*
m,*n,*
m,1,
false);
275 func[
code](*
m, *
n, *
m,
a, *
lda, tmp.
data(), tmp.
outerStride(),
b, 1, *ldb,
alpha, blocking);
279 internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic,4> blocking(*
m,*n,*n,1,
false);
280 func[
code](*
m, *
n, *
n, tmp.
data(), tmp.
outerStride(),
a, *
lda,
b, 1, *ldb,
alpha, blocking);
300 else if(*
m<0) info = 3;
301 else if(*
n<0) info = 4;
311 else matrix(c, *
m, *n, *ldc) *= beta;
326 matA.triangularView<
Lower>() =
matrix(a,size,size,*
lda).transpose();
331 matA.triangularView<
Upper>() =
matrix(a,size,size,*
lda).transpose();
334 matrix(c, *
m, *n, *ldc) += alpha * matA *
matrix(b, *
m, *n, *ldb);
338 internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic> blocking(*
m,*n,size,1,
false);
341 if(
UPLO(*uplo)==
UP)
internal::product_selfadjoint_matrix<Scalar, DenseIndex, RowMajor,true,false, ColMajor,false,false, ColMajor,1>::run(*
m, *n, a, *
lda, b, *ldb, c, 1, *ldc, alpha, blocking);
342 else if(
UPLO(*uplo)==
LO)
internal::product_selfadjoint_matrix<Scalar, DenseIndex, ColMajor,true,false, ColMajor,false,false, ColMajor,1>::run(*
m, *n, a, *
lda, b, *ldb, c, 1, *ldc, alpha, blocking);
345 if(
UPLO(*uplo)==
UP)
internal::product_selfadjoint_matrix<Scalar, DenseIndex, ColMajor,false,false, RowMajor,true,false, ColMajor,1>::run(*
m, *n, b, *ldb, a, *
lda, c, 1, *ldc, alpha, blocking);
346 else if(
UPLO(*uplo)==
LO)
internal::product_selfadjoint_matrix<Scalar, DenseIndex, ColMajor,false,false, ColMajor,true,false, ColMajor,1>::run(*
m, *n, b, *ldb, a, *
lda, c, 1, *ldc, alpha, blocking);
362 typedef void (*functype)(
DenseIndex,
DenseIndex,
const Scalar *,
DenseIndex,
const Scalar *,
DenseIndex, Scalar *,
DenseIndex,
DenseIndex,
const Scalar&, internal::level3_blocking<Scalar,Scalar>&);
363 static const functype
func[8] = {
365 (
internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,ColMajor,Conj, 1, Upper>::run),
367 (
internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,false,Scalar,ColMajor,ColMajor,Conj, 1, Upper>::run),
369 (
internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,ColMajor,false,1, Upper>::run),
372 (
internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,ColMajor,Conj, 1, Lower>::run),
374 (
internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,false,Scalar,ColMajor,ColMajor,Conj, 1, Lower>::run),
376 (
internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,ColMajor,false,1, Lower>::run),
381 const Scalar*
a =
reinterpret_cast<const Scalar*
>(pa);
382 Scalar*
c =
reinterpret_cast<Scalar*
>(
pc);
383 Scalar
alpha = *
reinterpret_cast<const Scalar*
>(
palpha);
384 Scalar beta = *
reinterpret_cast<const Scalar*
>(pbeta);
389 else if(*
n<0) info = 3;
390 else if(*k<0) info = 4;
400 else matrix(c, *
n, *
n, *ldc).triangularView<
Upper>() *= beta;
403 else matrix(c, *
n, *
n, *ldc).triangularView<
Lower>() *= beta;
426 internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic> blocking(*
n,*
n,*k,1,
false);
429 func[
code](*
n, *k,
a, *
lda,
a, *
lda,
c, 1, *ldc,
alpha, blocking);
451 else if(*
n<0) info = 3;
452 else if(*k<0) info = 4;
463 else matrix(c, *
n, *
n, *ldc).triangularView<
Upper>() *= beta;
466 else matrix(c, *
n, *
n, *ldc).triangularView<
Lower>() *= beta;
519 else if(*
m<0) info = 3;
520 else if(*
n<0) info = 4;
536 internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic> blocking(*
m,*n,size,1,
false);
541 ::run(*
m, *n, a, *
lda, b, *ldb, c, 1, *ldc, alpha, blocking);
543 ::run(*
m, *n, a, *
lda, b, *ldb, c, 1, *ldc, alpha, blocking);
550 else if(
UPLO(*uplo)==
LO) internal::product_selfadjoint_matrix<Scalar,DenseIndex,ColMajor,false,false, ColMajor,true,false, ColMajor,1>
551 ::
run(*
m, *n, b, *ldb, a, *
lda, c, 1, *ldc, alpha, blocking);
564 int EIGEN_BLAS_FUNC(herk)(
const char *uplo,
const char *op,
const int *
n,
const int *k,
569 typedef void (*functype)(
DenseIndex,
DenseIndex,
const Scalar *,
DenseIndex,
const Scalar *,
DenseIndex, Scalar *,
DenseIndex,
DenseIndex,
const Scalar&, internal::level3_blocking<Scalar,Scalar>&);
570 static const functype
func[8] = {
572 (
internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,Conj, ColMajor,1,Upper>::run),
575 (
internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,false,ColMajor,1,Upper>::run),
578 (
internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,ColMajor,false,Scalar,RowMajor,Conj, ColMajor,1,Lower>::run),
581 (
internal::general_matrix_matrix_triangular_product<DenseIndex,Scalar,RowMajor,Conj, Scalar,ColMajor,false,ColMajor,1,Lower>::run),
585 const Scalar*
a =
reinterpret_cast<const Scalar*
>(pa);
586 Scalar*
c =
reinterpret_cast<Scalar*
>(
pc);
595 else if(*
n<0) info = 3;
596 else if(*k<0) info = 4;
615 matrix(c, *
n, *
n, *ldc).diagonal().real() *= beta;
616 matrix(c, *
n, *
n, *ldc).diagonal().imag().setZero();
622 internal::gemm_blocking_space<ColMajor,Scalar,Scalar,Dynamic,Dynamic,Dynamic> blocking(*
n,*
n,*k,1,
false);
623 func[
code](*
n, *k,
a, *
lda,
a, *
lda,
c, 1, *ldc,
alpha, blocking);
624 matrix(c, *n, *n, *ldc).diagonal().imag().setZero();
631 int EIGEN_BLAS_FUNC(her2k)(
const char *uplo,
const char *op,
const int *
n,
const int *k,
645 else if(*
n<0) info = 3;
646 else if(*k<0) info = 4;
664 matrix(c, *
n, *
n, *ldc).diagonal().real() *= beta;
665 matrix(c, *
n, *
n, *ldc).diagonal().imag().setZero();
668 else if(*k>0 && alpha!=
Scalar(0))
669 matrix(c, *
n, *
n, *ldc).diagonal().imag().setZero();
687 else if(
OP(*op)==
ADJ)
Matrix diag(const std::vector< Matrix > &Hs)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
int RealScalar int RealScalar int RealScalar * pc
int EIGEN_BLAS_FUNC() trmm(const char *side, const char *uplo, const char *opa, const char *diag, const int *m, const int *n, const RealScalar *palpha, const RealScalar *pa, const int *lda, RealScalar *pb, const int *ldb)
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT
int EIGEN_BLAS_FUNC() gemm(const char *opa, const char *opb, const int *m, const int *n, const int *k, const RealScalar *palpha, const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb, const RealScalar *pbeta, RealScalar *pc, const int *ldc)
#define EIGEN_BLAS_FUNC(X)
AnnoyingScalar conj(const AnnoyingScalar &x)
EIGEN_WEAK_LINKING int xerbla_(const char *msg, int *info, int)
NumTraits< Scalar >::Real RealScalar
int EIGEN_BLAS_FUNC() trsm(const char *side, const char *uplo, const char *opa, const char *diag, const int *m, const int *n, const RealScalar *palpha, const RealScalar *pa, const int *lda, RealScalar *pb, const int *ldb)
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
The matrix class, also used for vectors and row-vectors.
int EIGEN_BLAS_FUNC() symm(const char *side, const char *uplo, const int *m, const int *n, const RealScalar *palpha, const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb, const RealScalar *pbeta, RealScalar *pc, const int *ldc)
int EIGEN_BLAS_FUNC() syrk(const char *uplo, const char *op, const int *n, const int *k, const RealScalar *palpha, const RealScalar *pa, const int *lda, const RealScalar *pbeta, RealScalar *pc, const int *ldc)
int EIGEN_BLAS_FUNC() syr2k(const char *uplo, const char *op, const int *n, const int *k, const RealScalar *palpha, const RealScalar *pa, const int *lda, const RealScalar *pb, const int *ldb, const RealScalar *pbeta, RealScalar *pc, const int *ldc)