10 #ifndef EIGEN_SELFADJOINT_PRODUCT_H
11 #define EIGEN_SELFADJOINT_PRODUCT_H
19 #include "../InternalHeaderCheck.h"
24 template<
typename Scalar,
typename Index,
int UpLo,
bool ConjLhs,
bool ConjRhs>
27 static void run(
Index size, Scalar*
mat,
Index stride,
const Scalar* vecX,
const Scalar* vecY,
const Scalar& alpha)
29 internal::conj_if<ConjRhs> cj;
31 typedef std::conditional_t<ConjLhs,typename OtherMap::ConjugateReturnType,const OtherMap&> ConjLhsType;
35 += (alpha * cj(vecY[
i])) * ConjLhsType(OtherMap(vecX+(UpLo==
Lower ?
i : 0),UpLo==
Lower ?
size-
i : (
i+1)));
40 template<
typename Scalar,
typename Index,
int UpLo,
bool ConjLhs,
bool ConjRhs>
43 static void run(
Index size, Scalar*
mat,
Index stride,
const Scalar* vecX,
const Scalar* vecY,
const Scalar& alpha)
45 selfadjoint_rank1_update<Scalar,Index,ColMajor,UpLo==Lower?Upper:Lower,ConjRhs,ConjLhs>::run(
size,
mat,stride,vecY,vecX,alpha);
49 template<
typename MatrixType,
typename OtherType,
int UpLo,
bool OtherIsVector = OtherType::IsVectorAtCompileTime>
52 template<
typename MatrixType,
typename OtherType,
int UpLo>
58 typedef internal::blas_traits<OtherType> OtherBlasTraits;
59 typedef typename OtherBlasTraits::DirectLinearAccessType ActualOtherType;
63 Scalar actualAlpha = alpha * OtherBlasTraits::extractScalarFactor(other.derived());
67 UseOtherDirectly = ActualOtherType_::InnerStrideAtCompileTime==1
69 internal::gemv_static_vector_if<Scalar,OtherType::SizeAtCompileTime,OtherType::MaxSizeAtCompileTime,!UseOtherDirectly> static_other;
72 (UseOtherDirectly ?
const_cast<Scalar*
>(actualOther.data()) : static_other.data()));
80 ::run(other.size(),
mat.data(),
mat.outerStride(), actualOtherPtr, actualOtherPtr, actualAlpha);
84 template<
typename MatrixType,
typename OtherType,
int UpLo>
90 typedef internal::blas_traits<OtherType> OtherBlasTraits;
91 typedef typename OtherBlasTraits::DirectLinearAccessType ActualOtherType;
95 Scalar actualAlpha = alpha * OtherBlasTraits::extractScalarFactor(other.derived());
98 IsRowMajor = (internal::traits<MatrixType>::Flags&
RowMajorBit) ? 1 : 0,
99 OtherIsRowMajor = ActualOtherType_::Flags&
RowMajorBit ? 1 : 0
103 Index depth = actualOther.cols();
105 typedef internal::gemm_blocking_space<IsRowMajor ?
RowMajor :
ColMajor,Scalar,Scalar,
106 MatrixType::MaxColsAtCompileTime, MatrixType::MaxColsAtCompileTime, ActualOtherType_::MaxColsAtCompileTime> BlockingType;
108 BlockingType blocking(
size,
size, depth, 1,
false);
111 internal::general_matrix_matrix_triangular_product<
Index,
114 IsRowMajor ?
RowMajor :
ColMajor, MatrixType::InnerStrideAtCompileTime, UpLo>
116 actualOther.data(), actualOther.outerStride(), actualOther.data(), actualOther.outerStride(),
117 mat.data(),
mat.innerStride(),
mat.outerStride(), actualAlpha, blocking);
123 template<
typename MatrixType,
unsigned int UpLo>
124 template<
typename DerivedU>
#define EIGEN_DEVICE_FUNC
#define ei_declare_aligned_stack_constructed_variable(TYPE, NAME, SIZE, BUFFER)
internal::traits< Derived >::Scalar Scalar
A matrix or vector expression mapping an existing array of data.
Base class for all dense matrices, vectors, and expressions.
The matrix class, also used for vectors and row-vectors.
SelfAdjointView & rankUpdate(const MatrixBase< DerivedU > &u, const MatrixBase< DerivedV > &v, const Scalar &alpha=Scalar(1))
internal::traits< SelfAdjointView >::Scalar Scalar
The type of coefficients in this matrix.
const unsigned int RowMajorBit
typename remove_all< T >::type remove_all_t
typename add_const_on_value_type< T >::type add_const_on_value_type_t
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
static void run(MatrixType &mat, const OtherType &other, const typename MatrixType::Scalar &alpha)
static void run(MatrixType &mat, const OtherType &other, const typename MatrixType::Scalar &alpha)
static void run(Index size, Scalar *mat, Index stride, const Scalar *vecX, const Scalar *vecY, const Scalar &alpha)
static void run(Index size, Scalar *mat, Index stride, const Scalar *vecX, const Scalar *vecY, const Scalar &alpha)