10 #ifndef EIGEN_HOMOGENEOUS_H
11 #define EIGEN_HOMOGENEOUS_H
35 template <
typename MatrixType,
int Direction>
41 RowsPlusOne = (MatrixType::RowsAtCompileTime !=
Dynamic) ?
int(MatrixType::RowsAtCompileTime) + 1 :
Dynamic,
42 ColsPlusOne = (MatrixType::ColsAtCompileTime !=
Dynamic) ?
int(MatrixType::ColsAtCompileTime) + 1 :
Dynamic,
45 MaxRowsAtCompileTime = RowsAtCompileTime,
46 MaxColsAtCompileTime = ColsAtCompileTime,
54 template <
typename MatrixType,
typename Lhs>
56 template <
typename MatrixType,
typename Rhs>
61 template <
typename MatrixType,
int Direction_>
81 template <
typename Rhs>
87 template <
typename Lhs>
94 template <
typename Scalar,
int Dim,
int Mode,
int Options>
101 template <
typename Func>
103 const Func&
func)
const {
125 template <
typename Derived>
142 template <
typename ExpressionType,
int Direction>
165 template <
typename Derived>
170 ColsAtCompileTime == 1 ? 1 :
size() - 1) /
189 template <
typename ExpressionType,
int Direction>
196 ? HNormalized_SizeMinusOne
207 template <
typename MatrixOrTransformType>
209 typedef MatrixOrTransformType
type;
213 template <
typename Scalar,
int Dim,
int Mode,
int Options>
216 typedef std::add_const_t<typename TransformType::ConstAffinePart>
type;
220 template <
typename Scalar,
int Dim,
int Options>
227 template <
typename MatrixType,
typename Lhs>
234 MatrixTypeCleaned::ColsAtCompileTime, MatrixTypeCleaned::PlainObject::Options,
235 LhsMatrixTypeCleaned::MaxRowsAtCompileTime, MatrixTypeCleaned::MaxColsAtCompileTime>
::type ReturnType;
238 template <
typename MatrixType,
typename Lhs>
240 :
public ReturnByValue<homogeneous_left_product_impl<Homogeneous<MatrixType, Vertical>, Lhs> > {
250 template <
typename Dest>
254 LhsMatrixTypeNested::ColsAtCompileTime ==
Dynamic
256 : LhsMatrixTypeNested::ColsAtCompileTime - 1 > (m_lhs, 0, 0, m_lhs.rows(), m_lhs.cols() - 1) * m_rhs;
257 dst += m_lhs.col(m_lhs.cols() - 1).rowwise().template replicate<MatrixType::ColsAtCompileTime>(m_rhs.cols());
260 typename LhsMatrixTypeCleaned::Nested
m_lhs;
264 template <
typename MatrixType,
typename Rhs>
268 Rhs::ColsAtCompileTime, MatrixType::PlainObject::Options,
272 template <
typename MatrixType,
typename Rhs>
274 :
public ReturnByValue<homogeneous_right_product_impl<Homogeneous<MatrixType, Horizontal>, Rhs> > {
281 template <
typename Dest>
285 RhsNested::RowsAtCompileTime ==
Dynamic ?
Dynamic : RhsNested::RowsAtCompileTime - 1,
286 RhsNested::ColsAtCompileTime > (m_rhs, 0, 0, m_rhs.rows() - 1, m_rhs.cols());
287 dst += m_rhs.row(m_rhs.rows() - 1).colwise().template replicate<MatrixType::RowsAtCompileTime>(m_lhs.rows());
294 template <
typename ArgType,
int Direction>
305 template <
typename ArgType,
int Direction>
307 :
evaluator<typename Homogeneous<ArgType, Direction>::PlainObject> {
313 internal::construct_at<Base>(
this, m_temp);
321 template <
typename DstXprType,
typename ArgType,
typename Scalar>
329 if ((dst.rows() != dstRows) || (dst.cols() != dstCols)) dst.resize(dstRows, dstCols);
332 dst.row(dst.rows() - 1).setOnes();
337 template <
typename DstXprType,
typename ArgType,
typename Scalar>
345 if ((dst.rows() != dstRows) || (dst.cols() != dstCols)) dst.resize(dstRows, dstCols);
348 dst.col(dst.cols() - 1).setOnes();
352 template <
typename LhsArg,
typename Rhs,
int ProductTag>
354 template <
typename Dest>
360 template <
typename Lhs,
typename Rhs>
362 enum {
Dim = Lhs::ColsAtCompileTime,
Rows = Lhs::RowsAtCompileTime };
373 template <
typename Lhs,
typename Rhs,
int ProductTag>
376 typename homogeneous_right_product_refactoring_helper<typename Lhs::NestedExpression, Rhs>::Xpr> {
384 :
Base(xpr.lhs().nestedExpression().lazyProduct(
385 xpr.rhs().template topRows<
helper::
Dim>(xpr.lhs().nestedExpression().
cols())) +
389 template <
typename Lhs,
typename RhsArg,
int ProductTag>
391 template <
typename Dest>
399 template <
typename Lhs,
typename RhsArg,
int ProductTag>
401 template <
typename Dest>
403 dst.noalias() = lhs * rhs.
eval();
407 template <
typename Lhs,
typename Rhs>
409 enum {
Dim = Rhs::RowsAtCompileTime,
Cols = Rhs::ColsAtCompileTime };
420 template <
typename Lhs,
typename Rhs,
int ProductTag>
422 :
public evaluator<typename homogeneous_left_product_refactoring_helper<Lhs, typename Rhs::NestedExpression>::Xpr> {
431 .template leftCols<
helper::
Dim>(xpr.rhs().nestedExpression().
rows())
432 .lazyProduct(xpr.rhs().nestedExpression()) +
436 template <
typename Scalar,
int Dim,
int Mode,
int Options,
typename RhsArg,
int ProductTag>
440 template <
typename Dest>
447 template <
typename ExpressionType,
int S
ide,
bool Transposed>
Direction
An enum that indicates the direction in Cartesian coordinates.
Definition: GeneralDefine.h:56
#define EIGEN_NOEXCEPT
Definition: Macros.h:1267
#define EIGEN_CONSTEXPR
Definition: Macros.h:758
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
Definition: Macros.h:1171
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Definition: StaticAssert.h:36
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:45
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:110
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:79
std::conditional_t< internal::is_same< typename internal::traits< Homogeneous< MatrixType, Direction_ > >::XprKind, MatrixXpr >::value, PlainMatrix, PlainArray > PlainObject
The plain matrix or array type corresponding to this expression.
Definition: DenseBase.h:204
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EvalReturnType eval() const
Definition: DenseBase.h:381
internal::traits< Homogeneous< MatrixType, Direction_ > >::Scalar Scalar
Definition: DenseBase.h:62
Expression of one (or a set of) homogeneous vector(s)
Definition: Homogeneous.h:62
friend EIGEN_DEVICE_FUNC const Product< Transform< Scalar, Dim, Mode, Options >, Homogeneous > operator*(const Transform< Scalar, Dim, Mode, Options > &lhs, const Homogeneous &rhs)
Definition: Homogeneous.h:95
EIGEN_DEVICE_FUNC const NestedExpression & nestedExpression() const
Definition: Homogeneous.h:79
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::result_of< Func(Scalar, Scalar)>::type redux(const Func &func) const
Definition: Homogeneous.h:102
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: Homogeneous.h:72
MatrixBase< Homogeneous > Base
Definition: Homogeneous.h:67
MatrixType NestedExpression
Definition: Homogeneous.h:64
EIGEN_DEVICE_FUNC const Product< Homogeneous, Rhs > operator*(const MatrixBase< Rhs > &rhs) const
Definition: Homogeneous.h:82
friend EIGEN_DEVICE_FUNC const Product< Lhs, Homogeneous > operator*(const MatrixBase< Lhs > &lhs, const Homogeneous &rhs)
Definition: Homogeneous.h:88
MatrixType::Nested m_matrix
Definition: Homogeneous.h:108
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: Homogeneous.h:75
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52
EIGEN_DEVICE_FUNC MatrixBase< Homogeneous< MatrixType, Direction_ > > & matrix()
Definition: MatrixBase.h:315
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:202
Expression of the multiple replication of a matrix or vector.
Definition: Replicate.h:64
Definition: ReturnByValue.h:50
Definition: XprHelper.h:352
Definition: XprHelper.h:134
EIGEN_DEVICE_FUNC HomogeneousReturnType homogeneous() const
Definition: Homogeneous.h:143
EIGEN_DEVICE_FUNC HomogeneousReturnType homogeneous() const
Definition: Homogeneous.h:126
EIGEN_DEVICE_FUNC const HNormalizedReturnType hnormalized() const
column or row-wise homogeneous normalization
Definition: Homogeneous.h:191
EIGEN_DEVICE_FUNC const HNormalizedReturnType hnormalized() const
homogeneous normalization
Definition: Homogeneous.h:166
@ LazyProduct
Definition: Constants.h:504
@ Horizontal
Definition: Constants.h:269
@ Vertical
Definition: Constants.h:266
@ Projective
Definition: Constants.h:462
const unsigned int RowMajorBit
Definition: Constants.h:70
func(actual_m, actual_n, a, *lda, actual_b, 1, actual_c, 1, alpha)
char char * op
Definition: level2_impl.h:374
@ Lhs
Definition: TensorContractionMapper.h:20
@ Rhs
Definition: TensorContractionMapper.h:20
typename remove_all< T >::type remove_all_t
Definition: Meta.h:142
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
auto run(Kernel kernel, Args &&... args) -> decltype(kernel(args...))
Definition: gpu_test_helper.h:414
const unsigned int HereditaryBits
Definition: Constants.h:198
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
const int Dynamic
Definition: Constants.h:25
Extend namespace for flags.
Definition: fsi_chan_precond_driver.cc:56
static const unsigned Dim
Problem dimension.
Definition: two_d_tilted_square.cc:62
type
Definition: compute_granudrum_aor.py:141
Definition: Eigen_Colamd.h:49
list x
Definition: plotDoE.py:28
Type
Type of JSON value.
Definition: rapidjson.h:513
Definition: Constants.h:540
Definition: Constants.h:546
Definition: Constants.h:558
Dense2Dense Kind
Definition: Homogeneous.h:302
Definition: AssignEvaluator.h:760
Homogeneous< ArgType, Horizontal > SrcXprType
Definition: Homogeneous.h:340
static EIGEN_DEVICE_FUNC void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op< Scalar, typename ArgType::Scalar > &)
Definition: Homogeneous.h:341
static EIGEN_DEVICE_FUNC void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op< Scalar, typename ArgType::Scalar > &)
Definition: Homogeneous.h:325
Homogeneous< ArgType, Vertical > SrcXprType
Definition: Homogeneous.h:324
Definition: AssignEvaluator.h:773
Definition: AssignEvaluator.h:756
Definition: Constants.h:577
Template functor for scalar/packet assignment.
Definition: AssignmentFunctors.h:25
storage_kind_to_evaluator_kind< typename ArgType::StorageKind >::Kind Kind
Definition: Homogeneous.h:296
HomogeneousShape Shape
Definition: Homogeneous.h:297
Definition: CoreEvaluators.h:95
Definition: CoreEvaluators.h:104
static EIGEN_DEVICE_FUNC void evalTo(Dest &dst, const Homogeneous< LhsArg, Horizontal > &lhs, const Rhs &rhs)
Definition: Homogeneous.h:355
static void evalTo(Dest &dst, const Lhs &lhs, const Homogeneous< RhsArg, Vertical > &rhs)
Definition: Homogeneous.h:402
static EIGEN_DEVICE_FUNC void evalTo(Dest &dst, const Lhs &lhs, const Homogeneous< RhsArg, Vertical > &rhs)
Definition: Homogeneous.h:392
Definition: ProductEvaluators.h:78
remove_all_t< LhsMatrixType > LhsMatrixTypeCleaned
Definition: Homogeneous.h:242
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: Homogeneous.h:248
remove_all_t< typename LhsMatrixTypeCleaned::Nested > LhsMatrixTypeNested
Definition: Homogeneous.h:243
EIGEN_DEVICE_FUNC homogeneous_left_product_impl(const Lhs &lhs, const MatrixType &rhs)
Definition: Homogeneous.h:244
MatrixType::Nested m_rhs
Definition: Homogeneous.h:261
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: Homogeneous.h:247
LhsMatrixTypeCleaned::Nested m_lhs
Definition: Homogeneous.h:260
traits< homogeneous_left_product_impl >::LhsMatrixType LhsMatrixType
Definition: Homogeneous.h:241
EIGEN_DEVICE_FUNC void evalTo(Dest &dst) const
Definition: Homogeneous.h:251
Definition: Homogeneous.h:55
Definition: Homogeneous.h:408
Product< LinearBlock, Rhs, LazyProduct > LinearProduct
Definition: Homogeneous.h:414
Replicate< const ConstantColumn, 1, Cols > ConstantBlock
Definition: Homogeneous.h:413
Lhs::ConstColXpr ConstantColumn
Definition: Homogeneous.h:412
CwiseBinaryOp< internal::scalar_sum_op< typename Lhs::Scalar, typename Rhs::Scalar >, const LinearProduct, const ConstantBlock > Xpr
Definition: Homogeneous.h:417
std::remove_const_t< LinearBlockConst > LinearBlock
Definition: Homogeneous.h:411
Lhs::template ConstNColsBlockXpr< Dim >::Type LinearBlockConst
Definition: Homogeneous.h:410
@ Cols
Definition: Homogeneous.h:409
@ Dim
Definition: Homogeneous.h:409
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: Homogeneous.h:278
Rhs::Nested m_rhs
Definition: Homogeneous.h:291
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: Homogeneous.h:279
EIGEN_DEVICE_FUNC void evalTo(Dest &dst) const
Definition: Homogeneous.h:282
remove_all_t< typename Rhs::Nested > RhsNested
Definition: Homogeneous.h:275
EIGEN_DEVICE_FUNC homogeneous_right_product_impl(const MatrixType &lhs, const Rhs &rhs)
Definition: Homogeneous.h:276
MatrixType::Nested m_lhs
Definition: Homogeneous.h:290
Definition: Homogeneous.h:57
Definition: Homogeneous.h:361
@ Dim
Definition: Homogeneous.h:362
@ Rows
Definition: Homogeneous.h:362
Product< Lhs, LinearBlock, LazyProduct > LinearProduct
Definition: Homogeneous.h:367
Rhs::ConstRowXpr ConstantColumn
Definition: Homogeneous.h:365
CwiseBinaryOp< internal::scalar_sum_op< typename Lhs::Scalar, typename Rhs::Scalar >, const LinearProduct, const ConstantBlock > Xpr
Definition: Homogeneous.h:370
Rhs::template ConstNRowsBlockXpr< Dim >::Type LinearBlockConst
Definition: Homogeneous.h:363
std::remove_const_t< LinearBlockConst > LinearBlock
Definition: Homogeneous.h:364
Replicate< const ConstantColumn, Rows, 1 > ConstantBlock
Definition: Homogeneous.h:366
Definition: ProductEvaluators.h:965
homogeneous_left_product_refactoring_helper< Lhs, typename Rhs::NestedExpression > helper
Definition: Homogeneous.h:424
helper::Xpr RefactoredXpr
Definition: Homogeneous.h:426
helper::ConstantBlock ConstantBlock
Definition: Homogeneous.h:425
Product< Lhs, Rhs, LazyProduct > XprType
Definition: Homogeneous.h:423
EIGEN_DEVICE_FUNC product_evaluator(const XprType &xpr)
Definition: Homogeneous.h:429
evaluator< RefactoredXpr > Base
Definition: Homogeneous.h:427
homogeneous_right_product_refactoring_helper< typename Lhs::NestedExpression, Rhs > helper
Definition: Homogeneous.h:378
EIGEN_DEVICE_FUNC product_evaluator(const XprType &xpr)
Definition: Homogeneous.h:383
Product< Lhs, Rhs, LazyProduct > XprType
Definition: Homogeneous.h:377
evaluator< RefactoredXpr > Base
Definition: Homogeneous.h:381
helper::ConstantBlock ConstantBlock
Definition: Homogeneous.h:379
helper::Xpr RefactoredXpr
Definition: Homogeneous.h:380
Definition: ForwardDeclarations.h:221
Definition: XprHelper.h:506
Definition: Homogeneous.h:208
static EIGEN_DEVICE_FUNC const type & run(const type &x)
Definition: Homogeneous.h:210
MatrixOrTransformType type
Definition: Homogeneous.h:209
std::remove_reference_t< MatrixTypeNested > MatrixTypeNested_
Definition: Homogeneous.h:39
ref_selector< MatrixType >::type MatrixTypeNested
Definition: Homogeneous.h:38
traits< MatrixType >::StorageKind StorageKind
Definition: Homogeneous.h:37
remove_all_t< LhsMatrixType > LhsMatrixTypeCleaned
Definition: Homogeneous.h:231
take_matrix_for_product< Lhs >::type LhsMatrixType
Definition: Homogeneous.h:229
remove_all_t< MatrixType > MatrixTypeCleaned
Definition: Homogeneous.h:230
make_proper_matrix_type< typename traits< MatrixTypeCleaned >::Scalar, LhsMatrixTypeCleaned::RowsAtCompileTime, MatrixTypeCleaned::ColsAtCompileTime, MatrixTypeCleaned::PlainObject::Options, LhsMatrixTypeCleaned::MaxRowsAtCompileTime, MatrixTypeCleaned::MaxColsAtCompileTime >::type ReturnType
Definition: Homogeneous.h:235
make_proper_matrix_type< typename traits< MatrixType >::Scalar, MatrixType::RowsAtCompileTime, Rhs::ColsAtCompileTime, MatrixType::PlainObject::Options, MatrixType::MaxRowsAtCompileTime, Rhs::MaxColsAtCompileTime >::type ReturnType
Definition: Homogeneous.h:269
Definition: ForwardDeclarations.h:21
evaluator< PlainObject > Base
Definition: Homogeneous.h:310
EIGEN_DEVICE_FUNC unary_evaluator(const XprType &op)
Definition: Homogeneous.h:312
Homogeneous< ArgType, Direction > XprType
Definition: Homogeneous.h:308
XprType::PlainObject PlainObject
Definition: Homogeneous.h:309
PlainObject m_temp
Definition: Homogeneous.h:317
Definition: CoreEvaluators.h:82
Definition: benchGeometry.cpp:21