Eigen  3.2.91
VectorwiseOp.h
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;
41  typedef typename traits<MatrixType>::StorageKind StorageKind;
42  typedef typename traits<MatrixType>::XprKind XprKind;
43  typedef typename MatrixType::Scalar InputScalar;
44  typedef typename ref_selector<MatrixType>::type MatrixTypeNested;
45  typedef typename remove_all<MatrixTypeNested>::type _MatrixTypeNested;
46  enum {
47  RowsAtCompileTime = Direction==Vertical ? 1 : MatrixType::RowsAtCompileTime,
48  ColsAtCompileTime = Direction==Horizontal ? 1 : MatrixType::ColsAtCompileTime,
49  MaxRowsAtCompileTime = Direction==Vertical ? 1 : MatrixType::MaxRowsAtCompileTime,
50  MaxColsAtCompileTime = Direction==Horizontal ? 1 : MatrixType::MaxColsAtCompileTime,
51  Flags = RowsAtCompileTime == 1 ? RowMajorBit : 0,
52  TraversalSize = Direction==Vertical ? MatrixType::RowsAtCompileTime : MatrixType::ColsAtCompileTime
53  };
54 };
55 }
56 
57 template< typename MatrixType, typename MemberOp, int Direction>
58 class PartialReduxExpr : public internal::dense_xpr_base< PartialReduxExpr<MatrixType, MemberOp, Direction> >::type,
59  internal::no_assignment_operator
60 {
61  public:
62 
63  typedef typename internal::dense_xpr_base<PartialReduxExpr>::type Base;
64  EIGEN_DENSE_PUBLIC_INTERFACE(PartialReduxExpr)
65  typedef typename internal::traits<PartialReduxExpr>::MatrixTypeNested MatrixTypeNested;
66  typedef typename internal::traits<PartialReduxExpr>::_MatrixTypeNested _MatrixTypeNested;
67 
68  EIGEN_DEVICE_FUNC
69  explicit PartialReduxExpr(const MatrixType& mat, const MemberOp& func = MemberOp())
70  : m_matrix(mat), m_functor(func) {}
71 
72  EIGEN_DEVICE_FUNC
73  Index rows() const { return (Direction==Vertical ? 1 : m_matrix.rows()); }
74  EIGEN_DEVICE_FUNC
75  Index cols() const { return (Direction==Horizontal ? 1 : m_matrix.cols()); }
76 
77  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar coeff(Index i, Index j) const
78  {
79  if (Direction==Vertical)
80  return m_functor(m_matrix.col(j));
81  else
82  return m_functor(m_matrix.row(i));
83  }
84 
85  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar coeff(Index index) const
86  {
87  if (Direction==Vertical)
88  return m_functor(m_matrix.col(index));
89  else
90  return m_functor(m_matrix.row(index));
91  }
92 
93  protected:
94  MatrixTypeNested m_matrix;
95  const MemberOp m_functor;
96 };
97 
98 #define EIGEN_MEMBER_FUNCTOR(MEMBER,COST) \
99  template <typename ResultType> \
100  struct member_##MEMBER { \
101  EIGEN_EMPTY_STRUCT_CTOR(member_##MEMBER) \
102  typedef ResultType result_type; \
103  template<typename Scalar, int Size> struct Cost \
104  { enum { value = COST }; }; \
105  template<typename XprType> \
106  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE \
107  ResultType operator()(const XprType& mat) const \
108  { return mat.MEMBER(); } \
109  }
110 
111 namespace internal {
112 
113 EIGEN_MEMBER_FUNCTOR(squaredNorm, Size * NumTraits<Scalar>::MulCost + (Size-1)*NumTraits<Scalar>::AddCost);
114 EIGEN_MEMBER_FUNCTOR(norm, (Size+5) * NumTraits<Scalar>::MulCost + (Size-1)*NumTraits<Scalar>::AddCost);
115 EIGEN_MEMBER_FUNCTOR(stableNorm, (Size+5) * NumTraits<Scalar>::MulCost + (Size-1)*NumTraits<Scalar>::AddCost);
116 EIGEN_MEMBER_FUNCTOR(blueNorm, (Size+5) * NumTraits<Scalar>::MulCost + (Size-1)*NumTraits<Scalar>::AddCost);
117 EIGEN_MEMBER_FUNCTOR(hypotNorm, (Size-1) * functor_traits<scalar_hypot_op<Scalar> >::Cost );
118 EIGEN_MEMBER_FUNCTOR(sum, (Size-1)*NumTraits<Scalar>::AddCost);
119 EIGEN_MEMBER_FUNCTOR(mean, (Size-1)*NumTraits<Scalar>::AddCost + NumTraits<Scalar>::MulCost);
120 EIGEN_MEMBER_FUNCTOR(minCoeff, (Size-1)*NumTraits<Scalar>::AddCost);
121 EIGEN_MEMBER_FUNCTOR(maxCoeff, (Size-1)*NumTraits<Scalar>::AddCost);
122 EIGEN_MEMBER_FUNCTOR(all, (Size-1)*NumTraits<Scalar>::AddCost);
123 EIGEN_MEMBER_FUNCTOR(any, (Size-1)*NumTraits<Scalar>::AddCost);
124 EIGEN_MEMBER_FUNCTOR(count, (Size-1)*NumTraits<Scalar>::AddCost);
125 EIGEN_MEMBER_FUNCTOR(prod, (Size-1)*NumTraits<Scalar>::MulCost);
126 
127 
128 template <typename BinaryOp, typename Scalar>
129 struct member_redux {
130  typedef typename result_of<
131  BinaryOp(Scalar,Scalar)
132  >::type result_type;
133  template<typename _Scalar, int Size> struct Cost
134  { enum { value = (Size-1) * functor_traits<BinaryOp>::Cost }; };
135  EIGEN_DEVICE_FUNC explicit member_redux(const BinaryOp func) : m_functor(func) {}
136  template<typename Derived>
137  EIGEN_DEVICE_FUNC inline result_type operator()(const DenseBase<Derived>& mat) const
138  { return mat.redux(m_functor); }
139  const BinaryOp m_functor;
140 };
141 }
142 
160 template<typename ExpressionType, int Direction> class VectorwiseOp
161 {
162  public:
163 
164  typedef typename ExpressionType::Scalar Scalar;
165  typedef typename ExpressionType::RealScalar RealScalar;
166  typedef Eigen::Index Index;
167  typedef typename internal::ref_selector<ExpressionType>::non_const_type ExpressionTypeNested;
168  typedef typename internal::remove_all<ExpressionTypeNested>::type ExpressionTypeNestedCleaned;
169 
170  template<template<typename _Scalar> class Functor,
171  typename Scalar_=Scalar> struct ReturnType
172  {
173  typedef PartialReduxExpr<ExpressionType,
174  Functor<Scalar_>,
175  Direction
176  > Type;
177  };
178 
179  template<typename BinaryOp> struct ReduxReturnType
180  {
181  typedef PartialReduxExpr<ExpressionType,
182  internal::member_redux<BinaryOp,Scalar>,
183  Direction
184  > Type;
185  };
186 
187  enum {
188  isVertical = (Direction==Vertical) ? 1 : 0,
189  isHorizontal = (Direction==Horizontal) ? 1 : 0
190  };
191 
192  protected:
193 
196  typedef typename internal::conditional<isVertical,
197  typename ExpressionType::ColXpr,
198  typename ExpressionType::RowXpr>::type SubVector;
199  EIGEN_DEVICE_FUNC
200  SubVector subVector(Index i)
201  {
202  return SubVector(m_matrix.derived(),i);
203  }
204 
207  EIGEN_DEVICE_FUNC
208  Index subVectors() const
209  { return isVertical?m_matrix.cols():m_matrix.rows(); }
210 
211  template<typename OtherDerived> struct ExtendedType {
212  typedef Replicate<OtherDerived,
213  isVertical ? 1 : ExpressionType::RowsAtCompileTime,
214  isHorizontal ? 1 : ExpressionType::ColsAtCompileTime> Type;
215  };
216 
219  template<typename OtherDerived>
220  EIGEN_DEVICE_FUNC
221  typename ExtendedType<OtherDerived>::Type
222  extendedTo(const DenseBase<OtherDerived>& other) const
223  {
224  EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(isVertical, OtherDerived::MaxColsAtCompileTime==1),
225  YOU_PASSED_A_ROW_VECTOR_BUT_A_COLUMN_VECTOR_WAS_EXPECTED)
226  EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(isHorizontal, OtherDerived::MaxRowsAtCompileTime==1),
227  YOU_PASSED_A_COLUMN_VECTOR_BUT_A_ROW_VECTOR_WAS_EXPECTED)
228  return typename ExtendedType<OtherDerived>::Type
229  (other.derived(),
230  isVertical ? 1 : m_matrix.rows(),
231  isHorizontal ? 1 : m_matrix.cols());
232  }
233 
234  template<typename OtherDerived> struct OppositeExtendedType {
235  typedef Replicate<OtherDerived,
236  isHorizontal ? 1 : ExpressionType::RowsAtCompileTime,
237  isVertical ? 1 : ExpressionType::ColsAtCompileTime> Type;
238  };
239 
242  template<typename OtherDerived>
243  EIGEN_DEVICE_FUNC
244  typename OppositeExtendedType<OtherDerived>::Type
245  extendedToOpposite(const DenseBase<OtherDerived>& other) const
246  {
247  EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(isHorizontal, OtherDerived::MaxColsAtCompileTime==1),
248  YOU_PASSED_A_ROW_VECTOR_BUT_A_COLUMN_VECTOR_WAS_EXPECTED)
249  EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(isVertical, OtherDerived::MaxRowsAtCompileTime==1),
250  YOU_PASSED_A_COLUMN_VECTOR_BUT_A_ROW_VECTOR_WAS_EXPECTED)
251  return typename OppositeExtendedType<OtherDerived>::Type
252  (other.derived(),
253  isHorizontal ? 1 : m_matrix.rows(),
254  isVertical ? 1 : m_matrix.cols());
255  }
256 
257  public:
258  EIGEN_DEVICE_FUNC
259  explicit inline VectorwiseOp(ExpressionType& matrix) : m_matrix(matrix) {}
260 
262  EIGEN_DEVICE_FUNC
263  inline const ExpressionType& _expression() const { return m_matrix; }
264 
272  template<typename BinaryOp>
273  EIGEN_DEVICE_FUNC
274  const typename ReduxReturnType<BinaryOp>::Type
275  redux(const BinaryOp& func = BinaryOp()) const
276  { return typename ReduxReturnType<BinaryOp>::Type(_expression(), internal::member_redux<BinaryOp,Scalar>(func)); }
277 
278  typedef typename ReturnType<internal::member_minCoeff>::Type MinCoeffReturnType;
279  typedef typename ReturnType<internal::member_maxCoeff>::Type MaxCoeffReturnType;
280  typedef typename ReturnType<internal::member_squaredNorm,RealScalar>::Type SquaredNormReturnType;
281  typedef typename ReturnType<internal::member_norm,RealScalar>::Type NormReturnType;
282  typedef typename ReturnType<internal::member_blueNorm,RealScalar>::Type BlueNormReturnType;
283  typedef typename ReturnType<internal::member_stableNorm,RealScalar>::Type StableNormReturnType;
284  typedef typename ReturnType<internal::member_hypotNorm,RealScalar>::Type HypotNormReturnType;
285  typedef typename ReturnType<internal::member_sum>::Type SumReturnType;
286  typedef typename ReturnType<internal::member_mean>::Type MeanReturnType;
287  typedef typename ReturnType<internal::member_all>::Type AllReturnType;
288  typedef typename ReturnType<internal::member_any>::Type AnyReturnType;
289  typedef PartialReduxExpr<ExpressionType, internal::member_count<Index>, Direction> CountReturnType;
290  typedef typename ReturnType<internal::member_prod>::Type ProdReturnType;
291  typedef Reverse<ExpressionType, Direction> ReverseReturnType;
292 
302  EIGEN_DEVICE_FUNC
303  const MinCoeffReturnType minCoeff() const
304  { return MinCoeffReturnType(_expression()); }
305 
315  EIGEN_DEVICE_FUNC
316  const MaxCoeffReturnType maxCoeff() const
317  { return MaxCoeffReturnType(_expression()); }
318 
327  EIGEN_DEVICE_FUNC
328  const SquaredNormReturnType squaredNorm() const
329  { return SquaredNormReturnType(_expression()); }
330 
339  EIGEN_DEVICE_FUNC
340  const NormReturnType norm() const
341  { return NormReturnType(_expression()); }
342 
343 
350  EIGEN_DEVICE_FUNC
351  const BlueNormReturnType blueNorm() const
352  { return BlueNormReturnType(_expression()); }
353 
354 
361  EIGEN_DEVICE_FUNC
362  const StableNormReturnType stableNorm() const
363  { return StableNormReturnType(_expression()); }
364 
365 
372  EIGEN_DEVICE_FUNC
373  const HypotNormReturnType hypotNorm() const
374  { return HypotNormReturnType(_expression()); }
375 
383  EIGEN_DEVICE_FUNC
384  const SumReturnType sum() const
385  { return SumReturnType(_expression()); }
386 
391  EIGEN_DEVICE_FUNC
392  const MeanReturnType mean() const
393  { return MeanReturnType(_expression()); }
394 
400  EIGEN_DEVICE_FUNC
401  const AllReturnType all() const
402  { return AllReturnType(_expression()); }
403 
409  EIGEN_DEVICE_FUNC
410  const AnyReturnType any() const
411  { return Any(_expression()); }
412 
422  EIGEN_DEVICE_FUNC
423  const CountReturnType count() const
424  { return CountReturnType(_expression()); }
425 
433  EIGEN_DEVICE_FUNC
434  const ProdReturnType prod() const
435  { return ProdReturnType(_expression()); }
436 
437 
445  EIGEN_DEVICE_FUNC
446  const ReverseReturnType reverse() const
447  { return ReverseReturnType( _expression() ); }
448 
450  EIGEN_DEVICE_FUNC
451  const ReplicateReturnType replicate(Index factor) const;
452 
461  // NOTE implemented here because of sunstudio's compilation errors
462  // isVertical*Factor+isHorizontal instead of (isVertical?Factor:1) to handle CUDA bug with ternary operator
464  EIGEN_DEVICE_FUNC
465  replicate(Index factor = Factor) const
466  {
468  (_expression(),isVertical?factor:1,isHorizontal?factor:1);
469  }
470 
472 
474  template<typename OtherDerived>
475  EIGEN_DEVICE_FUNC
476  ExpressionType& operator=(const DenseBase<OtherDerived>& other)
477  {
478  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
479  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
480  //eigen_assert((m_matrix.isNull()) == (other.isNull())); FIXME
481  return const_cast<ExpressionType&>(m_matrix = extendedTo(other.derived()));
482  }
483 
485  template<typename OtherDerived>
486  EIGEN_DEVICE_FUNC
487  ExpressionType& operator+=(const DenseBase<OtherDerived>& other)
488  {
489  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
490  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
491  return const_cast<ExpressionType&>(m_matrix += extendedTo(other.derived()));
492  }
493 
495  template<typename OtherDerived>
496  EIGEN_DEVICE_FUNC
497  ExpressionType& operator-=(const DenseBase<OtherDerived>& other)
498  {
499  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
500  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
501  return const_cast<ExpressionType&>(m_matrix -= extendedTo(other.derived()));
502  }
503 
505  template<typename OtherDerived>
506  EIGEN_DEVICE_FUNC
507  ExpressionType& operator*=(const DenseBase<OtherDerived>& other)
508  {
509  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
510  EIGEN_STATIC_ASSERT_ARRAYXPR(ExpressionType)
511  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
512  m_matrix *= extendedTo(other.derived());
513  return const_cast<ExpressionType&>(m_matrix);
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_ARRAYXPR(ExpressionType)
523  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
524  m_matrix /= extendedTo(other.derived());
525  return const_cast<ExpressionType&>(m_matrix);
526  }
527 
529  template<typename OtherDerived> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
531  const ExpressionTypeNestedCleaned,
532  const typename ExtendedType<OtherDerived>::Type>
533  operator+(const DenseBase<OtherDerived>& other) const
534  {
535  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
536  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
537  return m_matrix + extendedTo(other.derived());
538  }
539 
541  template<typename OtherDerived>
542  EIGEN_DEVICE_FUNC
544  const ExpressionTypeNestedCleaned,
545  const typename ExtendedType<OtherDerived>::Type>
546  operator-(const DenseBase<OtherDerived>& other) const
547  {
548  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
549  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
550  return m_matrix - extendedTo(other.derived());
551  }
552 
555  template<typename OtherDerived> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
557  const ExpressionTypeNestedCleaned,
558  const typename ExtendedType<OtherDerived>::Type>
559  EIGEN_DEVICE_FUNC
560  operator*(const DenseBase<OtherDerived>& other) const
561  {
562  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
563  EIGEN_STATIC_ASSERT_ARRAYXPR(ExpressionType)
564  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
565  return m_matrix * extendedTo(other.derived());
566  }
567 
570  template<typename OtherDerived>
571  EIGEN_DEVICE_FUNC
573  const ExpressionTypeNestedCleaned,
574  const typename ExtendedType<OtherDerived>::Type>
575  operator/(const DenseBase<OtherDerived>& other) const
576  {
577  EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
578  EIGEN_STATIC_ASSERT_ARRAYXPR(ExpressionType)
579  EIGEN_STATIC_ASSERT_SAME_XPR_KIND(ExpressionType, OtherDerived)
580  return m_matrix / extendedTo(other.derived());
581  }
582 
587  EIGEN_DEVICE_FUNC
588  CwiseBinaryOp<internal::scalar_quotient_op<Scalar>,
589  const ExpressionTypeNestedCleaned,
590  const typename OppositeExtendedType<typename ReturnType<internal::member_norm,RealScalar>::Type>::Type>
591  normalized() const { return m_matrix.cwiseQuotient(extendedToOpposite(this->norm())); }
592 
593 
597  EIGEN_DEVICE_FUNC void normalize() {
598  m_matrix = this->normalized();
599  }
600 
601  EIGEN_DEVICE_FUNC inline void reverseInPlace();
602 
604 
605  typedef Homogeneous<ExpressionType,Direction> HomogeneousReturnType;
606  HomogeneousReturnType homogeneous() const;
607 
608  typedef typename ExpressionType::PlainObject CrossReturnType;
609  template<typename OtherDerived>
610  EIGEN_DEVICE_FUNC
611  const CrossReturnType cross(const MatrixBase<OtherDerived>& other) const;
612 
613  enum {
614  HNormalized_Size = Direction==Vertical ? internal::traits<ExpressionType>::RowsAtCompileTime
615  : internal::traits<ExpressionType>::ColsAtCompileTime,
616  HNormalized_SizeMinusOne = HNormalized_Size==Dynamic ? Dynamic : HNormalized_Size-1
617  };
618  typedef Block<const ExpressionType,
619  Direction==Vertical ? int(HNormalized_SizeMinusOne)
620  : int(internal::traits<ExpressionType>::RowsAtCompileTime),
621  Direction==Horizontal ? int(HNormalized_SizeMinusOne)
622  : int(internal::traits<ExpressionType>::ColsAtCompileTime)>
623  HNormalized_Block;
624  typedef Block<const ExpressionType,
625  Direction==Vertical ? 1 : int(internal::traits<ExpressionType>::RowsAtCompileTime),
626  Direction==Horizontal ? 1 : int(internal::traits<ExpressionType>::ColsAtCompileTime)>
627  HNormalized_Factors;
628  typedef CwiseBinaryOp<internal::scalar_quotient_op<typename internal::traits<ExpressionType>::Scalar>,
629  const HNormalized_Block,
630  const Replicate<HNormalized_Factors,
631  Direction==Vertical ? HNormalized_SizeMinusOne : 1,
632  Direction==Horizontal ? HNormalized_SizeMinusOne : 1> >
633  HNormalizedReturnType;
634 
635  const HNormalizedReturnType hnormalized() const;
636 
637  protected:
638  ExpressionTypeNested m_matrix;
639 };
640 
641 //const colwise moved to DenseBase.h due to CUDA compiler bug
642 
643 
648 template<typename Derived>
649 inline typename DenseBase<Derived>::ColwiseReturnType
651 {
652  return ColwiseReturnType(derived());
653 }
654 
655 //const rowwise moved to DenseBase.h due to CUDA compiler bug
656 
657 
662 template<typename Derived>
665 {
666  return RowwiseReturnType(derived());
667 }
668 
669 } // end namespace Eigen
670 
671 #endif // EIGEN_PARTIAL_REDUX_H
CwiseBinaryOp< internal::scalar_quotient_op< Scalar >, const ExpressionTypeNestedCleaned, const typename ExtendedType< OtherDerived >::Type > operator/(const DenseBase< OtherDerived > &other) const
Definition: VectorwiseOp.h:575
ExpressionType & operator+=(const DenseBase< OtherDerived > &other)
Definition: VectorwiseOp.h:487
CwiseBinaryOp< internal::scalar_quotient_op< Scalar >, const ExpressionTypeNestedCleaned, const typename OppositeExtendedType< typename ReturnType< internal::member_norm, RealScalar >::Type >::Type > normalized() const
Definition: VectorwiseOp.h:591
const ReverseReturnType reverse() const
Definition: VectorwiseOp.h:446
const MeanReturnType mean() const
Definition: VectorwiseOp.h:392
ExpressionType & operator*=(const DenseBase< OtherDerived > &other)
Definition: VectorwiseOp.h:507
Definition: Constants.h:257
void normalize()
Definition: VectorwiseOp.h:597
Eigen::Index Index
Definition: VectorwiseOp.h:166
CwiseBinaryOp< internal::scalar_product_op< Scalar >, const ExpressionTypeNestedCleaned, const typename ExtendedType< OtherDerived >::Type > operator*(const DenseBase< OtherDerived > &other) const
Definition: VectorwiseOp.h:560
const ProdReturnType prod() const
Definition: VectorwiseOp.h:434
ExpressionType & operator=(const DenseBase< OtherDerived > &other)
Definition: VectorwiseOp.h:476
Definition: LDLT.h:16
ExpressionType & operator-=(const DenseBase< OtherDerived > &other)
Definition: VectorwiseOp.h:497
const CountReturnType count() const
Definition: VectorwiseOp.h:423
const SumReturnType sum() const
Definition: VectorwiseOp.h:384
Generic expression of a partially reduxed matrix.
Definition: ForwardDeclarations.h:241
Pseudo expression providing partial reduction operations.
Definition: ForwardDeclarations.h:242
const HypotNormReturnType hypotNorm() const
Definition: VectorwiseOp.h:373
ConstColwiseReturnType colwise() const
Definition: DenseBase.h:517
const unsigned int RowMajorBit
Definition: Constants.h:53
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:41
const AnyReturnType any() const
Definition: VectorwiseOp.h:410
const StableNormReturnType stableNorm() const
Definition: VectorwiseOp.h:362
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:78
CwiseBinaryOp< internal::scalar_sum_op< Scalar >, const ExpressionTypeNestedCleaned, const typename ExtendedType< OtherDerived >::Type > operator+(const DenseBase< OtherDerived > &other) const
Definition: VectorwiseOp.h:533
const MinCoeffReturnType minCoeff() const
Definition: VectorwiseOp.h:303
Expression of the multiple replication of a matrix or vector.
Definition: Replicate.h:60
const AllReturnType all() const
Definition: VectorwiseOp.h:401
Definition: Constants.h:260
Definition: Eigen_Colamd.h:54
const MaxCoeffReturnType maxCoeff() const
Definition: VectorwiseOp.h:316
ExpressionType & operator/=(const DenseBase< OtherDerived > &other)
Definition: VectorwiseOp.h:519
const Replicate< ExpressionType, isVertical *Factor+isHorizontal, isHorizontal *Factor+isVertical > replicate(Index factor=Factor) const
Definition: VectorwiseOp.h:465
const SquaredNormReturnType squaredNorm() const
Definition: VectorwiseOp.h:328
ConstRowwiseReturnType rowwise() const
Definition: DenseBase.h:505
const NormReturnType norm() const
Definition: VectorwiseOp.h:340
const ReduxReturnType< BinaryOp >::Type redux(const BinaryOp &func=BinaryOp()) const
Definition: VectorwiseOp.h:275
CwiseBinaryOp< internal::scalar_difference_op< Scalar >, const ExpressionTypeNestedCleaned, const typename ExtendedType< OtherDerived >::Type > operator-(const DenseBase< OtherDerived > &other) const
Definition: VectorwiseOp.h:546
Expression of the reverse of a vector or matrix.
Definition: Reverse.h:63
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
const BlueNormReturnType blueNorm() const
Definition: VectorwiseOp.h:351
Expression of one (or a set of) homogeneous vector(s)
Definition: ForwardDeclarations.h:275