10#ifndef EIGEN_TRIANGULARMATRIXVECTOR_H
11#define EIGEN_TRIANGULARMATRIXVECTOR_H
17template<
typename Index,
int Mode,
typename LhsScalar,
bool ConjLhs,
typename RhsScalar,
bool ConjRhs,
int StorageOrder,
int Version=Specialized>
20template<
typename Index,
int Mode,
typename LhsScalar,
bool ConjLhs,
typename RhsScalar,
bool ConjRhs,
int Version>
33template<
typename Index,
int Mode,
typename LhsScalar,
bool ConjLhs,
typename RhsScalar,
bool ConjRhs,
int Version>
34EIGEN_DONT_INLINE void triangular_matrix_vector_product<Index,Mode,LhsScalar,ConjLhs,RhsScalar,ConjRhs,ColMajor,Version>
63 Index s = IsLower ? ((HasUnitDiag||HasZeroDiag) ?
i+1 :
i ) :
pi;
65 if ((!(HasUnitDiag||HasZeroDiag)) || (--r)>0)
91template<
typename Index,
int Mode,
typename LhsScalar,
bool ConjLhs,
typename RhsScalar,
bool ConjRhs,
int Version>
104template<
typename Index,
int Mode,
typename LhsScalar,
bool ConjLhs,
typename RhsScalar,
bool ConjRhs,
int Version>
105EIGEN_DONT_INLINE void triangular_matrix_vector_product<Index,Mode,LhsScalar,ConjLhs,RhsScalar,ConjRhs,RowMajor,Version>
134 Index s = IsLower ?
pi : ((HasUnitDiag||HasZeroDiag) ?
i+1 :
i);
136 if ((!(HasUnitDiag||HasZeroDiag)) || (--r)>0)
137 res.coeffRef(
i) +=
alpha * (
cjLhs.row(
i).segment(
s,r).cwiseProduct(
cjRhs.segment(
s,r).transpose())).sum();
152 if(IsLower &&
rows>diagSize)
166template<
int Mode,
int StorageOrder>
173template<
int Mode,
typename Lhs,
typename Rhs>
176 template<
typename Dest>
static void run(
Dest&
dst,
const Lhs &lhs,
const Rhs &rhs,
const typename Dest::Scalar&
alpha)
184template<
int Mode,
typename Lhs,
typename Rhs>
187 template<
typename Dest>
static void run(
Dest&
dst,
const Lhs &lhs,
const Rhs &rhs,
const typename Dest::Scalar&
alpha)
194 ::run(rhs.transpose(),lhs.transpose(),
dstT,
alpha);
206 template<
typename Lhs,
typename Rhs,
typename Dest>
209 typedef typename Lhs::Scalar LhsScalar;
210 typedef typename Rhs::Scalar RhsScalar;
211 typedef typename Dest::Scalar ResScalar;
215 typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType;
217 typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType;
224 LhsScalar
lhs_alpha = LhsBlasTraits::extractScalarFactor(lhs);
225 RhsScalar
rhs_alpha = RhsBlasTraits::extractScalarFactor(rhs);
248 #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
263 LhsScalar, LhsBlasTraits::NeedToConjugate,
264 RhsScalar, RhsBlasTraits::NeedToConjugate,
281 Index diagSize = (std::min)(lhs.rows(),lhs.cols());
282 dest.head(diagSize) -= (
lhs_alpha-LhsScalar(1))*rhs.head(diagSize);
289 template<
typename Lhs,
typename Rhs,
typename Dest>
292 typedef typename Lhs::Scalar LhsScalar;
293 typedef typename Rhs::Scalar RhsScalar;
294 typedef typename Dest::Scalar ResScalar;
297 typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType;
299 typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType;
305 LhsScalar
lhs_alpha = LhsBlasTraits::extractScalarFactor(lhs);
306 RhsScalar
rhs_alpha = RhsBlasTraits::extractScalarFactor(rhs);
310 DirectlyUseRhs = ActualRhsTypeCleaned::InnerStrideAtCompileTime==1
320 #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
329 LhsScalar, LhsBlasTraits::NeedToConjugate,
330 RhsScalar, RhsBlasTraits::NeedToConjugate,
340 Index diagSize = (std::min)(lhs.rows(),lhs.cols());
341 dest.head(diagSize) -= (
lhs_alpha-LhsScalar(1))*rhs.head(diagSize);
int i
Definition BiCGSTAB_step_by_step.cpp:9
#define EIGEN_PLAIN_ENUM_MIN(a, b)
Definition Macros.h:1288
#define EIGEN_DONT_INLINE
Definition Macros.h:940
#define eigen_assert(x)
Definition Macros.h:1037
#define ei_declare_aligned_stack_constructed_variable(TYPE, NAME, SIZE, BUFFER)
Definition Memory.h:768
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition PartialRedux_count.cpp:3
#define EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH
Definition Settings.h:38
int rows
Definition Tutorial_commainit_02.cpp:1
int cols
Definition Tutorial_commainit_02.cpp:1
Scalar Scalar int size
Definition benchVecAdd.cpp:17
NumTraits< Scalar >::Real RealScalar
Definition bench_gemm.cpp:47
@ UnitDiag
Definition Constants.h:213
@ ZeroDiag
Definition Constants.h:215
@ Lower
Definition Constants.h:209
@ Upper
Definition Constants.h:211
@ AlignedMax
Definition Constants.h:252
@ ColMajor
Definition Constants.h:319
@ RowMajor
Definition Constants.h:321
const unsigned int RowMajorBit
Definition Constants.h:66
RealScalar s
Definition level1_cplx_impl.h:126
RealScalar alpha
Definition level1_cplx_impl.h:147
@ Lhs
Definition TensorContractionMapper.h:19
@ Rhs
Definition TensorContractionMapper.h:18
Namespace containing all symbols from the Eigen library.
Definition bench_norm.cpp:85
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
Definition BandTriangularSolver.h:13
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition NumTraits.h:233
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
Definition XprHelper.h:806
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE To run(const From &x)
Definition BlasUtil.h:43
Definition GenericPacketMath.h:107
Definition ForwardDeclarations.h:17
ScalarBinaryOpTraits< LhsScalar, RhsScalar >::ReturnType ResScalar
Definition TriangularMatrixVector.h:94
ScalarBinaryOpTraits< LhsScalar, RhsScalar >::ReturnType ResScalar
Definition TriangularMatrixVector.h:23
Definition TriangularMatrixVector.h:18
static void run(Dest &dst, const Lhs &lhs, const Rhs &rhs, const typename Dest::Scalar &alpha)
Definition TriangularMatrixVector.h:187
static void run(Dest &dst, const Lhs &lhs, const Rhs &rhs, const typename Dest::Scalar &alpha)
Definition TriangularMatrixVector.h:176
Definition ProductEvaluators.h:758
static void run(const Lhs &lhs, const Rhs &rhs, Dest &dest, const typename Dest::Scalar &alpha)
Definition TriangularMatrixVector.h:207
static void run(const Lhs &lhs, const Rhs &rhs, Dest &dest, const typename Dest::Scalar &alpha)
Definition TriangularMatrixVector.h:290
Definition TriangularMatrixVector.h:167