VectorwiseOp.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2008-2019 Gael Guennebaud <gael.guennebaud@inria.fr>
5 // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #ifndef EIGEN_PARTIAL_REDUX_H
12 #define EIGEN_PARTIAL_REDUX_H
13 
14 namespace Eigen {
15 
32 template< typename MatrixType, typename MemberOp, int Direction>
33 class PartialReduxExpr;
34 
35 namespace internal {
36 template<typename MatrixType, typename MemberOp, int Direction>
37 struct traits<PartialReduxExpr<MatrixType, MemberOp, Direction> >
38  : traits<MatrixType>
39 {
40  typedef typename MemberOp::result_type Scalar;
43  typedef typename MatrixType::Scalar InputScalar;
44  enum {
45  RowsAtCompileTime = Direction==Vertical ? 1 : MatrixType::RowsAtCompileTime,
46  ColsAtCompileTime = Direction==Horizontal ? 1 : MatrixType::ColsAtCompileTime,
47  MaxRowsAtCompileTime = Direction==Vertical ? 1 : MatrixType::MaxRowsAtCompileTime,
48  MaxColsAtCompileTime = Direction==Horizontal ? 1 : MatrixType::MaxColsAtCompileTime,
49  Flags = RowsAtCompileTime == 1 ? RowMajorBit : 0,
50  TraversalSize = Direction==Vertical ? MatrixType::RowsAtCompileTime : MatrixType::ColsAtCompileTime
51  };
52 };
53 }
54 
55 template< typename MatrixType, typename MemberOp, int Direction>
56 class PartialReduxExpr : public internal::dense_xpr_base< PartialReduxExpr<MatrixType, MemberOp, Direction> >::type,
57  internal::no_assignment_operator
58 {
59  public:
60 
63 
65  explicit PartialReduxExpr(const MatrixType& mat, const MemberOp& func = MemberOp())
66  : m_matrix(mat), m_functor(func) {}
67 
69  Index rows() const EIGEN_NOEXCEPT { return (Direction==Vertical ? 1 : m_matrix.rows()); }
71  Index cols() const EIGEN_NOEXCEPT { return (Direction==Horizontal ? 1 : m_matrix.cols()); }
72 
74  typename MatrixType::Nested nestedExpression() const { return m_matrix; }
75 
77  const MemberOp& functor() const { return m_functor; }
78 
79  protected:
80  typename MatrixType::Nested m_matrix;
81  const MemberOp m_functor;
82 };
83 
84 template<typename A,typename B> struct partial_redux_dummy_func;
85 
86 #define EIGEN_MAKE_PARTIAL_REDUX_FUNCTOR(MEMBER,COST,VECTORIZABLE,BINARYOP) \
87  template <typename ResultType,typename Scalar> \
88  struct member_##MEMBER { \
89  EIGEN_EMPTY_STRUCT_CTOR(member_##MEMBER) \
90  typedef ResultType result_type; \
91  typedef BINARYOP<Scalar,Scalar> BinaryOp; \
92  template<int Size> struct Cost { enum { value = COST }; }; \
93  enum { Vectorizable = VECTORIZABLE }; \
94  template<typename XprType> \
95  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE \
96  ResultType operator()(const XprType& mat) const \
97  { return mat.MEMBER(); } \
98  BinaryOp binaryFunc() const { return BinaryOp(); } \
99  }
100 
101 #define EIGEN_MEMBER_FUNCTOR(MEMBER,COST) \
102  EIGEN_MAKE_PARTIAL_REDUX_FUNCTOR(MEMBER,COST,0,partial_redux_dummy_func)
103 
104 namespace internal {
105 
109 EIGEN_MEMBER_FUNCTOR(hypotNorm, (Size-1) * functor_traits<scalar_hypot_op<Scalar> >::Cost );
113 
114 EIGEN_MAKE_PARTIAL_REDUX_FUNCTOR(sum, (Size-1)*NumTraits<Scalar>::AddCost, 1, internal::scalar_sum_op);
115 EIGEN_MAKE_PARTIAL_REDUX_FUNCTOR(minCoeff, (Size-1)*NumTraits<Scalar>::AddCost, 1, internal::scalar_min_op);
116 EIGEN_MAKE_PARTIAL_REDUX_FUNCTOR(maxCoeff, (Size-1)*NumTraits<Scalar>::AddCost, 1, internal::scalar_max_op);
117 EIGEN_MAKE_PARTIAL_REDUX_FUNCTOR(prod, (Size-1)*NumTraits<Scalar>::MulCost, 1, internal::scalar_product_op);
118 
119 template <int p, typename ResultType,typename Scalar>
121  typedef ResultType result_type;
122  enum { Vectorizable = 0 };
123  template<int Size> struct Cost
124  { enum { value = (Size+5) * NumTraits<Scalar>::MulCost + (Size-1)*NumTraits<Scalar>::AddCost }; };
126  template<typename XprType>
127  EIGEN_DEVICE_FUNC inline ResultType operator()(const XprType& mat) const
128  { return mat.template lpNorm<p>(); }
129 };
130 
131 template <typename BinaryOpT, typename Scalar>
132 struct member_redux {
133  typedef BinaryOpT BinaryOp;
134  typedef typename result_of<
135  BinaryOp(const Scalar&,const Scalar&)
137 
139  template<int Size> struct Cost { enum { value = (Size-1) * functor_traits<BinaryOp>::Cost }; };
141  template<typename Derived>
143  { return mat.redux(m_functor); }
144  const BinaryOp& binaryFunc() const { return m_functor; }
146 };
147 }
148 
186 template<typename ExpressionType, int Direction> class VectorwiseOp
187 {
188  public:
189 
190  typedef typename ExpressionType::Scalar Scalar;
192  typedef Eigen::Index Index;
195 
196  template<template<typename OutScalar,typename InputScalar> class Functor,
197  typename ReturnScalar=Scalar> struct ReturnType
198  {
199  typedef PartialReduxExpr<ExpressionType,
201  Direction
202  > Type;
203  };
204 
205  template<typename BinaryOp> struct ReduxReturnType
206  {
207  typedef PartialReduxExpr<ExpressionType,
209  Direction
210  > Type;
211  };
212 
213  enum {
214  isVertical = (Direction==Vertical) ? 1 : 0,
215  isHorizontal = (Direction==Horizontal) ? 1 : 0
216  };
217 
218  protected:
219 
220  template<typename OtherDerived> struct ExtendedType {
221  typedef Replicate<OtherDerived,
222  isVertical ? 1 : ExpressionType::RowsAtCompileTime,
223  isHorizontal ? 1 : ExpressionType::ColsAtCompileTime> Type;
224  };
225 
228  template<typename OtherDerived>
232  {
233  EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(isVertical, OtherDerived::MaxColsAtCompileTime==1),
234  YOU_PASSED_A_ROW_VECTOR_BUT_A_COLUMN_VECTOR_WAS_EXPECTED)
235  EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(isHorizontal, OtherDerived::MaxRowsAtCompileTime==1),
236  YOU_PASSED_A_COLUMN_VECTOR_BUT_A_ROW_VECTOR_WAS_EXPECTED)
237  return typename ExtendedType<OtherDerived>::Type
238  (other.derived(),
239  isVertical ? 1 : m_matrix.rows(),
240  isHorizontal ? 1 : m_matrix.cols());
241  }
242 
243  template<typename OtherDerived> struct OppositeExtendedType {
244  typedef Replicate<OtherDerived,
245  isHorizontal ? 1 : ExpressionType::RowsAtCompileTime,
246  isVertical ? 1 : ExpressionType::ColsAtCompileTime> Type;
247  };
248 
251  template<typename OtherDerived>
255  {
256  EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(isHorizontal, OtherDerived::MaxColsAtCompileTime==1),
257  YOU_PASSED_A_ROW_VECTOR_BUT_A_COLUMN_VECTOR_WAS_EXPECTED)
258  EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(isVertical, OtherDerived::MaxRowsAtCompileTime==1),
259  YOU_PASSED_A_COLUMN_VECTOR_BUT_A_ROW_VECTOR_WAS_EXPECTED)
261  (other.derived(),
262  isHorizontal ? 1 : m_matrix.rows(),
263  isVertical ? 1 : m_matrix.cols());
264  }
265 
266  public:
268  explicit inline VectorwiseOp(ExpressionType& matrix) : m_matrix(matrix) {}
269 
272  inline const ExpressionType& _expression() const { return m_matrix; }
273 
274  #ifdef EIGEN_PARSED_BY_DOXYGEN
275 
278  random_access_iterator_type iterator;
280  random_access_iterator_type const_iterator;
281  #else
282  typedef internal::subvector_stl_iterator<ExpressionType, DirectionType(Direction)> iterator;
283  typedef internal::subvector_stl_iterator<const ExpressionType, DirectionType(Direction)> const_iterator;
286  #endif
287 
291  iterator begin() { return iterator (m_matrix, 0); }
293  const_iterator begin() const { return const_iterator(m_matrix, 0); }
296 
305 
309  iterator end() { return iterator (m_matrix, m_matrix.template subVectors<DirectionType(Direction)>()); }
311  const_iterator end() const { return const_iterator(m_matrix, m_matrix.template subVectors<DirectionType(Direction)>()); }
313  const_iterator cend() const { return const_iterator(m_matrix, m_matrix.template subVectors<DirectionType(Direction)>()); }
314 
323 
334  template<typename BinaryOp>
336  const typename ReduxReturnType<BinaryOp>::Type
337  redux(const BinaryOp& func = BinaryOp()) const
338  {
339  eigen_assert(redux_length()>0 && "you are using an empty matrix");
341  }
342 
351  typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(SumReturnType,Scalar,quotient) MeanReturnType;
358 
359  template<int p> struct LpNormReturnType {
361  };
362 
377  {
378  eigen_assert(redux_length()>0 && "you are using an empty matrix");
380  }
381 
396  {
397  eigen_assert(redux_length()>0 && "you are using an empty matrix");
399  }
400 
411  { return SquaredNormReturnType(m_matrix.cwiseAbs2()); }
412 
422  const NormReturnType norm() const
423  { return NormReturnType(squaredNorm()); }
424 
433  template<int p>
435  const typename LpNormReturnType<p>::Type lpNorm() const
436  { return typename LpNormReturnType<p>::Type(_expression()); }
437 
438 
447  { return BlueNormReturnType(_expression()); }
448 
449 
458  { return StableNormReturnType(_expression()); }
459 
460 
469  { return HypotNormReturnType(_expression()); }
470 
479  const SumReturnType sum() const
480  { return SumReturnType(_expression()); }
481 
487  const MeanReturnType mean() const
488  { return sum() / Scalar(Direction==Vertical?m_matrix.rows():m_matrix.cols()); }
489 
496  const AllReturnType all() const
497  { return AllReturnType(_expression()); }
498 
505  const AnyReturnType any() const
506  { return AnyReturnType(_expression()); }
507 
518  const CountReturnType count() const
519  { return CountReturnType(_expression()); }
520 
529  const ProdReturnType prod() const
530  { return ProdReturnType(_expression()); }
531 
532 
542  { return ConstReverseReturnType( _expression() ); }
543 
550  { return ReverseReturnType( _expression() ); }
551 
555 
564  // NOTE implemented here because of sunstudio's compilation errors
565  // isVertical*Factor+isHorizontal instead of (isVertical?Factor:1) to handle CUDA bug with ternary operator
568  replicate(Index factor = Factor) const
569  {
572  }
573 
575 
577  template<typename OtherDerived>
579  ExpressionType& operator=(const DenseBase<OtherDerived>& other)
580  {
581  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
582  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
583  //eigen_assert((m_matrix.isNull()) == (other.isNull())); FIXME
584  return m_matrix = extendedTo(other.derived());
585  }
586 
588  template<typename OtherDerived>
590  ExpressionType& operator+=(const DenseBase<OtherDerived>& other)
591  {
592  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
593  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
594  return m_matrix += extendedTo(other.derived());
595  }
596 
598  template<typename OtherDerived>
600  ExpressionType& operator-=(const DenseBase<OtherDerived>& other)
601  {
602  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
603  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
604  return m_matrix -= extendedTo(other.derived());
605  }
606 
608  template<typename OtherDerived>
610  ExpressionType& operator*=(const DenseBase<OtherDerived>& other)
611  {
612  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
613  EIGEN_STATIC_ASSERT_ARRAYXPR(ExpressionType)
614  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
615  m_matrix *= extendedTo(other.derived());
616  return m_matrix;
617  }
618 
620  template<typename OtherDerived>
622  ExpressionType& operator/=(const DenseBase<OtherDerived>& other)
623  {
624  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
625  EIGEN_STATIC_ASSERT_ARRAYXPR(ExpressionType)
626  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
627  m_matrix /= extendedTo(other.derived());
628  return m_matrix;
629  }
630 
632  template<typename OtherDerived> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
635  const typename ExtendedType<OtherDerived>::Type>
637  {
638  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
639  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
640  return m_matrix + extendedTo(other.derived());
641  }
642 
644  template<typename OtherDerived>
648  const typename ExtendedType<OtherDerived>::Type>
650  {
651  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
652  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
653  return m_matrix - extendedTo(other.derived());
654  }
655 
658  template<typename OtherDerived> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
661  const typename ExtendedType<OtherDerived>::Type>
664  {
665  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
666  EIGEN_STATIC_ASSERT_ARRAYXPR(ExpressionType)
667  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
668  return m_matrix * extendedTo(other.derived());
669  }
670 
673  template<typename OtherDerived>
677  const typename ExtendedType<OtherDerived>::Type>
679  {
680  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
681  EIGEN_STATIC_ASSERT_ARRAYXPR(ExpressionType)
682  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
683  return m_matrix / extendedTo(other.derived());
684  }
685 
694  normalized() const { return m_matrix.cwiseQuotient(extendedToOpposite(this->norm())); }
695 
696 
701  m_matrix = this->normalized();
702  }
703 
704  EIGEN_DEVICE_FUNC inline void reverseInPlace();
705 
707 
711 
712  typedef typename ExpressionType::PlainObject CrossReturnType;
713  template<typename OtherDerived>
716 
717  enum {
721  };
722  typedef Block<const ExpressionType,
724  : int(internal::traits<ExpressionType>::RowsAtCompileTime),
726  : int(internal::traits<ExpressionType>::ColsAtCompileTime)>
728  typedef Block<const ExpressionType,
733  const HNormalized_Block,
735  Direction==Vertical ? HNormalized_SizeMinusOne : 1,
736  Direction==Horizontal ? HNormalized_SizeMinusOne : 1> >
738 
740  const HNormalizedReturnType hnormalized() const;
741 
742 # ifdef EIGEN_VECTORWISEOP_PLUGIN
743 # include EIGEN_VECTORWISEOP_PLUGIN
744 # endif
745 
746  protected:
748  {
749  return Direction==Vertical ? m_matrix.rows() : m_matrix.cols();
750  }
752 };
753 
754 //const colwise moved to DenseBase.h due to CUDA compiler bug
755 
756 
761 template<typename Derived>
764 {
765  return ColwiseReturnType(derived());
766 }
767 
768 //const rowwise moved to DenseBase.h due to CUDA compiler bug
769 
770 
775 template<typename Derived>
778 {
779  return RowwiseReturnType(derived());
780 }
781 
782 } // end namespace Eigen
783 
784 #endif // EIGEN_PARTIAL_REDUX_H
Eigen::DenseBase::RowwiseReturnType
VectorwiseOp< Derived, Horizontal > RowwiseReturnType
Definition: DenseBase.h:537
Eigen::VectorwiseOp::ReduxReturnType
Definition: VectorwiseOp.h:205
Eigen::VectorwiseOp::cross
const EIGEN_DEVICE_FUNC CrossReturnType cross(const MatrixBase< OtherDerived > &other) const
Definition: OrthoMethods.h:111
Eigen::VectorwiseOp::ProdReturnType
ReturnType< internal::member_prod >::Type ProdReturnType
Definition: VectorwiseOp.h:355
gtsam.examples.DogLegOptimizerExample.int
int
Definition: DogLegOptimizerExample.py:111
Eigen::internal::EIGEN_MEMBER_FUNCTOR
EIGEN_MEMBER_FUNCTOR(norm,(Size+5) *NumTraits< Scalar >::MulCost+(Size-1) *NumTraits< Scalar >::AddCost)
Eigen::internal::member_redux::binaryFunc
const BinaryOp & binaryFunc() const
Definition: VectorwiseOp.h:144
EIGEN_DEVICE_FUNC
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
Eigen::VectorwiseOp::ExtendedType
Definition: VectorwiseOp.h:220
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::VectorwiseOp::ReturnType::Type
PartialReduxExpr< ExpressionType, Functor< ReturnScalar, Scalar >, Direction > Type
Definition: VectorwiseOp.h:202
Eigen::VectorwiseOp::HNormalized_SizeMinusOne
@ HNormalized_SizeMinusOne
Definition: VectorwiseOp.h:720
Eigen::VectorwiseOp::LpNormReturnType::Type
PartialReduxExpr< ExpressionType, internal::member_lpnorm< p, RealScalar, Scalar >, Direction > Type
Definition: VectorwiseOp.h:360
Eigen::PartialReduxExpr::PartialReduxExpr
EIGEN_DEVICE_FUNC PartialReduxExpr(const MatrixType &mat, const MemberOp &func=MemberOp())
Definition: VectorwiseOp.h:65
Eigen::VectorwiseOp::iterator
internal::subvector_stl_iterator< ExpressionType, DirectionType(Direction)> iterator
Definition: VectorwiseOp.h:282
Eigen::VectorwiseOp::OppositeExtendedType
Definition: VectorwiseOp.h:243
Eigen::VectorwiseOp::operator/=
EIGEN_DEVICE_FUNC ExpressionType & operator/=(const DenseBase< OtherDerived > &other)
Definition: VectorwiseOp.h:622
Eigen::Block
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:103
Eigen::VectorwiseOp::BlueNormReturnType
ReturnType< internal::member_blueNorm, RealScalar >::Type BlueNormReturnType
Definition: VectorwiseOp.h:347
Eigen::internal::member_redux::operator()
EIGEN_DEVICE_FUNC result_type operator()(const DenseBase< Derived > &mat) const
Definition: VectorwiseOp.h:142
subVectors
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index subVectors() const
Definition: BlockMethods.h:1441
Eigen::PartialReduxExpr::functor
const EIGEN_DEVICE_FUNC MemberOp & functor() const
Definition: VectorwiseOp.h:77
Eigen::internal::member_lpnorm::Cost::value
@ value
Definition: VectorwiseOp.h:124
EIGEN_STATIC_ASSERT_SAME_XPR_KIND
#define EIGEN_STATIC_ASSERT_SAME_XPR_KIND(Derived1, Derived2)
Definition: StaticAssert.h:210
Eigen::VectorwiseOp::replicate
const Replicate< ExpressionType, isVertical *Factor+isHorizontal, isHorizontal *Factor+isVertical > EIGEN_DEVICE_FUNC replicate(Index factor=Factor) const
Definition: VectorwiseOp.h:568
Eigen::CwiseBinaryOp
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:77
Eigen::PartialReduxExpr::rows
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: VectorwiseOp.h:69
Eigen::internal::member_lpnorm::Cost
Definition: VectorwiseOp.h:123
MatrixType
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
Eigen::Horizontal
@ Horizontal
Definition: Constants.h:267
Eigen::VectorwiseOp::MinCoeffReturnType
ReturnType< internal::member_minCoeff >::Type MinCoeffReturnType
Definition: VectorwiseOp.h:343
Eigen::internal::dense_xpr_base
Definition: XprHelper.h:483
eigen_assert
#define eigen_assert(x)
Definition: Macros.h:1037
Eigen::VectorwiseOp::squaredNorm
const EIGEN_DEVICE_FUNC SquaredNormReturnType squaredNorm() const
Definition: VectorwiseOp.h:410
Eigen::VectorwiseOp::operator+=
EIGEN_DEVICE_FUNC ExpressionType & operator+=(const DenseBase< OtherDerived > &other)
Definition: VectorwiseOp.h:590
Eigen::RowMajorBit
const unsigned int RowMajorBit
Definition: Constants.h:66
Eigen::PartialReduxExpr::nestedExpression
EIGEN_DEVICE_FUNC MatrixType::Nested nestedExpression() const
Definition: VectorwiseOp.h:74
Eigen::VectorwiseOp::operator*
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_product_op< Scalar >, const ExpressionTypeNestedCleaned, const typename ExtendedType< OtherDerived >::Type > EIGEN_DEVICE_FUNC operator*(const DenseBase< OtherDerived > &other) const
Definition: VectorwiseOp.h:663
Eigen::internal::traits< PartialReduxExpr< MatrixType, MemberOp, Direction > >::XprKind
traits< MatrixType >::XprKind XprKind
Definition: VectorwiseOp.h:42
EIGEN_CONSTEXPR
#define EIGEN_CONSTEXPR
Definition: Macros.h:787
Eigen::VectorwiseOp::LpNormReturnType
Definition: VectorwiseOp.h:359
Eigen::VectorwiseOp::count
const EIGEN_DEVICE_FUNC CountReturnType count() const
Definition: VectorwiseOp.h:518
Eigen::VectorwiseOp::rbegin
reverse_iterator rbegin()
Definition: VectorwiseOp.h:300
Eigen::internal::member_redux::Cost
Definition: VectorwiseOp.h:139
Eigen::VectorwiseOp::mean
const EIGEN_DEVICE_FUNC MeanReturnType mean() const
Definition: VectorwiseOp.h:487
Eigen::VectorwiseOp
Pseudo expression providing broadcasting and partial reduction operations.
Definition: ForwardDeclarations.h:264
Eigen::internal::member_lpnorm::member_lpnorm
EIGEN_DEVICE_FUNC member_lpnorm()
Definition: VectorwiseOp.h:125
Eigen::VectorwiseOp::operator-
EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_difference_op< Scalar, typename OtherDerived::Scalar >, const ExpressionTypeNestedCleaned, const typename ExtendedType< OtherDerived >::Type > operator-(const DenseBase< OtherDerived > &other) const
Definition: VectorwiseOp.h:649
type
Definition: pytypes.h:1525
Eigen::DirectionType
DirectionType
Definition: Constants.h:261
Eigen::VectorwiseOp::operator+
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_sum_op< Scalar, typename OtherDerived::Scalar >, const ExpressionTypeNestedCleaned, const typename ExtendedType< OtherDerived >::Type > operator+(const DenseBase< OtherDerived > &other) const
Definition: VectorwiseOp.h:636
EIGEN_DENSE_PUBLIC_INTERFACE
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
Definition: Macros.h:1283
hypotNorm
EIGEN_DONT_INLINE T::Scalar hypotNorm(T &v)
Definition: bench_norm.cpp:21
EIGEN_STATIC_ASSERT_VECTOR_ONLY
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Definition: StaticAssert.h:142
Eigen::VectorwiseOp::ReverseReturnType
Reverse< ExpressionType, Direction > ReverseReturnType
Definition: VectorwiseOp.h:357
mat
MatrixXf mat
Definition: Tutorial_AdvancedInitialization_CommaTemporary.cpp:1
Eigen::internal::member_redux::Vectorizable
@ Vectorizable
Definition: VectorwiseOp.h:138
EIGEN_STATIC_ASSERT_ARRAYXPR
#define EIGEN_STATIC_ASSERT_ARRAYXPR(Derived)
Definition: StaticAssert.h:206
Eigen::VectorwiseOp::isHorizontal
@ isHorizontal
Definition: VectorwiseOp.h:215
Eigen::VectorwiseOp::ConstReverseReturnType
Reverse< const ExpressionType, Direction > ConstReverseReturnType
Definition: VectorwiseOp.h:356
Eigen::PartialReduxExpr::Base
internal::dense_xpr_base< PartialReduxExpr >::type Base
Definition: VectorwiseOp.h:61
Eigen::VectorwiseOp::ExpressionTypeNested
internal::ref_selector< ExpressionType >::non_const_type ExpressionTypeNested
Definition: VectorwiseOp.h:193
Eigen::VectorwiseOp::reverseInPlace
EIGEN_DEVICE_FUNC void reverseInPlace()
Definition: Reverse.h:210
Eigen::VectorwiseOp::maxCoeff
const EIGEN_DEVICE_FUNC MaxCoeffReturnType maxCoeff() const
Definition: VectorwiseOp.h:395
Eigen::internal::traits< PartialReduxExpr< MatrixType, MemberOp, Direction > >::InputScalar
MatrixType::Scalar InputScalar
Definition: VectorwiseOp.h:43
Eigen::internal::traits< PartialReduxExpr< MatrixType, MemberOp, Direction > >::StorageKind
traits< MatrixType >::StorageKind StorageKind
Definition: VectorwiseOp.h:41
Eigen::VectorwiseOp::isVertical
@ isVertical
Definition: VectorwiseOp.h:214
Eigen::VectorwiseOp::begin
const_iterator begin() const
Definition: VectorwiseOp.h:293
Eigen::VectorwiseOp::rend
reverse_iterator rend()
Definition: VectorwiseOp.h:318
pruning_fixture::factor
DecisionTreeFactor factor(D &C &B &A, "0.0 0.0 0.0 0.60658897 0.61241912 0.61241969 0.61247685 0.61247742 0.0 " "0.0 0.0 0.99995287 1.0 1.0 1.0 1.0")
Eigen::Homogeneous
Expression of one (or a set of) homogeneous vector(s)
Definition: ForwardDeclarations.h:298
Eigen::VectorwiseOp::crend
const_reverse_iterator crend() const
Definition: VectorwiseOp.h:322
Eigen::VectorwiseOp::const_reverse_iterator
internal::subvector_stl_reverse_iterator< const ExpressionType, DirectionType(Direction)> const_reverse_iterator
Definition: VectorwiseOp.h:285
Eigen::VectorwiseOp::normalize
EIGEN_DEVICE_FUNC void normalize()
Definition: VectorwiseOp.h:700
Eigen::VectorwiseOp::CountReturnType
PartialReduxExpr< ExpressionType, internal::member_count< Index, Scalar >, Direction > CountReturnType
Definition: VectorwiseOp.h:354
Eigen::internal::true_type
Definition: Meta.h:96
Eigen::VectorwiseOp::StableNormReturnType
ReturnType< internal::member_stableNorm, RealScalar >::Type StableNormReturnType
Definition: VectorwiseOp.h:348
Eigen::VectorwiseOp::SquaredNormReturnType
PartialReduxExpr< const CwiseUnaryOp< internal::scalar_abs2_op< Scalar >, const ExpressionTypeNestedCleaned >, internal::member_sum< RealScalar, RealScalar >, Direction > SquaredNormReturnType
Definition: VectorwiseOp.h:345
Eigen::internal::EIGEN_MAKE_PARTIAL_REDUX_FUNCTOR
EIGEN_MAKE_PARTIAL_REDUX_FUNCTOR(sum,(Size-1) *NumTraits< Scalar >::AddCost, 1, internal::scalar_sum_op)
Functor
Definition: NonLinearOptimization.cpp:117
Eigen::VectorwiseOp::HNormalized_Block
Block< const ExpressionType, Direction==Vertical ? int(HNormalized_SizeMinusOne) :int(internal::traits< ExpressionType >::RowsAtCompileTime), Direction==Horizontal ? int(HNormalized_SizeMinusOne) :int(internal::traits< ExpressionType >::ColsAtCompileTime)> HNormalized_Block
Definition: VectorwiseOp.h:727
Eigen::VectorwiseOp::reverse
EIGEN_DEVICE_FUNC ReverseReturnType reverse()
Definition: VectorwiseOp.h:549
Eigen::VectorwiseOp::AnyReturnType
ReturnType< internal::member_any >::Type AnyReturnType
Definition: VectorwiseOp.h:353
Eigen::GenericNumTraits< Scalar >::MulCost
@ MulCost
Definition: NumTraits.h:161
Eigen::VectorwiseOp::cbegin
const_iterator cbegin() const
Definition: VectorwiseOp.h:295
Eigen::VectorwiseOp::ReplicateReturnType
Replicate< ExpressionType,(isVertical?Dynamic:1),(isHorizontal?Dynamic:1)> ReplicateReturnType
Definition: VectorwiseOp.h:552
Eigen::VectorwiseOp::crbegin
const_reverse_iterator crbegin() const
Definition: VectorwiseOp.h:304
Eigen::VectorwiseOp::hnormalized
const EIGEN_DEVICE_FUNC HNormalizedReturnType hnormalized() const
column or row-wise homogeneous normalization
Definition: Homogeneous.h:198
Eigen::Dynamic
const int Dynamic
Definition: Constants.h:22
Eigen::all
static const Eigen::internal::all_t all
Definition: IndexedViewHelper.h:171
Eigen::VectorwiseOp::cend
const_iterator cend() const
Definition: VectorwiseOp.h:313
Eigen::PartialReduxExpr::m_functor
const MemberOp m_functor
Definition: VectorwiseOp.h:81
Eigen::VectorwiseOp::hypotNorm
const EIGEN_DEVICE_FUNC HypotNormReturnType hypotNorm() const
Definition: VectorwiseOp.h:468
Eigen::VectorwiseOp::minCoeff
const EIGEN_DEVICE_FUNC MinCoeffReturnType minCoeff() const
Definition: VectorwiseOp.h:376
Eigen::VectorwiseOp::AllReturnType
ReturnType< internal::member_all >::Type AllReturnType
Definition: VectorwiseOp.h:352
EIGEN_STRONG_INLINE
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
Eigen::Reverse
Expression of the reverse of a vector or matrix.
Definition: Reverse.h:63
Eigen::Replicate
Expression of the multiple replication of a matrix or vector.
Definition: Replicate.h:61
stableNorm
EIGEN_DONT_INLINE T::Scalar stableNorm(T &v)
Definition: bench_norm.cpp:15
Eigen::VectorwiseOp::Scalar
ExpressionType::Scalar Scalar
Definition: VectorwiseOp.h:190
Eigen::VectorwiseOp::operator=
EIGEN_DEVICE_FUNC ExpressionType & operator=(const DenseBase< OtherDerived > &other)
Definition: VectorwiseOp.h:579
Eigen::VectorwiseOp::_expression
const EIGEN_DEVICE_FUNC ExpressionType & _expression() const
Definition: VectorwiseOp.h:272
Eigen::VectorwiseOp::HNormalized_Factors
Block< const ExpressionType, Direction==Vertical ? 1 :int(internal::traits< ExpressionType >::RowsAtCompileTime), Direction==Horizontal ? 1 :int(internal::traits< ExpressionType >::ColsAtCompileTime)> HNormalized_Factors
Definition: VectorwiseOp.h:731
Eigen::VectorwiseOp::operator*=
EIGEN_DEVICE_FUNC ExpressionType & operator*=(const DenseBase< OtherDerived > &other)
Definition: VectorwiseOp.h:610
Eigen::VectorwiseOp::any
const EIGEN_DEVICE_FUNC AnyReturnType any() const
Definition: VectorwiseOp.h:505
Eigen::Triplet< double >
Eigen::VectorwiseOp::HomogeneousReturnType
Homogeneous< ExpressionType, Direction > HomogeneousReturnType
Definition: VectorwiseOp.h:708
Eigen::internal::member_redux::BinaryOp
BinaryOpT BinaryOp
Definition: VectorwiseOp.h:133
Eigen::VectorwiseOp::begin
iterator begin()
Definition: VectorwiseOp.h:291
Eigen::Vertical
@ Vertical
Definition: Constants.h:264
Eigen::internal::subvector_stl_iterator
Definition: StlIterators.h:313
Eigen::VectorwiseOp::operator/
EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_quotient_op< Scalar >, const ExpressionTypeNestedCleaned, const typename ExtendedType< OtherDerived >::Type > operator/(const DenseBase< OtherDerived > &other) const
Definition: VectorwiseOp.h:678
Eigen::DenseBase::colwise
EIGEN_DEVICE_FUNC ConstColwiseReturnType colwise() const
Definition: DenseBase.h:562
matrix
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Definition: gtsam/3rdparty/Eigen/blas/common.h:110
Eigen::internal::member_redux::m_functor
const BinaryOp m_functor
Definition: VectorwiseOp.h:145
Eigen::VectorwiseOp::blueNorm
const EIGEN_DEVICE_FUNC BlueNormReturnType blueNorm() const
Definition: VectorwiseOp.h:446
Eigen::VectorwiseOp::prod
const EIGEN_DEVICE_FUNC ProdReturnType prod() const
Definition: VectorwiseOp.h:529
RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:47
Eigen::internal::member_lpnorm
Definition: VectorwiseOp.h:120
Eigen::VectorwiseOp::redux_length
Index redux_length() const
Definition: VectorwiseOp.h:747
Eigen::VectorwiseOp::all
const EIGEN_DEVICE_FUNC AllReturnType all() const
Definition: VectorwiseOp.h:496
Eigen::VectorwiseOp::HNormalized_Size
@ HNormalized_Size
Definition: VectorwiseOp.h:718
Eigen::VectorwiseOp::operator-=
EIGEN_DEVICE_FUNC ExpressionType & operator-=(const DenseBase< OtherDerived > &other)
Definition: VectorwiseOp.h:600
Eigen::internal::member_lpnorm::operator()
EIGEN_DEVICE_FUNC ResultType operator()(const XprType &mat) const
Definition: VectorwiseOp.h:127
Eigen::internal::traits
Definition: ForwardDeclarations.h:17
Eigen::VectorwiseOp::ExtendedType::Type
Replicate< OtherDerived, isVertical ? 1 :ExpressionType::RowsAtCompileTime, isHorizontal ? 1 :ExpressionType::ColsAtCompileTime > Type
Definition: VectorwiseOp.h:223
Eigen::DenseBase
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:41
Eigen::VectorwiseOp::extendedToOpposite
EIGEN_DEVICE_FUNC OppositeExtendedType< OtherDerived >::Type extendedToOpposite(const DenseBase< OtherDerived > &other) const
Definition: VectorwiseOp.h:254
EIGEN_STATIC_ASSERT
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition: StaticAssert.h:127
Eigen::VectorwiseOp::redux
const EIGEN_DEVICE_FUNC ReduxReturnType< BinaryOp >::Type redux(const BinaryOp &func=BinaryOp()) const
Definition: VectorwiseOp.h:337
Eigen::VectorwiseOp::EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE
typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(SumReturnType, Scalar, quotient) MeanReturnType
Eigen::GenericNumTraits< Scalar >::AddCost
@ AddCost
Definition: NumTraits.h:160
Eigen::VectorwiseOp::rbegin
const_reverse_iterator rbegin() const
Definition: VectorwiseOp.h:302
Eigen::CwiseUnaryOp
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:55
Eigen::PartialReduxExpr::m_matrix
MatrixType::Nested m_matrix
Definition: VectorwiseOp.h:80
Eigen::internal::subvector_stl_reverse_iterator
Definition: StlIterators.h:361
Eigen::DenseBase::rowwise
EIGEN_DEVICE_FUNC ConstRowwiseReturnType rowwise() const
Definition: DenseBase.h:550
Eigen::VectorwiseOp::m_matrix
ExpressionTypeNested m_matrix
Definition: VectorwiseOp.h:751
Eigen::internal::member_redux::member_redux
EIGEN_DEVICE_FUNC member_redux(const BinaryOp func)
Definition: VectorwiseOp.h:140
Eigen::VectorwiseOp::ReturnType
Definition: VectorwiseOp.h:197
Eigen::VectorwiseOp::reverse_iterator
internal::subvector_stl_reverse_iterator< ExpressionType, DirectionType(Direction)> reverse_iterator
Definition: VectorwiseOp.h:284
Eigen::VectorwiseOp::replicate
const EIGEN_DEVICE_FUNC ReplicateReturnType replicate(Index factor) const
Definition: Replicate.h:134
Eigen::VectorwiseOp::rend
const_reverse_iterator rend() const
Definition: VectorwiseOp.h:320
Eigen::PartialReduxExpr::cols
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: VectorwiseOp.h:71
Eigen::internal::member_redux
Definition: VectorwiseOp.h:132
Eigen::internal::result_of
Definition: Meta.h:513
Eigen::VectorwiseOp::sum
const EIGEN_DEVICE_FUNC SumReturnType sum() const
Definition: VectorwiseOp.h:479
Eigen::VectorwiseOp::VectorwiseOp
EIGEN_DEVICE_FUNC VectorwiseOp(ExpressionType &matrix)
Definition: VectorwiseOp.h:268
blueNorm
EIGEN_DONT_INLINE T::Scalar blueNorm(T &v)
Definition: bench_norm.cpp:27
Eigen::VectorwiseOp::HNormalizedReturnType
CwiseBinaryOp< internal::scalar_quotient_op< typename internal::traits< ExpressionType >::Scalar >, const HNormalized_Block, const Replicate< HNormalized_Factors, Direction==Vertical ? HNormalized_SizeMinusOne :1, Direction==Horizontal ? HNormalized_SizeMinusOne :1 > > HNormalizedReturnType
Definition: VectorwiseOp.h:737
Eigen::VectorwiseOp::Index
Eigen::Index Index
Definition: VectorwiseOp.h:192
Eigen::internal::member_redux::Cost::value
@ value
Definition: VectorwiseOp.h:139
Eigen::internal::functor_traits
Definition: XprHelper.h:175
Eigen::VectorwiseOp::ExpressionTypeNestedCleaned
internal::remove_all< ExpressionTypeNested >::type ExpressionTypeNestedCleaned
Definition: VectorwiseOp.h:194
Eigen::VectorwiseOp::RealScalar
ExpressionType::RealScalar RealScalar
Definition: VectorwiseOp.h:191
EIGEN_NOEXCEPT
#define EIGEN_NOEXCEPT
Definition: Macros.h:1418
Eigen::VectorwiseOp::norm
const EIGEN_DEVICE_FUNC NormReturnType norm() const
Definition: VectorwiseOp.h:422
Eigen::VectorwiseOp::ReduxReturnType::Type
PartialReduxExpr< ExpressionType, internal::member_redux< BinaryOp, Scalar >, Direction > Type
Definition: VectorwiseOp.h:210
internal
Definition: BandTriangularSolver.h:13
Eigen::MatrixBase
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
EIGEN_IMPLIES
#define EIGEN_IMPLIES(a, b)
Definition: Macros.h:1315
Eigen::VectorwiseOp::NormReturnType
CwiseUnaryOp< internal::scalar_sqrt_op< RealScalar >, const SquaredNormReturnType > NormReturnType
Definition: VectorwiseOp.h:346
Eigen::VectorwiseOp::CrossReturnType
ExpressionType::PlainObject CrossReturnType
Definition: VectorwiseOp.h:712
Eigen::VectorwiseOp::end
iterator end()
Definition: VectorwiseOp.h:309
Eigen::VectorwiseOp::lpNorm
const EIGEN_DEVICE_FUNC LpNormReturnType< p >::Type lpNorm() const
Definition: VectorwiseOp.h:435
func
Definition: benchGeometry.cpp:23
Eigen::internal::member_lpnorm::Vectorizable
@ Vectorizable
Definition: VectorwiseOp.h:122
Eigen::VectorwiseOp::homogeneous
EIGEN_DEVICE_FUNC HomogeneousReturnType homogeneous() const
Definition: Homogeneous.h:150
Eigen::PartialReduxExpr
Generic expression of a partially reduxed matrix.
Definition: ForwardDeclarations.h:263
Eigen::VectorwiseOp::normalized
EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_quotient_op< Scalar >, const ExpressionTypeNestedCleaned, const typename OppositeExtendedType< NormReturnType >::Type > normalized() const
Definition: VectorwiseOp.h:694
Eigen::VectorwiseOp::stableNorm
const EIGEN_DEVICE_FUNC StableNormReturnType stableNorm() const
Definition: VectorwiseOp.h:457
Eigen::VectorwiseOp::const_iterator
internal::subvector_stl_iterator< const ExpressionType, DirectionType(Direction)> const_iterator
Definition: VectorwiseOp.h:283
Eigen::internal::member_redux::result_type
result_of< BinaryOp(const Scalar &, const Scalar &) >::type result_type
Definition: VectorwiseOp.h:136
Eigen::VectorwiseOp::reverse
const EIGEN_DEVICE_FUNC ConstReverseReturnType reverse() const
Definition: VectorwiseOp.h:541
Eigen::VectorwiseOp::HypotNormReturnType
ReturnType< internal::member_hypotNorm, RealScalar >::Type HypotNormReturnType
Definition: VectorwiseOp.h:349
Eigen::VectorwiseOp::SumReturnType
ReturnType< internal::member_sum >::Type SumReturnType
Definition: VectorwiseOp.h:350
Eigen::prod
const Product< Lhs, Rhs > prod(const Lhs &lhs, const Rhs &rhs)
Definition: evaluators.cpp:8
Eigen::NumTraits
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:232
Eigen::internal::traits< PartialReduxExpr< MatrixType, MemberOp, Direction > >::Scalar
MemberOp::result_type Scalar
Definition: VectorwiseOp.h:40
pybind_wrapper_test_script.other
other
Definition: pybind_wrapper_test_script.py:42
Eigen::internal::member_lpnorm::result_type
ResultType result_type
Definition: VectorwiseOp.h:121
Eigen::VectorwiseOp::extendedTo
EIGEN_DEVICE_FUNC ExtendedType< OtherDerived >::Type extendedTo(const DenseBase< OtherDerived > &other) const
Definition: VectorwiseOp.h:231
Eigen::VectorwiseOp::MaxCoeffReturnType
ReturnType< internal::member_maxCoeff >::Type MaxCoeffReturnType
Definition: VectorwiseOp.h:344
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Eigen::VectorwiseOp::end
const_iterator end() const
Definition: VectorwiseOp.h:311
Eigen::partial_redux_dummy_func
Definition: VectorwiseOp.h:84
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Eigen::VectorwiseOp::OppositeExtendedType::Type
Replicate< OtherDerived, isHorizontal ? 1 :ExpressionType::RowsAtCompileTime, isVertical ? 1 :ExpressionType::ColsAtCompileTime > Type
Definition: VectorwiseOp.h:246


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:18:24