10 #ifndef EIGEN_PACKED_TRIANGULAR_MATRIX_VECTOR_H 11 #define EIGEN_PACKED_TRIANGULAR_MATRIX_VECTOR_H 15 template<
typename Index,
int Mode,
typename LhsScalar,
bool ConjLhs,
typename RhsScalar,
bool ConjRhs,
int StorageOrder>
18 template<
typename Index,
int Mode,
typename LhsScalar,
bool ConjLhs,
typename RhsScalar,
bool ConjRhs>
21 typedef typename ScalarBinaryOpTraits<LhsScalar, RhsScalar>::ReturnType
ResScalar;
27 static void run(
Index size,
const LhsScalar* lhs,
const RhsScalar* rhs, ResScalar* res, ResScalar
alpha)
29 internal::conj_if<ConjRhs> cj;
30 typedef Map<const Matrix<LhsScalar,Dynamic,1> > LhsMap;
31 typedef typename conj_expr_if<ConjLhs,LhsMap>::type ConjLhsType;
32 typedef Map<Matrix<ResScalar,Dynamic,1> > ResMap;
36 Index s = IsLower&&(HasUnitDiag||HasZeroDiag) ? 1 : 0;
37 Index r = IsLower ? size-i: i+1;
39 ResMap(res+(IsLower ? s+i : 0),r) += alpha * cj(rhs[i]) * ConjLhsType(LhsMap(lhs+s,r));
41 res[i] += alpha * cj(rhs[i]);
42 lhs += IsLower ? size-i: i+1;
47 template<
typename Index,
int Mode,
typename LhsScalar,
bool ConjLhs,
typename RhsScalar,
bool ConjRhs>
50 typedef typename ScalarBinaryOpTraits<LhsScalar, RhsScalar>::ReturnType
ResScalar;
56 static void run(
Index size,
const LhsScalar* lhs,
const RhsScalar* rhs, ResScalar* res, ResScalar
alpha)
58 internal::conj_if<ConjRhs> cj;
59 typedef Map<const Matrix<LhsScalar,Dynamic,1> > LhsMap;
60 typedef typename conj_expr_if<ConjLhs,LhsMap>::type ConjLhsType;
61 typedef Map<const Matrix<RhsScalar,Dynamic,1> > RhsMap;
62 typedef typename conj_expr_if<ConjRhs,RhsMap>::type ConjRhsType;
66 Index s = !IsLower&&(HasUnitDiag||HasZeroDiag) ? 1 : 0;
67 Index r = IsLower ? i+1 : size-i;
69 res[i] += alpha * (ConjLhsType(LhsMap(lhs+s,r)).cwiseProduct(ConjRhsType(RhsMap(rhs+(IsLower ? 0 : s+i),r)))).sum();
71 res[i] += alpha * cj(rhs[i]);
72 lhs += IsLower ? i+1 : size-i;
79 #endif // EIGEN_PACKED_TRIANGULAR_MATRIX_VECTOR_H
static constexpr size_t size(Tuple< Args... > &)
Provides access to the number of elements in a tuple as a compile-time constant expression.
#define EIGEN_IMPLIES(a, b)
ScalarBinaryOpTraits< LhsScalar, RhsScalar >::ReturnType ResScalar
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
static void run(Index size, const LhsScalar *lhs, const RhsScalar *rhs, ResScalar *res, ResScalar alpha)
static void run(Index size, const LhsScalar *lhs, const RhsScalar *rhs, ResScalar *res, ResScalar alpha)
ScalarBinaryOpTraits< LhsScalar, RhsScalar >::ReturnType ResScalar