10 #ifndef EIGEN_SELFADJOINTRANK2UPTADE_H
11 #define EIGEN_SELFADJOINTRANK2UPTADE_H
21 template<
typename Scalar,
typename Index,
typename UType,
typename VType,
int UpLo>
24 template<
typename Scalar,
typename Index,
typename UType,
typename VType>
27 static EIGEN_DEVICE_FUNC
28 void run(Scalar* mat,
Index stride,
const UType& u,
const VType& v,
const Scalar& alpha)
30 const Index size = u.size();
31 for (
Index i=0; i<size; ++i)
34 (numext::conj(alpha) * numext::conj(u.coeff(i))) * v.tail(size-i)
35 + (alpha * numext::conj(v.coeff(i))) * u.tail(size-i);
40 template<
typename Scalar,
typename Index,
typename UType,
typename VType>
43 static void run(Scalar* mat,
Index stride,
const UType& u,
const VType& v,
const Scalar& alpha)
45 const Index size = u.size();
46 for (
Index i=0; i<size; ++i)
48 (numext::conj(alpha) * numext::conj(u.coeff(i))) * v.head(i+1)
49 + (alpha * numext::conj(v.coeff(i))) * u.head(i+1);
55 CwiseUnaryOp<scalar_conjugate_op<typename traits<T>::Scalar>,T> > {};
59 template<
typename MatrixType,
unsigned int UpLo>
60 template<
typename DerivedU,
typename DerivedV>
65 typedef typename UBlasTraits::DirectLinearAccessType ActualUType;
66 typedef typename internal::remove_all<ActualUType>::type _ActualUType;
67 typename internal::add_const_on_value_type<ActualUType>::type actualU = UBlasTraits::extract(u.derived());
70 typedef typename VBlasTraits::DirectLinearAccessType ActualVType;
71 typedef typename internal::remove_all<ActualVType>::type _ActualVType;
72 typename internal::add_const_on_value_type<ActualVType>::type actualV = VBlasTraits::extract(v.derived());
78 Scalar actualAlpha = alpha * UBlasTraits::extractScalarFactor(u.derived())
79 * numext::conj(VBlasTraits::extractScalarFactor(v.derived()));
81 actualAlpha = numext::conj(actualAlpha);
83 typedef typename internal::remove_all<typename internal::conj_expr_if<IsRowMajor ^ UBlasTraits::NeedToConjugate,_ActualUType>::type>::type UType;
84 typedef typename internal::remove_all<typename internal::conj_expr_if<IsRowMajor ^ VBlasTraits::NeedToConjugate,_ActualVType>::type>::type VType;
85 internal::selfadjoint_rank2_update_selector<Scalar,
Index, UType, VType,
87 ::run(_expression().const_cast_derived().data(),_expression().outerStride(),UType(actualU),VType(actualV),actualAlpha);
94 #endif // EIGEN_SELFADJOINTRANK2UPTADE_H