Go to the documentation of this file.
10 #ifndef EIGEN_SPARSE_CWISE_BINARY_OP_H
11 #define EIGEN_SPARSE_CWISE_BINARY_OP_H
35 template<
typename BinaryOp,
typename Lhs,
typename Rhs>
49 THE_STORAGE_ORDER_OF_BOTH_SIDES_MUST_MATCH);
59 template<
typename BinaryOp,
typename Lhs,
typename Rhs>
76 : m_lhsIter(aEval.m_lhsImpl,outer), m_rhsIter(aEval.m_rhsImpl,outer), m_functor(aEval.m_functor)
83 if (m_lhsIter && m_rhsIter && (m_lhsIter.index() == m_rhsIter.index()))
85 m_id = m_lhsIter.
index();
86 m_value = m_functor(m_lhsIter.value(), m_rhsIter.value());
90 else if (m_lhsIter && (!m_rhsIter || (m_lhsIter.index() < m_rhsIter.index())))
92 m_id = m_lhsIter.index();
93 m_value = m_functor(m_lhsIter.value(),
Scalar(0));
96 else if (m_rhsIter && (!m_lhsIter || (m_lhsIter.index() > m_rhsIter.index())))
98 m_id = m_rhsIter.index();
99 m_value = m_functor(
Scalar(0), m_rhsIter.value());
130 Flags = XprType::Flags
134 : m_functor(xpr.functor()),
135 m_lhsImpl(xpr.lhs()),
143 return m_lhsImpl.nonZerosEstimate() + m_rhsImpl.nonZerosEstimate();
153 template<
typename BinaryOp,
typename Lhs,
typename Rhs>
170 : m_lhsEval(aEval.m_lhsImpl), m_rhsIter(aEval.m_rhsImpl,outer), m_functor(aEval.m_functor), m_value(0), m_id(-1), m_innerSize(aEval.m_expr.rhs().innerSize())
180 Scalar lhsVal = m_lhsEval.coeff(IsRowMajor?m_rhsIter.outer():m_id,
181 IsRowMajor?m_id:m_rhsIter.outer());
182 if(m_rhsIter && m_rhsIter.index()==m_id)
184 m_value = m_functor(lhsVal, m_rhsIter.value());
188 m_value = m_functor(lhsVal,
Scalar(0));
215 Flags = XprType::Flags
219 : m_functor(xpr.functor()),
220 m_lhsImpl(xpr.lhs()),
221 m_rhsImpl(xpr.rhs()),
229 return m_expr.size();
240 template<
typename BinaryOp,
typename Lhs,
typename Rhs>
257 : m_lhsIter(aEval.m_lhsImpl,outer), m_rhsEval(aEval.m_rhsImpl), m_functor(aEval.m_functor), m_value(0), m_id(-1), m_innerSize(aEval.m_expr.lhs().innerSize())
267 Scalar rhsVal = m_rhsEval.coeff(IsRowMajor?m_lhsIter.outer():m_id,
268 IsRowMajor?m_id:m_lhsIter.outer());
269 if(m_lhsIter && m_lhsIter.index()==m_id)
271 m_value = m_functor(m_lhsIter.value(), rhsVal);
275 m_value = m_functor(
Scalar(0),rhsVal);
302 Flags = XprType::Flags
306 : m_functor(xpr.functor()),
307 m_lhsImpl(xpr.lhs()),
308 m_rhsImpl(xpr.rhs()),
316 return m_expr.size();
333 template<
typename T1,
typename T2,
typename Lhs,
typename Rhs>
342 template<
typename T1,
typename T2,
typename Lhs,
typename Rhs>
351 template<
typename T1,
typename T2,
typename Lhs,
typename Rhs>
361 template<
typename T1,
typename T2,
typename Lhs,
typename Rhs>
371 template<
typename Lhs,
typename Rhs>
380 template<
typename Lhs,
typename Rhs>
389 template<
typename Lhs,
typename Rhs>
399 template<
typename XprType>
418 : m_lhsIter(aEval.m_lhsImpl,outer), m_rhsIter(aEval.m_rhsImpl,outer), m_functor(aEval.m_functor)
420 while (m_lhsIter && m_rhsIter && (m_lhsIter.index() != m_rhsIter.index()))
422 if (m_lhsIter.index() < m_rhsIter.index())
433 while (m_lhsIter && m_rhsIter && (m_lhsIter.index() != m_rhsIter.index()))
435 if (m_lhsIter.index() < m_rhsIter.index())
461 Flags = XprType::Flags
465 : m_functor(xpr.functor()),
466 m_lhsImpl(xpr.lhs()),
474 return (
std::min)(m_lhsImpl.nonZerosEstimate(), m_rhsImpl.nonZerosEstimate());
484 template<
typename XprType>
505 : m_lhsEval(aEval.m_lhsImpl), m_rhsIter(aEval.m_rhsImpl,outer), m_functor(aEval.m_functor), m_outer(outer)
515 {
return m_functor(m_lhsEval.coeff(IsRowMajor?m_outer:m_rhsIter.index(),IsRowMajor?m_rhsIter.index():m_outer), m_rhsIter.value()); }
534 Flags = XprType::Flags
538 : m_functor(xpr.functor()),
539 m_lhsImpl(xpr.lhs()),
547 return m_rhsImpl.nonZerosEstimate();
557 template<
typename XprType>
578 : m_lhsIter(aEval.m_lhsImpl,outer), m_rhsEval(aEval.m_rhsImpl), m_functor(aEval.m_functor), m_outer(outer)
588 {
return m_functor(m_lhsIter.value(),
589 m_rhsEval.coeff(IsRowMajor?m_outer:m_lhsIter.index(),IsRowMajor?m_lhsIter.index():m_outer)); }
608 Flags = XprType::Flags
612 : m_functor(xpr.functor()),
613 m_lhsImpl(xpr.lhs()),
621 return m_lhsImpl.nonZerosEstimate();
636 template<
typename Derived>
637 template<
typename OtherDerived>
644 template<
typename Derived>
645 template<
typename OtherDerived>
652 template<
typename Derived>
653 template<
typename OtherDerived>
657 return derived() = derived() -
other.derived();
660 template<
typename Derived>
661 template<
typename OtherDerived>
665 return derived() = derived() +
other.derived();
668 template<
typename Derived>
669 template<
typename OtherDerived>
676 template<
typename Derived>
677 template<
typename OtherDerived>
684 template<
typename Derived>
685 template<
typename OtherDerived>
692 template<
typename DenseDerived,
typename SparseDerived>
699 template<
typename SparseDerived,
typename DenseDerived>
700 EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_sum_op<typename SparseDerived::Scalar,typename DenseDerived::Scalar>,
const SparseDerived,
const DenseDerived>
706 template<
typename DenseDerived,
typename SparseDerived>
707 EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_difference_op<typename DenseDerived::Scalar,typename SparseDerived::Scalar>,
const DenseDerived,
const SparseDerived>
713 template<
typename SparseDerived,
typename DenseDerived>
714 EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_difference_op<typename SparseDerived::Scalar,typename DenseDerived::Scalar>,
const SparseDerived,
const DenseDerived>
722 #endif // EIGEN_SPARSE_CWISE_BINARY_OP_H
const EIGEN_STRONG_INLINE CwiseProductDenseReturnType< OtherDerived >::Type cwiseProduct(const MatrixBase< OtherDerived > &other) const
evaluator< RhsArg >::InnerIterator RhsIterator
EIGEN_STRONG_INLINE InnerIterator(const sparse_conjunction_evaluator &aEval, Index outer)
EIGEN_STRONG_INLINE Scalar value() const
EIGEN_STRONG_INLINE InnerIterator(const binary_evaluator &aEval, Index outer)
binary_evaluator(const XprType &xpr)
EIGEN_STRONG_INLINE Index row() const
sparse_conjunction_evaluator(const XprType &xpr)
Namespace containing all symbols from the Eigen library.
binary_evaluator(const XprType &xpr)
EIGEN_STRONG_INLINE InnerIterator & operator++()
const BinaryOp & m_functor
evaluator< RhsArg > RhsEvaluator
XprType::Functor BinaryOp
EIGEN_STRONG_INLINE StorageIndex index() const
sparse_conjunction_evaluator< XprType > Base
CwiseBinaryOp< scalar_boolean_and_op, Lhs, Rhs > XprType
EIGEN_STRONG_INLINE Index col() const
Generic expression where a coefficient-wise binary operator is applied to two expressions.
EIGEN_STRONG_INLINE Index row() const
sparse_conjunction_evaluator< XprType > Base
const EIGEN_STRONG_INLINE CwiseBinaryOp< internal::scalar_sum_op< typename DenseDerived::Scalar, typename SparseDerived::Scalar >, const DenseDerived, const SparseDerived > operator+(const MatrixBase< DenseDerived > &a, const SparseMatrixBase< SparseDerived > &b)
Derived & operator-=(const SparseMatrixBase< OtherDerived > &other)
Index nonZerosEstimate() const
EIGEN_STRONG_INLINE Index outer() const
CwiseBinaryOp< scalar_product_op< T1, T2 >, Lhs, Rhs > XprType
sparse_conjunction_evaluator< XprType > Base
const evaluator< RhsArg > & m_rhsEval
EIGEN_STRONG_INLINE InnerIterator(const binary_evaluator &aEval, Index outer)
const unsigned int RowMajorBit
EIGEN_STRONG_INLINE InnerIterator(const sparse_conjunction_evaluator &aEval, Index outer)
binary_evaluator(const XprType &xpr)
Derived & operator+=(const SparseMatrixBase< OtherDerived > &other)
const BinaryOp & m_functor
const LhsEvaluator & m_lhsEval
binary_evaluator(const XprType &xpr)
EIGEN_STRONG_INLINE Index outer() const
Eigen::Triplet< double > T
EIGEN_STRONG_INLINE Index col() const
traits< XprType >::Scalar Scalar
const EIGEN_STRONG_INLINE CwiseBinaryOp< internal::scalar_difference_op< typename DenseDerived::Scalar, typename SparseDerived::Scalar >, const DenseDerived, const SparseDerived > operator-(const MatrixBase< DenseDerived > &a, const SparseMatrixBase< SparseDerived > &b)
sparse_conjunction_evaluator< XprType > Base
EIGEN_STRONG_INLINE InnerIterator & operator++()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment_no_alias(Dst &dst, const Src &src, const Func &func)
evaluator< Lhs > m_lhsImpl
EIGEN_STRONG_INLINE StorageIndex index() const
binary_evaluator(const XprType &xpr)
evaluator< RhsArg >::InnerIterator RhsIterator
traits< XprType >::Scalar Scalar
evaluator< Rhs >::InnerIterator RhsIterator
EIGEN_STRONG_INLINE Index outer() const
evaluator< Rhs >::InnerIterator RhsIterator
XprType::StorageIndex StorageIndex
#define eigen_internal_assert(x)
evaluator< LhsArg >::InnerIterator LhsIterator
EIGEN_STRONG_INLINE Index row() const
sparse_conjunction_evaluator(const XprType &xpr)
const evaluator< Lhs > & m_lhsEval
evaluator< Lhs >::InnerIterator LhsIterator
Index nonZerosEstimate() const
#define EIGEN_SPARSE_PUBLIC_INTERFACE(Derived)
EIGEN_STRONG_INLINE Index col() const
traits< XprType >::Scalar Scalar
evaluator< Lhs >::InnerIterator LhsIterator
const evaluator< Rhs > & m_rhsEval
binary_evaluator(const XprType &xpr)
binary_evaluator(const XprType &xpr)
evaluator< RhsArg > m_rhsImpl
evaluator< LhsArg >::InnerIterator LhsIterator
sparse_conjunction_evaluator< XprType > Base
evaluator< Rhs > m_rhsImpl
XprType::Functor BinaryOp
CwiseBinaryOp< scalar_product_op< T1, T2 >, Lhs, Rhs > XprType
EIGEN_STRONG_INLINE Scalar value() const
XprType::StorageIndex StorageIndex
EIGEN_STRONG_INLINE Scalar value() const
binary_evaluator(const XprType &xpr)
EIGEN_STRONG_INLINE Index outer() const
evaluator< LhsArg > m_lhsImpl
evaluator< LhsArg > LhsEvaluator
CwiseBinaryOp< BinaryOp, Lhs, Rhs > XprType
EIGEN_STRONG_INLINE InnerIterator & operator++()
EIGEN_STRONG_INLINE Scalar value() const
#define EIGEN_STRONG_INLINE
EIGEN_STRONG_INLINE StorageIndex index() const
evaluator< Rhs > m_rhsImpl
CwiseBinaryOp< BinaryOp, Lhs, Rhs > XprType
CwiseBinaryOp< scalar_boolean_and_op, Lhs, Rhs > XprType
sparse_conjunction_evaluator(const XprType &xpr)
EIGEN_STRONG_INLINE StorageIndex index() const
static const Pose3 T2(Rot3::Rodrigues(0.3, 0.2, 0.1), P2)
evaluator< LhsArg > m_lhsImpl
EIGEN_STRONG_INLINE Scalar value() const
binary_evaluator(const XprType &xpr)
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 operator++(bfloat16 &a)
EIGEN_STRONG_INLINE InnerIterator & operator++()
An InnerIterator allows to loop over the element of any matrix expression.
sparse_conjunction_evaluator< XprType > Base
EIGEN_STRONG_INLINE Index row() const
evaluator< Rhs > m_rhsImpl
EIGEN_STRONG_INLINE Scalar value() const
Index nonZerosEstimate() const
evaluator< Lhs > m_lhsImpl
EIGEN_STRONG_INLINE InnerIterator(const sparse_conjunction_evaluator &aEval, Index outer)
CwiseBinaryOp< scalar_boolean_and_op, Lhs, Rhs > XprType
EIGEN_STRONG_INLINE InnerIterator & operator++()
EIGEN_STRONG_INLINE InnerIterator & operator++()
XprType::Functor BinaryOp
sparse_conjunction_evaluator< XprType > Base
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
CwiseBinaryOp< BinaryOp, Lhs, Rhs > XprType
EIGEN_STRONG_INLINE Index index() const
evaluator< LhsArg > m_lhsImpl
traits< XprType >::Scalar Scalar
binary_evaluator(const XprType &xpr)
const BinaryOp & m_functor
evaluator< Lhs > m_lhsImpl
traits< XprType >::Scalar Scalar
evaluator< RhsArg > m_rhsImpl
EIGEN_STRONG_INLINE StorageIndex index() const
Index nonZerosEstimate() const
Base class of any sparse matrices or sparse expressions.
EIGEN_STRONG_INLINE Index outer() const
EIGEN_STRONG_INLINE Index row() const
CwiseBinaryOp< scalar_quotient_op< T1, T2 >, Lhs, Rhs > XprType
EIGEN_STRONG_INLINE Index col() const
EIGEN_STRONG_INLINE Index col() const
EIGEN_STRONG_INLINE Index outer() const
XprType::StorageIndex StorageIndex
EIGEN_STRONG_INLINE Index row() const
XprType::StorageIndex StorageIndex
Base class for all dense matrices, vectors, and expressions.
Index nonZerosEstimate() const
CwiseBinaryOp< BinaryOp, Lhs, Rhs > Derived
static const Similarity3 T1(R, Point3(3.5, -8.2, 4.2), 1)
const BinaryOp & m_functor
#define EIGEN_INTERNAL_CHECK_COST_VALUE(C)
EIGEN_STRONG_INLINE StorageIndex index() const
EIGEN_STRONG_INLINE Index col() const
EIGEN_STRONG_INLINE InnerIterator(const binary_evaluator &aEval, Index outer)
CwiseBinaryOp< scalar_product_op< T1, T2 >, Lhs, Rhs > XprType
traits< XprType >::Scalar Scalar
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment(Dst &dst, const Src &src)
const BinaryOp & m_functor
evaluator< RhsArg > m_rhsImpl
Index nonZerosEstimate() const
SparseMatrixBase< Derived > Base
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
XprType::StorageIndex StorageIndex
XprType::StorageIndex StorageIndex
const BinaryOp & m_functor
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:04:28