10#ifndef EIGEN_GENERAL_MATRIX_MATRIX_TRIANGULAR_H
11#define EIGEN_GENERAL_MATRIX_MATRIX_TRIANGULAR_H
15template<
typename Scalar,
typename Index,
int StorageOrder,
int UpLo,
bool ConjLhs,
bool ConjRhs>
28template<
typename LhsScalar,
typename RhsScalar,
typename Index,
int mr,
int nr,
bool ConjLhs,
bool ConjRhs,
int ResInnerStr
ide,
int UpLo>
32template <
typename Index,
33 typename LhsScalar,
int LhsStorageOrder,
bool ConjugateLhs,
34 typename RhsScalar,
int RhsStorageOrder,
bool ConjugateRhs,
35 int ResStorageOrder,
int ResInnerStride,
int UpLo,
int Version =
Specialized>
42struct general_matrix_matrix_triangular_product<
Index,LhsScalar,
LhsStorageOrder,
ConjugateLhs,RhsScalar,
RhsStorageOrder,
ConjugateRhs,
RowMajor,
ResInnerStride,UpLo,
Version>
53 ::run(
size,
depth,rhs,
rhsStride,lhs,
lhsStride,
res,
resIncr,
resStride,
alpha,
blocking);
57template <
typename Index,
typename LhsScalar,
int LhsStorageOrder,
bool ConjugateLhs,
58 typename RhsScalar,
int RhsStorageOrder,
bool ConjugateRhs,
59 int ResInnerStride,
int UpLo,
int Version>
60struct general_matrix_matrix_triangular_product<
Index,LhsScalar,
LhsStorageOrder,
ConjugateLhs,RhsScalar,
RhsStorageOrder,
ConjugateRhs,
ColMajor,
ResInnerStride,UpLo,
Version>
82 mc = (mc/Traits::nr)*Traits::nr;
84 std::size_t
sizeA = kc*mc;
138template<
typename LhsScalar,
typename RhsScalar,
typename Index,
int mr,
int nr,
bool ConjLhs,
bool ConjRhs,
int ResInnerStr
ide,
int UpLo>
179 typename ResMapper::LinearMapper r =
res.getLinearMapper(
i,
j+
j1);
200template<
typename MatrixType,
typename ProductType,
int UpLo,
bool IsOuterProduct>
204template<
typename MatrixType,
typename ProductType,
int UpLo>
209 typedef typename MatrixType::Scalar
Scalar;
213 typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhs;
219 typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhs;
223 Scalar actualAlpha =
alpha * LhsBlasTraits::extractScalarFactor(
prod.
lhs().derived()) * RhsBlasTraits::extractScalarFactor(
prod.
rhs().derived());
226 mat.template triangularView<UpLo>().setZero();
230 UseLhsDirectly = _ActualLhs::InnerStrideAtCompileTime==1,
231 UseRhsDirectly = _ActualRhs::InnerStrideAtCompileTime==1
236 (UseLhsDirectly ?
const_cast<Scalar*
>(actualLhs.data()) : static_lhs.data()));
241 (UseRhsDirectly ?
const_cast<Scalar*
>(actualRhs.data()) : static_rhs.data()));
248 ::run(actualLhs.size(),
mat.data(),
mat.outerStride(), actualLhsPtr, actualRhsPtr, actualAlpha);
252template<
typename MatrixType,
typename ProductType,
int UpLo>
259 typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhs;
265 typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhs;
269 typename ProductType::Scalar actualAlpha =
alpha * LhsBlasTraits::extractScalarFactor(
prod.
lhs().derived()) * RhsBlasTraits::extractScalarFactor(
prod.
rhs().derived());
272 mat.template triangularView<UpLo>().setZero();
276 LhsIsRowMajor = _ActualLhs::Flags&
RowMajorBit ? 1 : 0,
277 RhsIsRowMajor = _ActualRhs::Flags&
RowMajorBit ? 1 : 0,
284 Index depth = actualLhs.cols();
287 MatrixType::MaxColsAtCompileTime, MatrixType::MaxColsAtCompileTime, _ActualRhs::MaxColsAtCompileTime> BlockingType;
289 BlockingType blocking(
size,
size, depth, 1,
false);
292 typename Lhs::Scalar, LhsIsRowMajor ?
RowMajor :
ColMajor, LhsBlasTraits::NeedToConjugate,
293 typename Rhs::Scalar, RhsIsRowMajor ?
RowMajor :
ColMajor, RhsBlasTraits::NeedToConjugate,
296 &actualLhs.coeffRef(SkipDiag&&(UpLo&
Lower)==
Lower ? 1 : 0,0), actualLhs.outerStride(),
297 &actualRhs.coeffRef(0,SkipDiag&&(UpLo&
Upper)==
Upper ? 1 : 0), actualRhs.outerStride(),
298 mat.data() + (SkipDiag ? (bool(IsRowMajor) != ((UpLo&
Lower)==
Lower) ?
mat.innerStride() :
mat.outerStride() ) : 0),
299 mat.innerStride(),
mat.outerStride(), actualAlpha, blocking);
303template<
typename MatrixType,
unsigned int UpLo>
304template<
typename ProductType>
305EIGEN_DEVICE_FUNC TriangularView<MatrixType,UpLo>& TriangularViewImpl<MatrixType,UpLo,Dense>::_assignProduct(
const ProductType&
prod,
const Scalar&
alpha,
bool beta)
310 general_product_to_triangular_selector<MatrixType, ProductType, UpLo, internal::traits<ProductType>::InnerSize==1>::run(derived().nestedExpression().const_cast_derived(),
prod,
alpha, beta);
int i
Definition BiCGSTAB_step_by_step.cpp:9
#define EIGEN_PLAIN_ENUM_MAX(a, b)
Definition Macros.h:1289
#define EIGEN_PLAIN_ENUM_MIN(a, b)
Definition Macros.h:1288
#define EIGEN_DEVICE_FUNC
Definition Macros.h:976
#define eigen_assert(x)
Definition Macros.h:1037
#define EIGEN_STRONG_INLINE
Definition Macros.h:917
#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_STATIC_ASSERT(CONDITION, MSG)
Definition StaticAssert.h:127
MatrixXf mat
Definition Tutorial_AdvancedInitialization_CommaTemporary.cpp:1
int rows
Definition Tutorial_commainit_02.cpp:1
int cols
Definition Tutorial_commainit_02.cpp:1
Scalar Scalar int size
Definition benchVecAdd.cpp:17
SCALAR Scalar
Definition bench_gemm.cpp:46
MatrixXf MatrixType
Definition benchmark-blocking-sizes.cpp:52
A matrix or vector expression mapping an existing array of data.
Definition Map.h:96
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const LhsNestedCleaned & lhs() const
Definition Product.h:107
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const RhsNestedCleaned & rhs() const
Definition Product.h:109
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition Product.h:104
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition Product.h:102
Definition GeneralMatrixMatrix.h:248
@ UnitDiag
Definition Constants.h:213
@ ZeroDiag
Definition Constants.h:215
@ Lower
Definition Constants.h:209
@ Upper
Definition Constants.h:211
@ ColMajor
Definition Constants.h:319
@ RowMajor
Definition Constants.h:321
const unsigned int RowMajorBit
Definition Constants.h:66
RealScalar alpha
Definition level1_cplx_impl.h:147
DenseIndex ret
Definition level1_cplx_impl.h:44
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
const Product< Lhs, Rhs > prod(const Lhs &lhs, const Rhs &rhs)
Definition evaluators.cpp:8
@ Specialized
Definition Constants.h:310
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 void run(MatrixType &mat, const ProductType &prod, const typename MatrixType::Scalar &alpha, bool beta)
Definition GeneralMatrixMatrixTriangular.h:255
static void run(MatrixType &mat, const ProductType &prod, const typename MatrixType::Scalar &alpha, bool beta)
Definition GeneralMatrixMatrixTriangular.h:207
Definition GeneralMatrixMatrixTriangular.h:201
Definition DenseStorage.h:25
Eigen::internal::general_matrix_matrix_triangular_product< Index, LhsScalar, LhsStorageOrder, ConjugateLhs, RhsScalar, RhsStorageOrder, ConjugateRhs, ColMajor, ResInnerStride, UpLo, Version >::ResScalar ScalarBinaryOpTraits< LhsScalar, RhsScalar >::ReturnType ResScalar
Definition GeneralMatrixMatrixTriangular.h:62
Eigen::internal::general_matrix_matrix_triangular_product< Index, LhsScalar, LhsStorageOrder, ConjugateLhs, RhsScalar, RhsStorageOrder, ConjugateRhs, ColMajor, ResInnerStride, UpLo, Version >::run static EIGEN_STRONG_INLINE void run(Index size, Index depth, const LhsScalar *_lhs, Index lhsStride, const RhsScalar *_rhs, Index rhsStride, ResScalar *_res, Index resIncr, Index resStride, const ResScalar &alpha, level3_blocking< LhsScalar, RhsScalar > &blocking)
Definition GeneralMatrixMatrixTriangular.h:63
Eigen::internal::general_matrix_matrix_triangular_product< Index, LhsScalar, LhsStorageOrder, ConjugateLhs, RhsScalar, RhsStorageOrder, ConjugateRhs, RowMajor, ResInnerStride, UpLo, Version >::run static EIGEN_STRONG_INLINE void run(Index size, Index depth, const LhsScalar *lhs, Index lhsStride, const RhsScalar *rhs, Index rhsStride, ResScalar *res, Index resIncr, Index resStride, const ResScalar &alpha, level3_blocking< RhsScalar, LhsScalar > &blocking)
Definition GeneralMatrixMatrixTriangular.h:45
Eigen::internal::general_matrix_matrix_triangular_product< Index, LhsScalar, LhsStorageOrder, ConjugateLhs, RhsScalar, RhsStorageOrder, ConjugateRhs, RowMajor, ResInnerStride, UpLo, Version >::ResScalar ScalarBinaryOpTraits< LhsScalar, RhsScalar >::ReturnType ResScalar
Definition GeneralMatrixMatrixTriangular.h:44
Definition GeneralMatrixMatrixTriangular.h:36
Definition ForwardDeclarations.h:17
Definition GeneralMatrixMatrixTriangular.h:140
Traits::ResScalar ResScalar
Definition GeneralMatrixMatrixTriangular.h:142
gebp_traits< LhsScalar, RhsScalar, ConjLhs, ConjRhs > Traits
Definition GeneralMatrixMatrixTriangular.h:141
@ BlockSize
Definition GeneralMatrixMatrixTriangular.h:145
void operator()(ResScalar *_res, Index resIncr, Index resStride, const LhsScalar *blockA, const RhsScalar *blockB, Index size, Index depth, const ResScalar &alpha)
Definition GeneralMatrixMatrixTriangular.h:147
Definition GeneralMatrixMatrixTriangular.h:16
std::ptrdiff_t j
Definition tut_arithmetic_redux_minmax.cpp:2