10 #ifndef EIGEN_SELFADJOINT_PRODUCT_H 11 #define EIGEN_SELFADJOINT_PRODUCT_H 22 template<
typename Scalar,
typename Index,
int UpLo,
bool ConjLhs,
bool ConjRhs>
25 static void run(
Index size, Scalar* mat,
Index stride,
const Scalar* vecX,
const Scalar* vecY,
const Scalar& alpha)
30 for (
Index i=0; i<size; ++i)
33 += (alpha * cj(vecY[i])) * ConjLhsType(OtherMap(vecX+(UpLo==
Lower ? i : 0),UpLo==
Lower ? size-i : (i+1)));
38 template<
typename Scalar,
typename Index,
int UpLo,
bool ConjLhs,
bool ConjRhs>
41 static void run(
Index size, Scalar* mat,
Index stride,
const Scalar* vecX,
const Scalar* vecY,
const Scalar& alpha)
43 selfadjoint_rank1_update<Scalar,Index,ColMajor,UpLo==Lower?Upper:Lower,ConjRhs,ConjLhs>::run(size,mat,stride,vecY,vecX,alpha);
47 template<
typename MatrixType,
typename OtherType,
int UpLo,
bool OtherIsVector = OtherType::IsVectorAtCompileTime>
50 template<
typename MatrixType,
typename OtherType,
int UpLo>
53 static void run(MatrixType& mat,
const OtherType& other,
const typename MatrixType::Scalar& alpha)
55 typedef typename MatrixType::Scalar Scalar;
57 typedef typename OtherBlasTraits::DirectLinearAccessType ActualOtherType;
61 Scalar actualAlpha = alpha * OtherBlasTraits::extractScalarFactor(other.derived());
65 UseOtherDirectly = _ActualOtherType::InnerStrideAtCompileTime==1
69 ei_declare_aligned_stack_constructed_variable(Scalar, actualOtherPtr, other.size(),
70 (UseOtherDirectly ?
const_cast<Scalar*
>(actualOther.data()) : static_other.data()));
77 (!OtherBlasTraits::NeedToConjugate) && NumTraits<Scalar>::IsComplex>
78 ::run(other.size(), mat.data(), mat.outerStride(), actualOtherPtr, actualOtherPtr, actualAlpha);
82 template<
typename MatrixType,
typename OtherType,
int UpLo>
85 static void run(MatrixType& mat,
const OtherType& other,
const typename MatrixType::Scalar& alpha)
87 typedef typename MatrixType::Scalar Scalar;
89 typedef typename OtherBlasTraits::DirectLinearAccessType ActualOtherType;
93 Scalar actualAlpha = alpha * OtherBlasTraits::extractScalarFactor(other.derived());
97 OtherIsRowMajor = _ActualOtherType::Flags&
RowMajorBit ? 1 : 0
100 Index size = mat.cols();
101 Index depth = actualOther.cols();
104 MatrixType::MaxColsAtCompileTime, MatrixType::MaxColsAtCompileTime, _ActualOtherType::MaxColsAtCompileTime> BlockingType;
106 BlockingType blocking(size, size, depth, 1,
false);
111 Scalar, OtherIsRowMajor ?
ColMajor :
RowMajor, (!OtherBlasTraits::NeedToConjugate) && NumTraits<Scalar>::IsComplex,
114 &actualOther.coeffRef(0,0), actualOther.outerStride(), &actualOther.coeffRef(0,0), actualOther.outerStride(),
115 mat.data(), mat.outerStride(), actualAlpha, blocking);
121 template<
typename MatrixType,
unsigned int UpLo>
122 template<
typename DerivedU>
133 #endif // EIGEN_SELFADJOINT_PRODUCT_H Definition: BlasUtil.h:269
Storage order is column major (see TopicStorageOrders).
Definition: Constants.h:320
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:88
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
Definition: GeneralMatrixMatrixTriangular.h:16
Holds information about the various numeric (i.e.
Definition: NumTraits.h:150
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:61
View matrix as a lower triangular matrix.
Definition: Constants.h:204
Definition: BlasUtil.h:43
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
Definition: GeneralMatrixMatrixTriangular.h:36
Expression of a selfadjoint matrix from a triangular part of a dense matrix.
Definition: SelfAdjointView.h:49
EIGEN_DEVICE_FUNC SelfAdjointView & rankUpdate(const MatrixBase< DerivedU > &u, const MatrixBase< DerivedV > &v, const Scalar &alpha=Scalar(1))
Perform a symmetric rank 2 update of the selfadjoint matrix *this: .
Definition: GeneralProduct.h:146
Definition: SelfadjointProduct.h:48
Storage order is row major (see TopicStorageOrders).
Definition: Constants.h:322
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:55
Definition: GeneralMatrixMatrix.h:244
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
Definition: ForwardDeclarations.h:17