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-2010 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,
58 {
59  public:
60 
63 
64  EIGEN_DEVICE_FUNC
65  explicit PartialReduxExpr(const MatrixType& mat, const MemberOp& func = MemberOp())
66  : m_matrix(mat), m_functor(func) {}
67 
68  EIGEN_DEVICE_FUNC
69  Index rows() const { return (Direction==Vertical ? 1 : m_matrix.rows()); }
70  EIGEN_DEVICE_FUNC
71  Index cols() const { return (Direction==Horizontal ? 1 : m_matrix.cols()); }
72 
73  EIGEN_DEVICE_FUNC
74  typename MatrixType::Nested nestedExpression() const { return m_matrix; }
75 
76  EIGEN_DEVICE_FUNC
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 #define EIGEN_MEMBER_FUNCTOR(MEMBER,COST) \
85  template <typename ResultType> \
86  struct member_##MEMBER { \
87  EIGEN_EMPTY_STRUCT_CTOR(member_##MEMBER) \
88  typedef ResultType result_type; \
89  template<typename Scalar, int Size> struct Cost \
90  { enum { value = COST }; }; \
91  template<typename XprType> \
92  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE \
93  ResultType operator()(const XprType& mat) const \
94  { return mat.MEMBER(); } \
95  }
96 
97 namespace internal {
98 
103 EIGEN_MEMBER_FUNCTOR(hypotNorm, (Size-1) * functor_traits<scalar_hypot_op<Scalar> >::Cost );
112 
113 template <int p, typename ResultType>
115  typedef ResultType result_type;
116  template<typename Scalar, int Size> struct Cost
117  { enum { value = (Size+5) * NumTraits<Scalar>::MulCost + (Size-1)*NumTraits<Scalar>::AddCost }; };
118  EIGEN_DEVICE_FUNC member_lpnorm() {}
119  template<typename XprType>
120  EIGEN_DEVICE_FUNC inline ResultType operator()(const XprType& mat) const
121  { return mat.template lpNorm<p>(); }
122 };
123 
124 template <typename BinaryOp, typename Scalar>
125 struct member_redux {
126  typedef typename result_of<
127  BinaryOp(const Scalar&,const Scalar&)
129  template<typename _Scalar, int Size> struct Cost
130  { enum { value = (Size-1) * functor_traits<BinaryOp>::Cost }; };
131  EIGEN_DEVICE_FUNC explicit member_redux(const BinaryOp func) : m_functor(func) {}
132  template<typename Derived>
133  EIGEN_DEVICE_FUNC inline result_type operator()(const DenseBase<Derived>& mat) const
134  { return mat.redux(m_functor); }
135  const BinaryOp m_functor;
136 };
137 }
138 
156 template<typename ExpressionType, int Direction> class VectorwiseOp
157 {
158  public:
159 
160  typedef typename ExpressionType::Scalar Scalar;
162  typedef Eigen::Index Index;
165 
166  template<template<typename _Scalar> class Functor,
167  typename Scalar_=Scalar> struct ReturnType
168  {
169  typedef PartialReduxExpr<ExpressionType,
171  Direction
172  > Type;
173  };
174 
175  template<typename BinaryOp> struct ReduxReturnType
176  {
177  typedef PartialReduxExpr<ExpressionType,
179  Direction
180  > Type;
181  };
182 
183  enum {
184  isVertical = (Direction==Vertical) ? 1 : 0,
185  isHorizontal = (Direction==Horizontal) ? 1 : 0
186  };
187 
188  protected:
189 
190  typedef typename internal::conditional<isVertical,
191  typename ExpressionType::ColXpr,
195  EIGEN_DEVICE_FUNC
196  SubVector subVector(Index i)
197  {
198  return SubVector(m_matrix.derived(),i);
199  }
200 
203  EIGEN_DEVICE_FUNC
204  Index subVectors() const
205  { return isVertical?m_matrix.cols():m_matrix.rows(); }
206 
207  template<typename OtherDerived> struct ExtendedType {
208  typedef Replicate<OtherDerived,
209  isVertical ? 1 : ExpressionType::RowsAtCompileTime,
210  isHorizontal ? 1 : ExpressionType::ColsAtCompileTime> Type;
211  };
212 
215  template<typename OtherDerived>
216  EIGEN_DEVICE_FUNC
219  {
220  EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(isVertical, OtherDerived::MaxColsAtCompileTime==1),
221  YOU_PASSED_A_ROW_VECTOR_BUT_A_COLUMN_VECTOR_WAS_EXPECTED)
222  EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(isHorizontal, OtherDerived::MaxRowsAtCompileTime==1),
223  YOU_PASSED_A_COLUMN_VECTOR_BUT_A_ROW_VECTOR_WAS_EXPECTED)
224  return typename ExtendedType<OtherDerived>::Type
225  (other.derived(),
226  isVertical ? 1 : m_matrix.rows(),
227  isHorizontal ? 1 : m_matrix.cols());
228  }
229 
230  template<typename OtherDerived> struct OppositeExtendedType {
231  typedef Replicate<OtherDerived,
232  isHorizontal ? 1 : ExpressionType::RowsAtCompileTime,
233  isVertical ? 1 : ExpressionType::ColsAtCompileTime> Type;
234  };
235 
238  template<typename OtherDerived>
239  EIGEN_DEVICE_FUNC
242  {
243  EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(isHorizontal, OtherDerived::MaxColsAtCompileTime==1),
244  YOU_PASSED_A_ROW_VECTOR_BUT_A_COLUMN_VECTOR_WAS_EXPECTED)
245  EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(isVertical, OtherDerived::MaxRowsAtCompileTime==1),
246  YOU_PASSED_A_COLUMN_VECTOR_BUT_A_ROW_VECTOR_WAS_EXPECTED)
248  (other.derived(),
249  isHorizontal ? 1 : m_matrix.rows(),
250  isVertical ? 1 : m_matrix.cols());
251  }
252 
253  public:
254  EIGEN_DEVICE_FUNC
255  explicit inline VectorwiseOp(ExpressionType& matrix) : m_matrix(matrix) {}
256 
258  EIGEN_DEVICE_FUNC
259  inline const ExpressionType& _expression() const { return m_matrix; }
260 
268  template<typename BinaryOp>
269  EIGEN_DEVICE_FUNC
270  const typename ReduxReturnType<BinaryOp>::Type
271  redux(const BinaryOp& func = BinaryOp()) const
273 
289 
290  template<int p> struct LpNormReturnType {
292  };
293 
303  EIGEN_DEVICE_FUNC
304  const MinCoeffReturnType minCoeff() const
305  { return MinCoeffReturnType(_expression()); }
306 
316  EIGEN_DEVICE_FUNC
317  const MaxCoeffReturnType maxCoeff() const
318  { return MaxCoeffReturnType(_expression()); }
319 
328  EIGEN_DEVICE_FUNC
329  const SquaredNormReturnType squaredNorm() const
330  { return SquaredNormReturnType(_expression()); }
331 
340  EIGEN_DEVICE_FUNC
341  const NormReturnType norm() const
342  { return NormReturnType(_expression()); }
343 
352  template<int p>
353  EIGEN_DEVICE_FUNC
354  const typename LpNormReturnType<p>::Type lpNorm() const
355  { return typename LpNormReturnType<p>::Type(_expression()); }
356 
357 
364  EIGEN_DEVICE_FUNC
365  const BlueNormReturnType blueNorm() const
366  { return BlueNormReturnType(_expression()); }
367 
368 
375  EIGEN_DEVICE_FUNC
376  const StableNormReturnType stableNorm() const
377  { return StableNormReturnType(_expression()); }
378 
379 
386  EIGEN_DEVICE_FUNC
387  const HypotNormReturnType hypotNorm() const
388  { return HypotNormReturnType(_expression()); }
389 
397  EIGEN_DEVICE_FUNC
398  const SumReturnType sum() const
399  { return SumReturnType(_expression()); }
400 
405  EIGEN_DEVICE_FUNC
406  const MeanReturnType mean() const
407  { return MeanReturnType(_expression()); }
408 
414  EIGEN_DEVICE_FUNC
415  const AllReturnType all() const
416  { return AllReturnType(_expression()); }
417 
423  EIGEN_DEVICE_FUNC
424  const AnyReturnType any() const
425  { return AnyReturnType(_expression()); }
426 
436  EIGEN_DEVICE_FUNC
437  const CountReturnType count() const
438  { return CountReturnType(_expression()); }
439 
447  EIGEN_DEVICE_FUNC
448  const ProdReturnType prod() const
449  { return ProdReturnType(_expression()); }
450 
451 
459  EIGEN_DEVICE_FUNC
460  const ConstReverseReturnType reverse() const
461  { return ConstReverseReturnType( _expression() ); }
462 
467  EIGEN_DEVICE_FUNC
468  ReverseReturnType reverse()
469  { return ReverseReturnType( _expression() ); }
470 
472  EIGEN_DEVICE_FUNC
473  const ReplicateReturnType replicate(Index factor) const;
474 
483  // NOTE implemented here because of sunstudio's compilation errors
484  // isVertical*Factor+isHorizontal instead of (isVertical?Factor:1) to handle CUDA bug with ternary operator
486  EIGEN_DEVICE_FUNC
487  replicate(Index factor = Factor) const
488  {
490  (_expression(),isVertical?factor:1,isHorizontal?factor:1);
491  }
492 
494 
496  template<typename OtherDerived>
497  EIGEN_DEVICE_FUNC
498  ExpressionType& operator=(const DenseBase<OtherDerived>& other)
499  {
500  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
501  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
502  //eigen_assert((m_matrix.isNull()) == (other.isNull())); FIXME
503  return const_cast<ExpressionType&>(m_matrix = extendedTo(other.derived()));
504  }
505 
507  template<typename OtherDerived>
508  EIGEN_DEVICE_FUNC
509  ExpressionType& operator+=(const DenseBase<OtherDerived>& other)
510  {
511  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
512  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
513  return const_cast<ExpressionType&>(m_matrix += extendedTo(other.derived()));
514  }
515 
517  template<typename OtherDerived>
518  EIGEN_DEVICE_FUNC
519  ExpressionType& operator-=(const DenseBase<OtherDerived>& other)
520  {
521  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
522  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
523  return const_cast<ExpressionType&>(m_matrix -= extendedTo(other.derived()));
524  }
525 
527  template<typename OtherDerived>
528  EIGEN_DEVICE_FUNC
529  ExpressionType& operator*=(const DenseBase<OtherDerived>& other)
530  {
531  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
532  EIGEN_STATIC_ASSERT_ARRAYXPR(ExpressionType)
533  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
534  m_matrix *= extendedTo(other.derived());
535  return const_cast<ExpressionType&>(m_matrix);
536  }
537 
539  template<typename OtherDerived>
540  EIGEN_DEVICE_FUNC
541  ExpressionType& operator/=(const DenseBase<OtherDerived>& other)
542  {
543  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
544  EIGEN_STATIC_ASSERT_ARRAYXPR(ExpressionType)
545  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
546  m_matrix /= extendedTo(other.derived());
547  return const_cast<ExpressionType&>(m_matrix);
548  }
549 
551  template<typename OtherDerived> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
553  const ExpressionTypeNestedCleaned,
554  const typename ExtendedType<OtherDerived>::Type>
555  operator+(const DenseBase<OtherDerived>& other) const
556  {
557  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
558  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
559  return m_matrix + extendedTo(other.derived());
560  }
561 
563  template<typename OtherDerived>
564  EIGEN_DEVICE_FUNC
566  const ExpressionTypeNestedCleaned,
567  const typename ExtendedType<OtherDerived>::Type>
568  operator-(const DenseBase<OtherDerived>& other) const
569  {
570  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
571  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
572  return m_matrix - extendedTo(other.derived());
573  }
574 
577  template<typename OtherDerived> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
579  const ExpressionTypeNestedCleaned,
580  const typename ExtendedType<OtherDerived>::Type>
581  EIGEN_DEVICE_FUNC
582  operator*(const DenseBase<OtherDerived>& other) const
583  {
584  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
585  EIGEN_STATIC_ASSERT_ARRAYXPR(ExpressionType)
586  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
587  return m_matrix * extendedTo(other.derived());
588  }
589 
592  template<typename OtherDerived>
593  EIGEN_DEVICE_FUNC
595  const ExpressionTypeNestedCleaned,
596  const typename ExtendedType<OtherDerived>::Type>
597  operator/(const DenseBase<OtherDerived>& other) const
598  {
599  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
600  EIGEN_STATIC_ASSERT_ARRAYXPR(ExpressionType)
601  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
602  return m_matrix / extendedTo(other.derived());
603  }
604 
609  EIGEN_DEVICE_FUNC
610  CwiseBinaryOp<internal::scalar_quotient_op<Scalar>,
611  const ExpressionTypeNestedCleaned,
613  normalized() const { return m_matrix.cwiseQuotient(extendedToOpposite(this->norm())); }
614 
615 
619  EIGEN_DEVICE_FUNC void normalize() {
620  m_matrix = this->normalized();
621  }
622 
623  EIGEN_DEVICE_FUNC inline void reverseInPlace();
624 
626 
628  EIGEN_DEVICE_FUNC
629  HomogeneousReturnType homogeneous() const;
630 
631  typedef typename ExpressionType::PlainObject CrossReturnType;
632  template<typename OtherDerived>
633  EIGEN_DEVICE_FUNC
634  const CrossReturnType cross(const MatrixBase<OtherDerived>& other) const;
635 
636  enum {
639  HNormalized_SizeMinusOne = HNormalized_Size==Dynamic ? Dynamic : HNormalized_Size-1
640  };
641  typedef Block<const ExpressionType,
642  Direction==Vertical ? int(HNormalized_SizeMinusOne)
643  : int(internal::traits<ExpressionType>::RowsAtCompileTime),
644  Direction==Horizontal ? int(HNormalized_SizeMinusOne)
645  : int(internal::traits<ExpressionType>::ColsAtCompileTime)>
647  typedef Block<const ExpressionType,
652  const HNormalized_Block,
654  Direction==Vertical ? HNormalized_SizeMinusOne : 1,
655  Direction==Horizontal ? HNormalized_SizeMinusOne : 1> >
657 
658  EIGEN_DEVICE_FUNC
659  const HNormalizedReturnType hnormalized() const;
660 
661  protected:
662  ExpressionTypeNested m_matrix;
663 };
664 
665 //const colwise moved to DenseBase.h due to CUDA compiler bug
666 
667 
672 template<typename Derived>
675 {
676  return ColwiseReturnType(derived());
677 }
678 
679 //const rowwise moved to DenseBase.h due to CUDA compiler bug
680 
681 
686 template<typename Derived>
689 {
690  return RowwiseReturnType(derived());
691 }
692 
693 } // end namespace Eigen
694 
695 #endif // EIGEN_PARTIAL_REDUX_H
Block< Derived, 1, internal::traits< Derived >::ColsAtCompileTime, IsRowMajor > RowXpr
Definition: BlockMethods.h:17
internal::remove_all< ExpressionTypeNested >::type ExpressionTypeNestedCleaned
Definition: VectorwiseOp.h:164
SCALAR Scalar
Definition: bench_gemm.cpp:33
EIGEN_DEVICE_FUNC ExpressionType & operator/=(const DenseBase< OtherDerived > &other)
Definition: VectorwiseOp.h:541
EIGEN_DEVICE_FUNC void normalize()
Definition: VectorwiseOp.h:619
#define EIGEN_STRONG_INLINE
Definition: Macros.h:494
PartialReduxExpr< ExpressionType, internal::member_lpnorm< p, RealScalar >, Direction > Type
Definition: VectorwiseOp.h:291
EIGEN_DEVICE_FUNC const LpNormReturnType< p >::Type lpNorm() const
Definition: VectorwiseOp.h:354
ReturnType< internal::member_sum >::Type SumReturnType
Definition: VectorwiseOp.h:281
EIGEN_DEVICE_FUNC const CountReturnType count() const
Definition: VectorwiseOp.h:437
EIGEN_DEVICE_FUNC const NormReturnType norm() const
Definition: VectorwiseOp.h:341
return int(ret)+1
ReturnType< internal::member_stableNorm, RealScalar >::Type StableNormReturnType
Definition: VectorwiseOp.h:279
void homogeneous(void)
ReturnType< internal::member_minCoeff >::Type MinCoeffReturnType
Definition: VectorwiseOp.h:274
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:582
Eigen::Index Index
Definition: VectorwiseOp.h:162
internal::conditional< isVertical, typename ExpressionType::ColXpr, typename ExpressionType::RowXpr >::type SubVector
Definition: VectorwiseOp.h:192
EIGEN_DEVICE_FUNC const BlueNormReturnType blueNorm() const
Definition: VectorwiseOp.h:365
EIGEN_DEVICE_FUNC member_lpnorm()
Definition: VectorwiseOp.h:118
result_of< BinaryOp(const Scalar &, const Scalar &) >::type result_type
Definition: VectorwiseOp.h:128
ExpressionType::RealScalar RealScalar
Definition: VectorwiseOp.h:161
EIGEN_DEVICE_FUNC ReverseReturnType reverse()
Definition: VectorwiseOp.h:468
EIGEN_DONT_INLINE T::Scalar hypotNorm(T &v)
Definition: bench_norm.cpp:21
EIGEN_DEVICE_FUNC const ReduxReturnType< BinaryOp >::Type redux(const BinaryOp &func=BinaryOp()) const
Definition: VectorwiseOp.h:271
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Block< Derived, internal::traits< Derived >::RowsAtCompileTime, 1,!IsRowMajor > ColXpr
Definition: BlockMethods.h:14
EIGEN_DEVICE_FUNC const MemberOp & functor() const
Definition: VectorwiseOp.h:77
EIGEN_DEVICE_FUNC ResultType operator()(const XprType &mat) const
Definition: VectorwiseOp.h:120
EIGEN_DEVICE_FUNC SubVector subVector(Index i)
Definition: VectorwiseOp.h:196
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:597
EIGEN_DEVICE_FUNC const ProdReturnType prod() const
Definition: VectorwiseOp.h:448
MatrixXf MatrixType
Generic expression of a partially reduxed matrix.
Replicate< ExpressionType,(isVertical?Dynamic:1),(isHorizontal?Dynamic:1)> ReplicateReturnType
Definition: VectorwiseOp.h:471
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
Definition: NumTraits.h:150
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition: StaticAssert.h:124
EIGEN_DEVICE_FUNC Index cols() const
Definition: VectorwiseOp.h:71
EIGEN_DEVICE_FUNC result_type operator()(const DenseBase< Derived > &mat) const
Definition: VectorwiseOp.h:133
EIGEN_DEVICE_FUNC Index subVectors() const
Definition: VectorwiseOp.h:204
Pseudo expression providing partial reduction operations.
ReturnType< internal::member_any >::Type AnyReturnType
Definition: VectorwiseOp.h:284
EIGEN_DEVICE_FUNC ConstColwiseReturnType colwise() const
Definition: DenseBase.h:516
const unsigned int RowMajorBit
Definition: Constants.h:61
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:41
#define EIGEN_IMPLIES(a, b)
Definition: Macros.h:902
ReturnType< internal::member_hypotNorm, RealScalar >::Type HypotNormReturnType
Definition: VectorwiseOp.h:280
Point3 mean(const CONTAINER &points)
mean
Definition: Point3.h:66
internal::ref_selector< ExpressionType >::non_const_type ExpressionTypeNested
Definition: VectorwiseOp.h:163
ReturnType< internal::member_all >::Type AllReturnType
Definition: VectorwiseOp.h:283
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:568
EIGEN_DEVICE_FUNC Index rows() const
Definition: VectorwiseOp.h:69
EIGEN_DEVICE_FUNC VectorwiseOp(ExpressionType &matrix)
Definition: VectorwiseOp.h:255
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:77
EIGEN_DEVICE_FUNC const SumReturnType sum() const
Definition: VectorwiseOp.h:398
EIGEN_DEVICE_FUNC ExpressionType & operator-=(const DenseBase< OtherDerived > &other)
Definition: VectorwiseOp.h:519
PartialReduxExpr< ExpressionType, Functor< Scalar_ >, Direction > Type
Definition: VectorwiseOp.h:172
void replicate(const MatrixType &m)
EIGEN_DEVICE_FUNC ExpressionType & operator+=(const DenseBase< OtherDerived > &other)
Definition: VectorwiseOp.h:509
EIGEN_DEVICE_FUNC Scalar redux(const BinaryOp &func) const
MatrixType::Nested m_matrix
Definition: VectorwiseOp.h:80
EIGEN_DEVICE_FUNC const MaxCoeffReturnType maxCoeff() const
Definition: VectorwiseOp.h:317
Point3 cross(const Point3 &p, const Point3 &q, OptionalJacobian< 3, 3 > H1, OptionalJacobian< 3, 3 > H2)
cross product
Definition: Point3.cpp:63
const MemberOp m_functor
Definition: VectorwiseOp.h:81
EIGEN_DEVICE_FUNC const ExpressionType & _expression() const
Definition: VectorwiseOp.h:259
Reverse< const ExpressionType, Direction > ConstReverseReturnType
Definition: VectorwiseOp.h:287
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
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:555
EIGEN_MEMBER_FUNCTOR(squaredNorm, Size *NumTraits< Scalar >::MulCost+(Size-1)*NumTraits< Scalar >::AddCost)
Expression of the multiple replication of a matrix or vector.
Definition: Replicate.h:61
ExpressionTypeNested m_matrix
Definition: VectorwiseOp.h:662
const mpreal sum(const mpreal tab[], const unsigned long int n, int &status, mp_rnd_t mode=mpreal::get_default_rnd())
Definition: mpreal.h:2381
PartialReduxExpr< ExpressionType, internal::member_count< Index >, Direction > CountReturnType
Definition: VectorwiseOp.h:285
EIGEN_DONT_INLINE T::Scalar stableNorm(T &v)
Definition: bench_norm.cpp:15
EIGEN_DEVICE_FUNC const MinCoeffReturnType minCoeff() const
Definition: VectorwiseOp.h:304
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:656
EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_quotient_op< Scalar >, const ExpressionTypeNestedCleaned, const typename OppositeExtendedType< typename ReturnType< internal::member_norm, RealScalar >::Type >::Type > normalized() const
Definition: VectorwiseOp.h:613
Reverse< ExpressionType, Direction > ReverseReturnType
Definition: VectorwiseOp.h:288
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:34
const Replicate< ExpressionType, isVertical *Factor+isHorizontal, isHorizontal *Factor+isVertical > EIGEN_DEVICE_FUNC replicate(Index factor=Factor) const
Definition: VectorwiseOp.h:487
#define EIGEN_STATIC_ASSERT_ARRAYXPR(Derived)
Definition: StaticAssert.h:203
Homogeneous< ExpressionType, Direction > HomogeneousReturnType
Definition: VectorwiseOp.h:627
EIGEN_DEVICE_FUNC const HypotNormReturnType hypotNorm() const
Definition: VectorwiseOp.h:387
ExpressionType::Scalar Scalar
Definition: VectorwiseOp.h:160
EIGEN_DEVICE_FUNC MatrixType::Nested nestedExpression() const
Definition: VectorwiseOp.h:74
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:103
EIGEN_DEVICE_FUNC const AnyReturnType any() const
Definition: VectorwiseOp.h:424
#define EIGEN_STATIC_ASSERT_SAME_XPR_KIND(Derived1, Derived2)
Definition: StaticAssert.h:207
EIGEN_DEVICE_FUNC member_redux(const BinaryOp func)
Definition: VectorwiseOp.h:131
ReturnType< internal::member_prod >::Type ProdReturnType
Definition: VectorwiseOp.h:286
EIGEN_DEVICE_FUNC const AllReturnType all() const
Definition: VectorwiseOp.h:415
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
Definition: Macros.h:870
EIGEN_DEVICE_FUNC const MeanReturnType mean() const
Definition: VectorwiseOp.h:406
ReturnType< internal::member_norm, RealScalar >::Type NormReturnType
Definition: VectorwiseOp.h:277
EIGEN_DEVICE_FUNC ExpressionType & operator=(const DenseBase< OtherDerived > &other)
Definition: VectorwiseOp.h:498
EIGEN_DEVICE_FUNC OppositeExtendedType< OtherDerived >::Type extendedToOpposite(const DenseBase< OtherDerived > &other) const
Definition: VectorwiseOp.h:241
EIGEN_DEVICE_FUNC const StableNormReturnType stableNorm() const
Definition: VectorwiseOp.h:376
EIGEN_DEVICE_FUNC ExpressionType & operator*=(const DenseBase< OtherDerived > &other)
Definition: VectorwiseOp.h:529
const int Dynamic
Definition: Constants.h:21
EIGEN_DONT_INLINE T::Scalar blueNorm(T &v)
Definition: bench_norm.cpp:27
Replicate< OtherDerived, isVertical?1:ExpressionType::RowsAtCompileTime, isHorizontal?1:ExpressionType::ColsAtCompileTime > Type
Definition: VectorwiseOp.h:210
Block< const ExpressionType, Direction==Vertical?1:int(internal::traits< ExpressionType >::RowsAtCompileTime), Direction==Horizontal?1:int(internal::traits< ExpressionType >::ColsAtCompileTime)> HNormalized_Factors
Definition: VectorwiseOp.h:650
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
PartialReduxExpr< ExpressionType, internal::member_redux< BinaryOp, Scalar >, Direction > Type
Definition: VectorwiseOp.h:180
ReturnType< internal::member_blueNorm, RealScalar >::Type BlueNormReturnType
Definition: VectorwiseOp.h:278
Expression of the reverse of a vector or matrix.
Definition: Reverse.h:63
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Definition: StaticAssert.h:139
ReturnType< internal::member_squaredNorm, RealScalar >::Type SquaredNormReturnType
Definition: VectorwiseOp.h:276
ExpressionType::PlainObject CrossReturnType
Definition: VectorwiseOp.h:631
ReturnType< internal::member_mean >::Type MeanReturnType
Definition: VectorwiseOp.h:282
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
ReturnType< internal::member_maxCoeff >::Type MaxCoeffReturnType
Definition: VectorwiseOp.h:275
internal::dense_xpr_base< PartialReduxExpr >::type Base
Definition: VectorwiseOp.h:61
EIGEN_DEVICE_FUNC const ConstReverseReturnType reverse() const
Definition: VectorwiseOp.h:460
EIGEN_DEVICE_FUNC ExtendedType< OtherDerived >::Type extendedTo(const DenseBase< OtherDerived > &other) const
Definition: VectorwiseOp.h:218
Eigen::VectorBlock< Vector > SubVector
Definition: Vector.h:64
Definition: pytypes.h:897
EIGEN_DEVICE_FUNC ConstRowwiseReturnType rowwise() const
Definition: DenseBase.h:504
Expression of one (or a set of) homogeneous vector(s)
EIGEN_DEVICE_FUNC const SquaredNormReturnType squaredNorm() const
Definition: VectorwiseOp.h:329
const Product< Lhs, Rhs > prod(const Lhs &lhs, const Rhs &rhs)
Definition: evaluators.cpp:8
Replicate< OtherDerived, isHorizontal?1:ExpressionType::RowsAtCompileTime, isVertical?1:ExpressionType::ColsAtCompileTime > Type
Definition: VectorwiseOp.h:233


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:51:24