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,
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);
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;
85 std::size_t
sizeB = kc*size;
87 ei_declare_aligned_stack_constructed_variable(LhsScalar, blockA,
sizeA,
blocking.blockA());
88 ei_declare_aligned_stack_constructed_variable(RhsScalar, blockB,
sizeB,
blocking.blockB());
114 (std::min)(size,
i2), alpha, -1, -1, 0, 0);
138template<
typename LhsScalar,
typename RhsScalar,
typename Index,
int mr,
int nr,
bool ConjLhs,
bool ConjRhs,
int ResInnerStr
ide,
int UpLo>
142 typedef typename Traits::ResScalar ResScalar;
159 for (
Index j=0; j<size; j+=BlockSize)
162 const RhsScalar*
actual_b = blockB+j*depth;
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>
207 static void run(MatrixType&
mat,
const ProductType& prod,
const typename MatrixType::Scalar& alpha,
bool beta)
209 typedef typename MatrixType::Scalar Scalar;
211 typedef typename internal::remove_all<typename ProductType::LhsNested>::type Lhs;
213 typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhs;
214 typedef typename internal::remove_all<ActualLhs>::type
_ActualLhs;
215 typename internal::add_const_on_value_type<ActualLhs>::type
actualLhs = LhsBlasTraits::extract(prod.lhs());
217 typedef typename internal::remove_all<typename ProductType::RhsNested>::type Rhs;
219 typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhs;
220 typedef typename internal::remove_all<ActualRhs>::type
_ActualRhs;
221 typename internal::add_const_on_value_type<ActualRhs>::type
actualRhs = RhsBlasTraits::extract(prod.rhs());
223 Scalar
actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(prod.lhs().derived()) * RhsBlasTraits::extractScalarFactor(prod.rhs().derived());
252template<
typename MatrixType,
typename ProductType,
int UpLo>
255 static void run(MatrixType&
mat,
const ProductType& prod,
const typename MatrixType::Scalar& alpha,
bool beta)
257 typedef typename internal::remove_all<typename ProductType::LhsNested>::type Lhs;
259 typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhs;
260 typedef typename internal::remove_all<ActualLhs>::type
_ActualLhs;
261 typename internal::add_const_on_value_type<ActualLhs>::type
actualLhs = LhsBlasTraits::extract(prod.lhs());
263 typedef typename internal::remove_all<typename ProductType::RhsNested>::type Rhs;
265 typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhs;
266 typedef typename internal::remove_all<ActualRhs>::type
_ActualRhs;
267 typename internal::add_const_on_value_type<ActualRhs>::type
actualRhs = RhsBlasTraits::extract(prod.rhs());
269 typename ProductType::Scalar
actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(prod.lhs().derived()) * RhsBlasTraits::extractScalarFactor(prod.rhs().derived());
287 MatrixType::MaxColsAtCompileTime, MatrixType::MaxColsAtCompileTime, _ActualRhs::MaxColsAtCompileTime>
BlockingType;
298 mat.data() + (SkipDiag ? (bool(IsRowMajor) != ((UpLo&
Lower)==
Lower) ?
mat.innerStride() :
mat.outerStride() ) : 0),
303template <
typename _MatrixType,
unsigned int _Mode>
304template <
typename ProductType>
308 EIGEN_STATIC_ASSERT((
_Mode &
UnitDiag) == 0, WRITING_TO_TRIANGULAR_PART_WITH_UNIT_DIAGONAL_IS_NOT_SUPPORTED);
309 eigen_assert(derived().nestedExpression().rows() ==
prod.rows() && derived().cols() ==
prod.cols());
314 .const_cast_derived(),
EIGEN_DEVICE_FUNC Scalar prod() const
Definition Redux.h:493
EIGEN_DEVICE_FUNC Derived & setZero()
Sets all coefficients in this expression to zero.
Definition CwiseNullaryOp.h:546
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Definition TriangularMatrix.h:183
Definition GeneralMatrixMatrix.h:248
@ UnitDiag
Matrix has ones on the diagonal; to be used in combination with #Lower or #Upper.
Definition Constants.h:213
@ ZeroDiag
Matrix has zeros on the diagonal; to be used in combination with #Lower or #Upper.
Definition Constants.h:215
@ Lower
View matrix as a lower triangular matrix.
Definition Constants.h:209
@ Upper
View matrix as an upper triangular matrix.
Definition Constants.h:211
@ ColMajor
Storage order is column major (see TopicStorageOrders).
Definition Constants.h:319
@ RowMajor
Storage order is row major (see TopicStorageOrders).
Definition Constants.h:321
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition Constants.h:66
Namespace containing all symbols from the Eigen library.
Definition LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
Holds information about the various numeric (i.e.
Definition NumTraits.h:236
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
Definition XprHelper.h:806
Definition GeneralMatrixMatrixTriangular.h:201
Definition BlasUtil.h:403
Definition DenseStorage.h:25
Definition GeneralProduct.h:161
Definition GeneralMatrixMatrixTriangular.h:36
Definition ForwardDeclarations.h:17
Definition GeneralMatrixMatrixTriangular.h:140
Definition GeneralMatrixMatrixTriangular.h:16