Skip to content
GitLab
Explore
Sign in
Hide whitespace changes
Inline
Side-by-side
Some changes are not shown.
For a faster browsing experience, only
2 of 182+
files are shown. Download one of the files below to see all changes.
external/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix_
MKL
.h
→
external/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix_
BLAS
.h
View file @
a394b22a
...
@@ -25,13 +25,13 @@
...
@@ -25,13 +25,13 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//
********************************************************************************
********************************************************************************
* Content : Eigen bindings to
Intel(R) MKL
* Content : Eigen bindings to
BLAS F77
* Self adjoint matrix * matrix product functionality based on ?SYMM/?HEMM.
* Self adjoint matrix * matrix product functionality based on ?SYMM/?HEMM.
********************************************************************************
********************************************************************************
*/
*/
#ifndef EIGEN_SELFADJOINT_MATRIX_MATRIX_
MKL
_H
#ifndef EIGEN_SELFADJOINT_MATRIX_MATRIX_
BLAS
_H
#define EIGEN_SELFADJOINT_MATRIX_MATRIX_
MKL
_H
#define EIGEN_SELFADJOINT_MATRIX_MATRIX_
BLAS
_H
namespace
Eigen
{
namespace
Eigen
{
...
@@ -40,7 +40,7 @@ namespace internal {
...
@@ -40,7 +40,7 @@ namespace internal {
/* Optimized selfadjoint matrix * matrix (?SYMM/?HEMM) product */
/* Optimized selfadjoint matrix * matrix (?SYMM/?HEMM) product */
#define EIGEN_
MKL
_SYMM_L(EIGTYPE,
MKL
TYPE, EIGPREFIX,
MKL
PREFIX) \
#define EIGEN_
BLAS
_SYMM_L(EIGTYPE,
BLAS
TYPE, EIGPREFIX,
BLAS
PREFIX) \
template <typename Index, \
template <typename Index, \
int LhsStorageOrder, bool ConjugateLhs, \
int LhsStorageOrder, bool ConjugateLhs, \
int RhsStorageOrder, bool ConjugateRhs> \
int RhsStorageOrder, bool ConjugateRhs> \
...
@@ -52,28 +52,23 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,true,ConjugateLh
...
@@ -52,28 +52,23 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,true,ConjugateLh
const EIGTYPE* _lhs, Index lhsStride, \
const EIGTYPE* _lhs, Index lhsStride, \
const EIGTYPE* _rhs, Index rhsStride, \
const EIGTYPE* _rhs, Index rhsStride, \
EIGTYPE* res, Index resStride, \
EIGTYPE* res, Index resStride, \
EIGTYPE alpha) \
EIGTYPE alpha
, level3_blocking<EIGTYPE, EIGTYPE>&
/*blocking*/
) \
{ \
{ \
char side='L', uplo='L'; \
char side='L', uplo='L'; \
MKL_INT
m, n, lda, ldb, ldc; \
BlasIndex
m, n, lda, ldb, ldc; \
const EIGTYPE *a, *b; \
const EIGTYPE *a, *b; \
MKL
TYPE
alpha_,
beta
_
; \
EIG
TYPE beta
(1)
; \
MatrixX##EIGPREFIX b_tmp; \
MatrixX##EIGPREFIX b_tmp; \
EIGTYPE myone(1);\
\
\
/* Set transpose options */
\
/* Set transpose options */
\
/* Set m, n, k */
\
/* Set m, n, k */
\
m = (MKL_INT)rows; \
m = convert_index<BlasIndex>(rows); \
n = (MKL_INT)cols; \
n = convert_index<BlasIndex>(cols); \
\
/* Set alpha_ & beta_ */
\
assign_scalar_eig2mkl(alpha_, alpha); \
assign_scalar_eig2mkl(beta_, myone); \
\
\
/* Set lda, ldb, ldc */
\
/* Set lda, ldb, ldc */
\
lda =
(MKL_INT)
lhsStride; \
lda =
convert_index<BlasIndex>(
lhsStride
)
; \
ldb =
(MKL_INT)
rhsStride; \
ldb =
convert_index<BlasIndex>(
rhsStride
)
; \
ldc =
(MKL_INT)
resStride; \
ldc =
convert_index<BlasIndex>(
resStride
)
; \
\
\
/* Set a, b, c */
\
/* Set a, b, c */
\
if (LhsStorageOrder==RowMajor) uplo='U'; \
if (LhsStorageOrder==RowMajor) uplo='U'; \
...
@@ -83,16 +78,16 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,true,ConjugateLh
...
@@ -83,16 +78,16 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,true,ConjugateLh
Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > rhs(_rhs,n,m,OuterStride<>(rhsStride)); \
Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > rhs(_rhs,n,m,OuterStride<>(rhsStride)); \
b_tmp = rhs.adjoint(); \
b_tmp = rhs.adjoint(); \
b = b_tmp.data(); \
b = b_tmp.data(); \
ldb = b_tmp.outerStride(); \
ldb =
convert_index<BlasIndex>(
b_tmp.outerStride()
)
; \
} else b = _rhs; \
} else b = _rhs; \
\
\
MKL
PREFIX##symm(&side, &uplo, &m, &n, &alpha
_
, (const
MKL
TYPE*)a, &lda, (const
MKL
TYPE*)b, &ldb, &beta
_
, (
MKL
TYPE*)res, &ldc); \
BLAS
PREFIX##symm
_
(&side, &uplo, &m, &n, &
numext::real_ref(
alpha
)
, (const
BLAS
TYPE*)a, &lda, (const
BLAS
TYPE*)b, &ldb, &
numext::real_ref(
beta
)
, (
BLAS
TYPE*)res, &ldc); \
\
\
} \
} \
};
};
#define EIGEN_
MKL
_HEMM_L(EIGTYPE,
MKL
TYPE, EIGPREFIX,
MKL
PREFIX) \
#define EIGEN_
BLAS
_HEMM_L(EIGTYPE,
BLAS
TYPE, EIGPREFIX,
BLAS
PREFIX) \
template <typename Index, \
template <typename Index, \
int LhsStorageOrder, bool ConjugateLhs, \
int LhsStorageOrder, bool ConjugateLhs, \
int RhsStorageOrder, bool ConjugateRhs> \
int RhsStorageOrder, bool ConjugateRhs> \
...
@@ -103,36 +98,31 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,true,ConjugateLh
...
@@ -103,36 +98,31 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,true,ConjugateLh
const EIGTYPE* _lhs, Index lhsStride, \
const EIGTYPE* _lhs, Index lhsStride, \
const EIGTYPE* _rhs, Index rhsStride, \
const EIGTYPE* _rhs, Index rhsStride, \
EIGTYPE* res, Index resStride, \
EIGTYPE* res, Index resStride, \
EIGTYPE alpha) \
EIGTYPE alpha
, level3_blocking<EIGTYPE, EIGTYPE>&
/*blocking*/
) \
{ \
{ \
char side='L', uplo='L'; \
char side='L', uplo='L'; \
MKL_INT
m, n, lda, ldb, ldc; \
BlasIndex
m, n, lda, ldb, ldc; \
const EIGTYPE *a, *b; \
const EIGTYPE *a, *b; \
MKL
TYPE
alpha_,
beta
_
; \
EIG
TYPE beta
(1)
; \
MatrixX##EIGPREFIX b_tmp; \
MatrixX##EIGPREFIX b_tmp; \
Matrix<EIGTYPE, Dynamic, Dynamic, LhsStorageOrder> a_tmp; \
Matrix<EIGTYPE, Dynamic, Dynamic, LhsStorageOrder> a_tmp; \
EIGTYPE myone(1); \
\
\
/* Set transpose options */
\
/* Set transpose options */
\
/* Set m, n, k */
\
/* Set m, n, k */
\
m = (MKL_INT)rows; \
m = convert_index<BlasIndex>(rows); \
n = (MKL_INT)cols; \
n = convert_index<BlasIndex>(cols); \
\
/* Set alpha_ & beta_ */
\
assign_scalar_eig2mkl(alpha_, alpha); \
assign_scalar_eig2mkl(beta_, myone); \
\
\
/* Set lda, ldb, ldc */
\
/* Set lda, ldb, ldc */
\
lda =
(MKL_INT)
lhsStride; \
lda =
convert_index<BlasIndex>(
lhsStride
)
; \
ldb =
(MKL_INT)
rhsStride; \
ldb =
convert_index<BlasIndex>(
rhsStride
)
; \
ldc =
(MKL_INT)
resStride; \
ldc =
convert_index<BlasIndex>(
resStride
)
; \
\
\
/* Set a, b, c */
\
/* Set a, b, c */
\
if (((LhsStorageOrder==ColMajor) && ConjugateLhs) || ((LhsStorageOrder==RowMajor) && (!ConjugateLhs))) { \
if (((LhsStorageOrder==ColMajor) && ConjugateLhs) || ((LhsStorageOrder==RowMajor) && (!ConjugateLhs))) { \
Map<const Matrix<EIGTYPE, Dynamic, Dynamic, LhsStorageOrder>, 0, OuterStride<> > lhs(_lhs,m,m,OuterStride<>(lhsStride)); \
Map<const Matrix<EIGTYPE, Dynamic, Dynamic, LhsStorageOrder>, 0, OuterStride<> > lhs(_lhs,m,m,OuterStride<>(lhsStride)); \
a_tmp = lhs.conjugate(); \
a_tmp = lhs.conjugate(); \
a = a_tmp.data(); \
a = a_tmp.data(); \
lda = a_tmp.outerStride(); \
lda =
convert_index<BlasIndex>(
a_tmp.outerStride()
)
; \
} else a = _lhs; \
} else a = _lhs; \
if (LhsStorageOrder==RowMajor) uplo='U'; \
if (LhsStorageOrder==RowMajor) uplo='U'; \
\
\
...
@@ -151,23 +141,23 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,true,ConjugateLh
...
@@ -151,23 +141,23 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,true,ConjugateLh
b_tmp = rhs.transpose(); \
b_tmp = rhs.transpose(); \
} \
} \
b = b_tmp.data(); \
b = b_tmp.data(); \
ldb = b_tmp.outerStride(); \
ldb =
convert_index<BlasIndex>(
b_tmp.outerStride()
)
; \
} \
} \
\
\
MKL
PREFIX##hemm(&side, &uplo, &m, &n, &alpha
_
, (const
MKL
TYPE*)a, &lda, (const
MKL
TYPE*)b, &ldb, &beta
_
, (
MKL
TYPE*)res, &ldc); \
BLAS
PREFIX##hemm
_
(&side, &uplo, &m, &n, &
numext::real_ref(
alpha
)
, (const
BLAS
TYPE*)a, &lda, (const
BLAS
TYPE*)b, &ldb, &
numext::real_ref(
beta
)
, (
BLAS
TYPE*)res, &ldc); \
\
\
} \
} \
};
};
EIGEN_
MKL
_SYMM_L
(
double
,
double
,
d
,
d
)
EIGEN_
BLAS
_SYMM_L
(
double
,
double
,
d
,
d
)
EIGEN_
MKL
_SYMM_L
(
float
,
float
,
f
,
s
)
EIGEN_
BLAS
_SYMM_L
(
float
,
float
,
f
,
s
)
EIGEN_
MKL
_HEMM_L
(
dcomplex
,
MKL_Complex16
,
cd
,
z
)
EIGEN_
BLAS
_HEMM_L
(
dcomplex
,
double
,
cd
,
z
)
EIGEN_
MKL
_HEMM_L
(
scomplex
,
MKL_Complex8
,
cf
,
c
)
EIGEN_
BLAS
_HEMM_L
(
scomplex
,
float
,
cf
,
c
)
/* Optimized matrix * selfadjoint matrix (?SYMM/?HEMM) product */
/* Optimized matrix * selfadjoint matrix (?SYMM/?HEMM) product */
#define EIGEN_
MKL
_SYMM_R(EIGTYPE,
MKL
TYPE, EIGPREFIX,
MKL
PREFIX) \
#define EIGEN_
BLAS
_SYMM_R(EIGTYPE,
BLAS
TYPE, EIGPREFIX,
BLAS
PREFIX) \
template <typename Index, \
template <typename Index, \
int LhsStorageOrder, bool ConjugateLhs, \
int LhsStorageOrder, bool ConjugateLhs, \
int RhsStorageOrder, bool ConjugateRhs> \
int RhsStorageOrder, bool ConjugateRhs> \
...
@@ -179,27 +169,22 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,false,ConjugateL
...
@@ -179,27 +169,22 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,false,ConjugateL
const EIGTYPE* _lhs, Index lhsStride, \
const EIGTYPE* _lhs, Index lhsStride, \
const EIGTYPE* _rhs, Index rhsStride, \
const EIGTYPE* _rhs, Index rhsStride, \
EIGTYPE* res, Index resStride, \
EIGTYPE* res, Index resStride, \
EIGTYPE alpha) \
EIGTYPE alpha
, level3_blocking<EIGTYPE, EIGTYPE>&
/*blocking*/
) \
{ \
{ \
char side='R', uplo='L'; \
char side='R', uplo='L'; \
MKL_INT
m, n, lda, ldb, ldc; \
BlasIndex
m, n, lda, ldb, ldc; \
const EIGTYPE *a, *b; \
const EIGTYPE *a, *b; \
MKL
TYPE
alpha_,
beta
_
; \
EIG
TYPE beta
(1)
; \
MatrixX##EIGPREFIX b_tmp; \
MatrixX##EIGPREFIX b_tmp; \
EIGTYPE myone(1);\
\
\
/* Set m, n, k */
\
/* Set m, n, k */
\
m = (MKL_INT)rows; \
m = convert_index<BlasIndex>(rows); \
n = (MKL_INT)cols; \
n = convert_index<BlasIndex>(cols); \
\
/* Set alpha_ & beta_ */
\
assign_scalar_eig2mkl(alpha_, alpha); \
assign_scalar_eig2mkl(beta_, myone); \
\
\
/* Set lda, ldb, ldc */
\
/* Set lda, ldb, ldc */
\
lda =
(MKL_INT)
rhsStride; \
lda =
convert_index<BlasIndex>(
rhsStride
)
; \
ldb =
(MKL_INT)
lhsStride; \
ldb =
convert_index<BlasIndex>(
lhsStride
)
; \
ldc =
(MKL_INT)
resStride; \
ldc =
convert_index<BlasIndex>(
resStride
)
; \
\
\
/* Set a, b, c */
\
/* Set a, b, c */
\
if (RhsStorageOrder==RowMajor) uplo='U'; \
if (RhsStorageOrder==RowMajor) uplo='U'; \
...
@@ -209,16 +194,16 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,false,ConjugateL
...
@@ -209,16 +194,16 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,false,ConjugateL
Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > lhs(_lhs,n,m,OuterStride<>(rhsStride)); \
Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > lhs(_lhs,n,m,OuterStride<>(rhsStride)); \
b_tmp = lhs.adjoint(); \
b_tmp = lhs.adjoint(); \
b = b_tmp.data(); \
b = b_tmp.data(); \
ldb = b_tmp.outerStride(); \
ldb =
convert_index<BlasIndex>(
b_tmp.outerStride()
)
; \
} else b = _lhs; \
} else b = _lhs; \
\
\
MKL
PREFIX##symm(&side, &uplo, &m, &n, &alpha
_
, (const
MKL
TYPE*)a, &lda, (const
MKL
TYPE*)b, &ldb, &beta
_
, (
MKL
TYPE*)res, &ldc); \
BLAS
PREFIX##symm
_
(&side, &uplo, &m, &n, &
numext::real_ref(
alpha
)
, (const
BLAS
TYPE*)a, &lda, (const
BLAS
TYPE*)b, &ldb, &
numext::real_ref(
beta
)
, (
BLAS
TYPE*)res, &ldc); \
\
\
} \
} \
};
};
#define EIGEN_
MKL
_HEMM_R(EIGTYPE,
MKL
TYPE, EIGPREFIX,
MKL
PREFIX) \
#define EIGEN_
BLAS
_HEMM_R(EIGTYPE,
BLAS
TYPE, EIGPREFIX,
BLAS
PREFIX) \
template <typename Index, \
template <typename Index, \
int LhsStorageOrder, bool ConjugateLhs, \
int LhsStorageOrder, bool ConjugateLhs, \
int RhsStorageOrder, bool ConjugateRhs> \
int RhsStorageOrder, bool ConjugateRhs> \
...
@@ -229,35 +214,30 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,false,ConjugateL
...
@@ -229,35 +214,30 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,false,ConjugateL
const EIGTYPE* _lhs, Index lhsStride, \
const EIGTYPE* _lhs, Index lhsStride, \
const EIGTYPE* _rhs, Index rhsStride, \
const EIGTYPE* _rhs, Index rhsStride, \
EIGTYPE* res, Index resStride, \
EIGTYPE* res, Index resStride, \
EIGTYPE alpha) \
EIGTYPE alpha
, level3_blocking<EIGTYPE, EIGTYPE>&
/*blocking*/
) \
{ \
{ \
char side='R', uplo='L'; \
char side='R', uplo='L'; \
MKL_INT
m, n, lda, ldb, ldc; \
BlasIndex
m, n, lda, ldb, ldc; \
const EIGTYPE *a, *b; \
const EIGTYPE *a, *b; \
MKL
TYPE
alpha_,
beta
_
; \
EIG
TYPE beta
(1)
; \
MatrixX##EIGPREFIX b_tmp; \
MatrixX##EIGPREFIX b_tmp; \
Matrix<EIGTYPE, Dynamic, Dynamic, RhsStorageOrder> a_tmp; \
Matrix<EIGTYPE, Dynamic, Dynamic, RhsStorageOrder> a_tmp; \
EIGTYPE myone(1); \
\
\
/* Set m, n, k */
\
/* Set m, n, k */
\
m = (MKL_INT)rows; \
m = convert_index<BlasIndex>(rows); \
n = (MKL_INT)cols; \
n = convert_index<BlasIndex>(cols); \
\
/* Set alpha_ & beta_ */
\
assign_scalar_eig2mkl(alpha_, alpha); \
assign_scalar_eig2mkl(beta_, myone); \
\
\
/* Set lda, ldb, ldc */
\
/* Set lda, ldb, ldc */
\
lda =
(MKL_INT)
rhsStride; \
lda =
convert_index<BlasIndex>(
rhsStride
)
; \
ldb =
(MKL_INT)
lhsStride; \
ldb =
convert_index<BlasIndex>(
lhsStride
)
; \
ldc =
(MKL_INT)
resStride; \
ldc =
convert_index<BlasIndex>(
resStride
)
; \
\
\
/* Set a, b, c */
\
/* Set a, b, c */
\
if (((RhsStorageOrder==ColMajor) && ConjugateRhs) || ((RhsStorageOrder==RowMajor) && (!ConjugateRhs))) { \
if (((RhsStorageOrder==ColMajor) && ConjugateRhs) || ((RhsStorageOrder==RowMajor) && (!ConjugateRhs))) { \
Map<const Matrix<EIGTYPE, Dynamic, Dynamic, RhsStorageOrder>, 0, OuterStride<> > rhs(_rhs,n,n,OuterStride<>(rhsStride)); \
Map<const Matrix<EIGTYPE, Dynamic, Dynamic, RhsStorageOrder>, 0, OuterStride<> > rhs(_rhs,n,n,OuterStride<>(rhsStride)); \
a_tmp = rhs.conjugate(); \
a_tmp = rhs.conjugate(); \
a = a_tmp.data(); \
a = a_tmp.data(); \
lda = a_tmp.outerStride(); \
lda =
convert_index<BlasIndex>(
a_tmp.outerStride()
)
; \
} else a = _rhs; \
} else a = _rhs; \
if (RhsStorageOrder==RowMajor) uplo='U'; \
if (RhsStorageOrder==RowMajor) uplo='U'; \
\
\
...
@@ -276,20 +256,20 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,false,ConjugateL
...
@@ -276,20 +256,20 @@ struct product_selfadjoint_matrix<EIGTYPE,Index,LhsStorageOrder,false,ConjugateL
b_tmp = lhs.transpose(); \
b_tmp = lhs.transpose(); \
} \
} \
b = b_tmp.data(); \
b = b_tmp.data(); \
ldb = b_tmp.outerStride(); \
ldb =
convert_index<BlasIndex>(
b_tmp.outerStride()
)
; \
} \
} \
\
\
MKL
PREFIX##hemm(&side, &uplo, &m, &n, &alpha
_
, (const
MKL
TYPE*)a, &lda, (const
MKL
TYPE*)b, &ldb, &beta
_
, (
MKL
TYPE*)res, &ldc); \
BLAS
PREFIX##hemm
_
(&side, &uplo, &m, &n, &
numext::real_ref(
alpha
)
, (const
BLAS
TYPE*)a, &lda, (const
BLAS
TYPE*)b, &ldb, &
numext::real_ref(
beta
)
, (
BLAS
TYPE*)res, &ldc); \
} \
} \
};
};
EIGEN_
MKL
_SYMM_R
(
double
,
double
,
d
,
d
)
EIGEN_
BLAS
_SYMM_R
(
double
,
double
,
d
,
d
)
EIGEN_
MKL
_SYMM_R
(
float
,
float
,
f
,
s
)
EIGEN_
BLAS
_SYMM_R
(
float
,
float
,
f
,
s
)
EIGEN_
MKL
_HEMM_R
(
dcomplex
,
MKL_Complex16
,
cd
,
z
)
EIGEN_
BLAS
_HEMM_R
(
dcomplex
,
double
,
cd
,
z
)
EIGEN_
MKL
_HEMM_R
(
scomplex
,
MKL_Complex8
,
cf
,
c
)
EIGEN_
BLAS
_HEMM_R
(
scomplex
,
float
,
cf
,
c
)
}
// end namespace internal
}
// end namespace internal
}
// end namespace Eigen
}
// end namespace Eigen
#endif // EIGEN_SELFADJOINT_MATRIX_MATRIX_
MKL
_H
#endif // EIGEN_SELFADJOINT_MATRIX_MATRIX_
BLAS
_H
external/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector.h
View file @
a394b22a
...
@@ -30,7 +30,7 @@ struct selfadjoint_matrix_vector_product
...
@@ -30,7 +30,7 @@ struct selfadjoint_matrix_vector_product
static
EIGEN_DONT_INLINE
void
run
(
static
EIGEN_DONT_INLINE
void
run
(
Index
size
,
Index
size
,
const
Scalar
*
lhs
,
Index
lhsStride
,
const
Scalar
*
lhs
,
Index
lhsStride
,
const
Scalar
*
_rhs
,
Index
rhsIncr
,
const
Scalar
*
rhs
,
Scalar
*
res
,
Scalar
*
res
,
Scalar
alpha
);
Scalar
alpha
);
};
};
...
@@ -39,11 +39,12 @@ template<typename Scalar, typename Index, int StorageOrder, int UpLo, bool Conju
...
@@ -39,11 +39,12 @@ template<typename Scalar, typename Index, int StorageOrder, int UpLo, bool Conju
EIGEN_DONT_INLINE
void
selfadjoint_matrix_vector_product
<
Scalar
,
Index
,
StorageOrder
,
UpLo
,
ConjugateLhs
,
ConjugateRhs
,
Version
>::
run
(
EIGEN_DONT_INLINE
void
selfadjoint_matrix_vector_product
<
Scalar
,
Index
,
StorageOrder
,
UpLo
,
ConjugateLhs
,
ConjugateRhs
,
Version
>::
run
(
Index
size
,
Index
size
,
const
Scalar
*
lhs
,
Index
lhsStride
,
const
Scalar
*
lhs
,
Index
lhsStride
,
const
Scalar
*
_rhs
,
Index
rhsIncr
,
const
Scalar
*
rhs
,
Scalar
*
res
,
Scalar
*
res
,
Scalar
alpha
)
Scalar
alpha
)
{
{
typedef
typename
packet_traits
<
Scalar
>::
type
Packet
;
typedef
typename
packet_traits
<
Scalar
>::
type
Packet
;
typedef
typename
NumTraits
<
Scalar
>::
Real
RealScalar
;
const
Index
PacketSize
=
sizeof
(
Packet
)
/
sizeof
(
Scalar
);
const
Index
PacketSize
=
sizeof
(
Packet
)
/
sizeof
(
Scalar
);
enum
{
enum
{
...
@@ -54,23 +55,13 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
...
@@ -54,23 +55,13 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
conj_helper
<
Scalar
,
Scalar
,
NumTraits
<
Scalar
>::
IsComplex
&&
EIGEN_LOGICAL_XOR
(
ConjugateLhs
,
IsRowMajor
),
ConjugateRhs
>
cj0
;
conj_helper
<
Scalar
,
Scalar
,
NumTraits
<
Scalar
>::
IsComplex
&&
EIGEN_LOGICAL_XOR
(
ConjugateLhs
,
IsRowMajor
),
ConjugateRhs
>
cj0
;
conj_helper
<
Scalar
,
Scalar
,
NumTraits
<
Scalar
>::
IsComplex
&&
EIGEN_LOGICAL_XOR
(
ConjugateLhs
,
!
IsRowMajor
),
ConjugateRhs
>
cj1
;
conj_helper
<
Scalar
,
Scalar
,
NumTraits
<
Scalar
>::
IsComplex
&&
EIGEN_LOGICAL_XOR
(
ConjugateLhs
,
!
IsRowMajor
),
ConjugateRhs
>
cj1
;
conj_helper
<
Scalar
,
Scalar
,
NumTraits
<
Scalar
>::
IsComplex
,
ConjugateRhs
>
cjd
;
conj_helper
<
Real
Scalar
,
Scalar
,
false
,
ConjugateRhs
>
cjd
;
conj_helper
<
Packet
,
Packet
,
NumTraits
<
Scalar
>::
IsComplex
&&
EIGEN_LOGICAL_XOR
(
ConjugateLhs
,
IsRowMajor
),
ConjugateRhs
>
pcj0
;
conj_helper
<
Packet
,
Packet
,
NumTraits
<
Scalar
>::
IsComplex
&&
EIGEN_LOGICAL_XOR
(
ConjugateLhs
,
IsRowMajor
),
ConjugateRhs
>
pcj0
;
conj_helper
<
Packet
,
Packet
,
NumTraits
<
Scalar
>::
IsComplex
&&
EIGEN_LOGICAL_XOR
(
ConjugateLhs
,
!
IsRowMajor
),
ConjugateRhs
>
pcj1
;
conj_helper
<
Packet
,
Packet
,
NumTraits
<
Scalar
>::
IsComplex
&&
EIGEN_LOGICAL_XOR
(
ConjugateLhs
,
!
IsRowMajor
),
ConjugateRhs
>
pcj1
;
Scalar
cjAlpha
=
ConjugateRhs
?
numext
::
conj
(
alpha
)
:
alpha
;
Scalar
cjAlpha
=
ConjugateRhs
?
numext
::
conj
(
alpha
)
:
alpha
;
// FIXME this copy is now handled outside product_selfadjoint_vector, so it could probably be removed.
// if the rhs is not sequentially stored in memory we copy it to a temporary buffer,
// this is because we need to extract packets
ei_declare_aligned_stack_constructed_variable
(
Scalar
,
rhs
,
size
,
rhsIncr
==
1
?
const_cast
<
Scalar
*>
(
_rhs
)
:
0
);
if
(
rhsIncr
!=
1
)
{
const
Scalar
*
it
=
_rhs
;
for
(
Index
i
=
0
;
i
<
size
;
++
i
,
it
+=
rhsIncr
)
rhs
[
i
]
=
*
it
;
}
Index
bound
=
(
std
::
max
)(
Index
(
0
),
size
-
8
)
&
0xfffffffe
;
Index
bound
=
(
std
::
max
)(
Index
(
0
),
size
-
8
)
&
0xfffffffe
;
if
(
FirstTriangular
)
if
(
FirstTriangular
)
...
@@ -92,12 +83,11 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
...
@@ -92,12 +83,11 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
Scalar
t3
(
0
);
Scalar
t3
(
0
);
Packet
ptmp3
=
pset1
<
Packet
>
(
t3
);
Packet
ptmp3
=
pset1
<
Packet
>
(
t3
);
size_t
starti
=
FirstTriangular
?
0
:
j
+
2
;
Index
starti
=
FirstTriangular
?
0
:
j
+
2
;
size_t
endi
=
FirstTriangular
?
j
:
size
;
Index
endi
=
FirstTriangular
?
j
:
size
;
size_t
alignedStart
=
(
starti
)
+
internal
::
first_aligned
(
&
res
[
starti
],
endi
-
starti
);
Index
alignedStart
=
(
starti
)
+
internal
::
first_
default_
aligned
(
&
res
[
starti
],
endi
-
starti
);
size_t
alignedEnd
=
alignedStart
+
((
endi
-
alignedStart
)
/
(
PacketSize
))
*
(
PacketSize
);
Index
alignedEnd
=
alignedStart
+
((
endi
-
alignedStart
)
/
(
PacketSize
))
*
(
PacketSize
);
// TODO make sure this product is a real * complex and that the rhs is properly conjugated if needed
res
[
j
]
+=
cjd
.
pmul
(
numext
::
real
(
A0
[
j
]),
t0
);
res
[
j
]
+=
cjd
.
pmul
(
numext
::
real
(
A0
[
j
]),
t0
);
res
[
j
+
1
]
+=
cjd
.
pmul
(
numext
::
real
(
A1
[
j
+
1
]),
t1
);
res
[
j
+
1
]
+=
cjd
.
pmul
(
numext
::
real
(
A1
[
j
+
1
]),
t1
);
if
(
FirstTriangular
)
if
(
FirstTriangular
)
...
@@ -111,11 +101,11 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
...
@@ -111,11 +101,11 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
t2
+=
cj1
.
pmul
(
A0
[
j
+
1
],
rhs
[
j
+
1
]);
t2
+=
cj1
.
pmul
(
A0
[
j
+
1
],
rhs
[
j
+
1
]);
}
}
for
(
size_t
i
=
starti
;
i
<
alignedStart
;
++
i
)
for
(
Index
i
=
starti
;
i
<
alignedStart
;
++
i
)
{
{
res
[
i
]
+=
t0
*
A0
[
i
]
+
t1
*
A1
[
i
];
res
[
i
]
+=
cj0
.
pmul
(
A0
[
i
],
t0
)
+
cj0
.
pmul
(
A1
[
i
]
,
t1
)
;
t2
+=
numext
::
conj
(
A0
[
i
]
)
*
rhs
[
i
];
t2
+=
cj1
.
pmul
(
A0
[
i
]
,
rhs
[
i
]
)
;
t3
+=
numext
::
conj
(
A1
[
i
]
)
*
rhs
[
i
];
t3
+=
cj1
.
pmul
(
A1
[
i
]
,
rhs
[
i
]
)
;
}
}
// Yes this an optimization for gcc 4.3 and 4.4 (=> huge speed up)
// Yes this an optimization for gcc 4.3 and 4.4 (=> huge speed up)
// gcc 4.2 does this optimization automatically.
// gcc 4.2 does this optimization automatically.
...
@@ -123,7 +113,7 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
...
@@ -123,7 +113,7 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
const
Scalar
*
EIGEN_RESTRICT
a1It
=
A1
+
alignedStart
;
const
Scalar
*
EIGEN_RESTRICT
a1It
=
A1
+
alignedStart
;
const
Scalar
*
EIGEN_RESTRICT
rhsIt
=
rhs
+
alignedStart
;
const
Scalar
*
EIGEN_RESTRICT
rhsIt
=
rhs
+
alignedStart
;
Scalar
*
EIGEN_RESTRICT
resIt
=
res
+
alignedStart
;
Scalar
*
EIGEN_RESTRICT
resIt
=
res
+
alignedStart
;
for
(
size_t
i
=
alignedStart
;
i
<
alignedEnd
;
i
+=
PacketSize
)
for
(
Index
i
=
alignedStart
;
i
<
alignedEnd
;
i
+=
PacketSize
)
{
{
Packet
A0i
=
ploadu
<
Packet
>
(
a0It
);
a0It
+=
PacketSize
;
Packet
A0i
=
ploadu
<
Packet
>
(
a0It
);
a0It
+=
PacketSize
;
Packet
A1i
=
ploadu
<
Packet
>
(
a1It
);
a1It
+=
PacketSize
;
Packet
A1i
=
ploadu
<
Packet
>
(
a1It
);
a1It
+=
PacketSize
;
...
@@ -135,7 +125,7 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
...
@@ -135,7 +125,7 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
ptmp3
=
pcj1
.
pmadd
(
A1i
,
Bi
,
ptmp3
);
ptmp3
=
pcj1
.
pmadd
(
A1i
,
Bi
,
ptmp3
);
pstore
(
resIt
,
Xi
);
resIt
+=
PacketSize
;
pstore
(
resIt
,
Xi
);
resIt
+=
PacketSize
;
}
}
for
(
size_t
i
=
alignedEnd
;
i
<
endi
;
i
++
)
for
(
Index
i
=
alignedEnd
;
i
<
endi
;
i
++
)
{
{
res
[
i
]
+=
cj0
.
pmul
(
A0
[
i
],
t0
)
+
cj0
.
pmul
(
A1
[
i
],
t1
);
res
[
i
]
+=
cj0
.
pmul
(
A0
[
i
],
t0
)
+
cj0
.
pmul
(
A1
[
i
],
t1
);
t2
+=
cj1
.
pmul
(
A0
[
i
],
rhs
[
i
]);
t2
+=
cj1
.
pmul
(
A0
[
i
],
rhs
[
i
]);
...
@@ -151,7 +141,6 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
...
@@ -151,7 +141,6 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
Scalar
t1
=
cjAlpha
*
rhs
[
j
];
Scalar
t1
=
cjAlpha
*
rhs
[
j
];
Scalar
t2
(
0
);
Scalar
t2
(
0
);
// TODO make sure this product is a real * complex and that the rhs is properly conjugated if needed
res
[
j
]
+=
cjd
.
pmul
(
numext
::
real
(
A0
[
j
]),
t1
);
res
[
j
]
+=
cjd
.
pmul
(
numext
::
real
(
A0
[
j
]),
t1
);
for
(
Index
i
=
FirstTriangular
?
0
:
j
+
1
;
i
<
(
FirstTriangular
?
j
:
size
);
i
++
)
for
(
Index
i
=
FirstTriangular
?
0
:
j
+
1
;
i
<
(
FirstTriangular
?
j
:
size
);
i
++
)
{
{
...
@@ -169,45 +158,44 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
...
@@ -169,45 +158,44 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
***************************************************************************/
***************************************************************************/
namespace
internal
{
namespace
internal
{
template
<
typename
Lhs
,
int
LhsMode
,
typename
Rhs
>
struct
traits
<
SelfadjointProductMatrix
<
Lhs
,
LhsMode
,
false
,
Rhs
,
0
,
true
>
>
:
traits
<
ProductBase
<
SelfadjointProductMatrix
<
Lhs
,
LhsMode
,
false
,
Rhs
,
0
,
true
>
,
Lhs
,
Rhs
>
>
{};
}
template
<
typename
Lhs
,
int
LhsMode
,
typename
Rhs
>
template
<
typename
Lhs
,
int
LhsMode
,
typename
Rhs
>
struct
SelfadjointProductMatrix
<
Lhs
,
LhsMode
,
false
,
Rhs
,
0
,
true
>
struct
selfadjoint_product_impl
<
Lhs
,
LhsMode
,
false
,
Rhs
,
0
,
true
>
:
public
ProductBase
<
SelfadjointProductMatrix
<
Lhs
,
LhsMode
,
false
,
Rhs
,
0
,
true
>
,
Lhs
,
Rhs
>
{
{
EIGEN_PRODUCT_PUBLIC_INTERFACE
(
SelfadjointProductMatrix
)
typedef
typename
Product
<
Lhs
,
Rhs
>::
Scalar
Scalar
;
enum
{
typedef
internal
::
blas_traits
<
Lhs
>
LhsBlasTraits
;
LhsUpLo
=
LhsMode
&
(
Upper
|
Lower
)
typedef
typename
LhsBlasTraits
::
DirectLinearAccessType
ActualLhsType
;
};
typedef
typename
internal
::
remove_all
<
ActualLhsType
>::
type
ActualLhsTypeCleaned
;
SelfadjointProductMatrix
(
const
Lhs
&
lhs
,
const
Rhs
&
rhs
)
:
Base
(
lhs
,
rhs
)
{}
typedef
internal
::
blas_traits
<
Rhs
>
RhsBlasTraits
;
typedef
typename
RhsBlasTraits
::
DirectLinearAccessType
ActualRhsType
;
template
<
typename
Dest
>
void
scaleAndAddTo
(
Dest
&
dest
,
const
Scalar
&
alpha
)
const
typedef
typename
internal
::
remove_all
<
ActualRhsType
>::
type
ActualRhsTypeCleaned
;
enum
{
LhsUpLo
=
LhsMode
&
(
Upper
|
Lower
)
};
template
<
typename
Dest
>
static
void
run
(
Dest
&
dest
,
const
Lhs
&
a_lhs
,
const
Rhs
&
a_rhs
,
const
Scalar
&
alpha
)
{
{
typedef
typename
Dest
::
Scalar
ResScalar
;
typedef
typename
Dest
::
Scalar
ResScalar
;
typedef
typename
Base
::
RhsScalar
RhsScalar
;
typedef
typename
Rhs
::
Scalar
RhsScalar
;
typedef
Map
<
Matrix
<
ResScalar
,
Dynamic
,
1
>
,
Aligned
>
MappedDest
;
typedef
Map
<
Matrix
<
ResScalar
,
Dynamic
,
1
>
,
EIGEN_PLAIN_ENUM_MIN
(
AlignedMax
,
internal
::
packet_traits
<
ResScalar
>::
size
)
>
MappedDest
;
eigen_assert
(
dest
.
rows
()
==
m
_lhs
.
rows
()
&&
dest
.
cols
()
==
m
_rhs
.
cols
());
eigen_assert
(
dest
.
rows
()
==
a
_lhs
.
rows
()
&&
dest
.
cols
()
==
a
_rhs
.
cols
());
typename
internal
::
add_const_on_value_type
<
ActualLhsType
>::
type
lhs
=
LhsBlasTraits
::
extract
(
m
_lhs
);
typename
internal
::
add_const_on_value_type
<
ActualLhsType
>::
type
lhs
=
LhsBlasTraits
::
extract
(
a
_lhs
);
typename
internal
::
add_const_on_value_type
<
ActualRhsType
>::
type
rhs
=
RhsBlasTraits
::
extract
(
m
_rhs
);
typename
internal
::
add_const_on_value_type
<
ActualRhsType
>::
type
rhs
=
RhsBlasTraits
::
extract
(
a
_rhs
);
Scalar
actualAlpha
=
alpha
*
LhsBlasTraits
::
extractScalarFactor
(
m
_lhs
)
Scalar
actualAlpha
=
alpha
*
LhsBlasTraits
::
extractScalarFactor
(
a
_lhs
)
*
RhsBlasTraits
::
extractScalarFactor
(
m
_rhs
);
*
RhsBlasTraits
::
extractScalarFactor
(
a
_rhs
);
enum
{
enum
{
EvalToDest
=
(
Dest
::
InnerStrideAtCompileTime
==
1
),
EvalToDest
=
(
Dest
::
InnerStrideAtCompileTime
==
1
),
UseRhs
=
(
_
ActualRhsType
::
InnerStrideAtCompileTime
==
1
)
UseRhs
=
(
ActualRhsType
Cleaned
::
InnerStrideAtCompileTime
==
1
)
};
};
internal
::
gemv_static_vector_if
<
ResScalar
,
Dest
::
SizeAtCompileTime
,
Dest
::
MaxSizeAtCompileTime
,
!
EvalToDest
>
static_dest
;
internal
::
gemv_static_vector_if
<
ResScalar
,
Dest
::
SizeAtCompileTime
,
Dest
::
MaxSizeAtCompileTime
,
!
EvalToDest
>
static_dest
;
internal
::
gemv_static_vector_if
<
RhsScalar
,
_
ActualRhsType
::
SizeAtCompileTime
,
_
ActualRhsType
::
MaxSizeAtCompileTime
,
!
UseRhs
>
static_rhs
;
internal
::
gemv_static_vector_if
<
RhsScalar
,
ActualRhsType
Cleaned
::
SizeAtCompileTime
,
ActualRhsType
Cleaned
::
MaxSizeAtCompileTime
,
!
UseRhs
>
static_rhs
;
ei_declare_aligned_stack_constructed_variable
(
ResScalar
,
actualDestPtr
,
dest
.
size
(),
ei_declare_aligned_stack_constructed_variable
(
ResScalar
,
actualDestPtr
,
dest
.
size
(),
EvalToDest
?
dest
.
data
()
:
static_dest
.
data
());
EvalToDest
?
dest
.
data
()
:
static_dest
.
data
());
...
@@ -218,7 +206,7 @@ struct SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,0,true>
...
@@ -218,7 +206,7 @@ struct SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,0,true>
if
(
!
EvalToDest
)
if
(
!
EvalToDest
)
{
{
#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
int
size
=
dest
.
size
();
Index
size
=
dest
.
size
();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
#endif
#endif
MappedDest
(
actualDestPtr
,
dest
.
size
())
=
dest
;
MappedDest
(
actualDestPtr
,
dest
.
size
())
=
dest
;
...
@@ -227,18 +215,19 @@ struct SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,0,true>
...
@@ -227,18 +215,19 @@ struct SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,0,true>
if
(
!
UseRhs
)
if
(
!
UseRhs
)
{
{
#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
int
size
=
rhs
.
size
();
Index
size
=
rhs
.
size
();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
#endif
#endif
Map
<
typename
_
ActualRhsType
::
PlainObject
>
(
actualRhsPtr
,
rhs
.
size
())
=
rhs
;
Map
<
typename
ActualRhsType
Cleaned
::
PlainObject
>
(
actualRhsPtr
,
rhs
.
size
())
=
rhs
;
}
}
internal
::
selfadjoint_matrix_vector_product
<
Scalar
,
Index
,
(
internal
::
traits
<
_ActualLhsType
>::
Flags
&
RowMajorBit
)
?
RowMajor
:
ColMajor
,
int
(
LhsUpLo
),
bool
(
LhsBlasTraits
::
NeedToConjugate
),
bool
(
RhsBlasTraits
::
NeedToConjugate
)
>::
run
internal
::
selfadjoint_matrix_vector_product
<
Scalar
,
Index
,
(
internal
::
traits
<
ActualLhsTypeCleaned
>::
Flags
&
RowMajorBit
)
?
RowMajor
:
ColMajor
,
int
(
LhsUpLo
),
bool
(
LhsBlasTraits
::
NeedToConjugate
),
bool
(
RhsBlasTraits
::
NeedToConjugate
)
>::
run
(
(
lhs
.
rows
(),
// size
lhs
.
rows
(),
// size
&
lhs
.
coeffRef
(
0
,
0
),
lhs
.
outerStride
(),
// lhs info
&
lhs
.
coeffRef
(
0
,
0
),
lhs
.
outerStride
(),
// lhs info
actualRhsPtr
,
1
,
// rhs info
actualRhsPtr
,
// rhs info
actualDestPtr
,
// result info
actualDestPtr
,
// result info
actualAlpha
// scale factor
actualAlpha
// scale factor
);
);
...
@@ -248,34 +237,24 @@ struct SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,0,true>
...
@@ -248,34 +237,24 @@ struct SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,0,true>
}
}
};
};
namespace
internal
{
template
<
typename
Lhs
,
typename
Rhs
,
int
RhsMode
>
struct
traits
<
SelfadjointProductMatrix
<
Lhs
,
0
,
true
,
Rhs
,
RhsMode
,
false
>
>
:
traits
<
ProductBase
<
SelfadjointProductMatrix
<
Lhs
,
0
,
true
,
Rhs
,
RhsMode
,
false
>
,
Lhs
,
Rhs
>
>
{};
}
template
<
typename
Lhs
,
typename
Rhs
,
int
RhsMode
>
template
<
typename
Lhs
,
typename
Rhs
,
int
RhsMode
>
struct
SelfadjointProductMatrix
<
Lhs
,
0
,
true
,
Rhs
,
RhsMode
,
false
>
struct
selfadjoint_product_impl
<
Lhs
,
0
,
true
,
Rhs
,
RhsMode
,
false
>
:
public
ProductBase
<
SelfadjointProductMatrix
<
Lhs
,
0
,
true
,
Rhs
,
RhsMode
,
false
>
,
Lhs
,
Rhs
>
{
{
EIGEN_PRODUCT_PUBLIC_INTERFACE
(
SelfadjointProductMatrix
)
typedef
typename
Product
<
Lhs
,
Rhs
>::
Scalar
Scalar
;
enum
{
RhsUpLo
=
RhsMode
&
(
Upper
|
Lower
)
};
enum
{
template
<
typename
Dest
>
RhsUpLo
=
RhsMode
&
(
Upper
|
Lower
)
static
void
run
(
Dest
&
dest
,
const
Lhs
&
a_lhs
,
const
Rhs
&
a_rhs
,
const
Scalar
&
alpha
)
};
SelfadjointProductMatrix
(
const
Lhs
&
lhs
,
const
Rhs
&
rhs
)
:
Base
(
lhs
,
rhs
)
{}
template
<
typename
Dest
>
void
scaleAndAddTo
(
Dest
&
dest
,
const
Scalar
&
alpha
)
const
{
{
// let's simply transpose the product
// let's simply transpose the product
Transpose
<
Dest
>
destT
(
dest
);
Transpose
<
Dest
>
destT
(
dest
);
S
elfadjoint
P
roduct
Matrix
<
Transpose
<
const
Rhs
>
,
int
(
RhsUpLo
)
==
Upper
?
Lower
:
Upper
,
false
,
s
elfadjoint
_p
roduct
_impl
<
Transpose
<
const
Rhs
>
,
int
(
RhsUpLo
)
==
Upper
?
Lower
:
Upper
,
false
,
Transpose
<
const
Lhs
>
,
0
,
true
>
(
m
_rhs
.
transpose
(),
m
_lhs
.
transpose
()
).
scaleAndAddTo
(
destT
,
alpha
);
Transpose
<
const
Lhs
>
,
0
,
true
>
::
run
(
destT
,
a
_rhs
.
transpose
(),
a
_lhs
.
transpose
(),
alpha
);
}
}
};
};
}
// end namespace internal
}
// end namespace Eigen
}
// end namespace Eigen
#endif // EIGEN_SELFADJOINT_MATRIX_VECTOR_H
#endif // EIGEN_SELFADJOINT_MATRIX_VECTOR_H
Prev
1
…
6
7
8
9
10
Next