10 #ifndef EIGEN_SELFADJOINTRANK2UPTADE_H
11 #define EIGEN_SELFADJOINTRANK2UPTADE_H
13 #include "../InternalHeaderCheck.h"
23 template<
typename Scalar,
typename Index,
typename UType,
typename VType,
int UpLo>
24 struct selfadjoint_rank2_update_selector;
26 template<
typename Scalar,
typename Index,
typename UType,
typename VType>
27 struct selfadjoint_rank2_update_selector<Scalar,
Index,UType,VType,
Lower>
30 void run(Scalar*
mat,
Index stride,
const UType& u,
const VType&
v,
const Scalar& alpha)
35 Map<Matrix<Scalar,Dynamic,1> >(
mat+stride*
i+
i,
size-
i) +=
42 template<
typename Scalar,
typename Index,
typename UType,
typename VType>
43 struct selfadjoint_rank2_update_selector<Scalar,
Index,UType,VType,
Upper>
45 static void run(Scalar*
mat,
Index stride,
const UType& u,
const VType&
v,
const Scalar& alpha)
49 Map<Matrix<Scalar,Dynamic,1> >(
mat+stride*
i,
i+1) +=
55 template<
bool Cond,
typename T>
56 using conj_expr_if = std::conditional<!Cond, const T&, CwiseUnaryOp<scalar_conjugate_op<typename traits<T>::Scalar>,
T>>;
60 template<
typename MatrixType,
unsigned int UpLo>
61 template<
typename DerivedU,
typename DerivedV>
65 typedef internal::blas_traits<DerivedU> UBlasTraits;
66 typedef typename UBlasTraits::DirectLinearAccessType ActualUType;
70 typedef internal::blas_traits<DerivedV> VBlasTraits;
71 typedef typename VBlasTraits::DirectLinearAccessType ActualVType;
78 enum { IsRowMajor = (internal::traits<MatrixType>::Flags&
RowMajorBit) ? 1 : 0 };
79 Scalar actualAlpha = alpha * UBlasTraits::extractScalarFactor(u.
derived())
80 *
numext::conj(VBlasTraits::extractScalarFactor(
v.derived()));
86 internal::selfadjoint_rank2_update_selector<
Scalar,
Index, UType, VType,
88 ::run(_expression().const_cast_derived().data(),_expression().outerStride(),UType(actualU),VType(actualV),actualAlpha);
Array< int, Dynamic, 1 > v
#define EIGEN_DEVICE_FUNC
Base class for all dense matrices, vectors, and expressions.
Expression of a selfadjoint matrix from a triangular part of a dense matrix.
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
std::conditional<!Cond, const T &, CwiseUnaryOp< scalar_conjugate_op< typename traits< T >::Scalar >, T > > conj_expr_if
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.
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_conjugate_op< typename Derived::Scalar >, const Derived > conj(const Eigen::ArrayBase< Derived > &x)