WPILibC++ 2023.4.3-108-ge5452e3
SparseCwiseBinaryOp.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-2014 Gael Guennebaud <gael.guennebaud@inria.fr>
5//
6// This Source Code Form is subject to the terms of the Mozilla
7// Public License v. 2.0. If a copy of the MPL was not distributed
8// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
10#ifndef EIGEN_SPARSE_CWISE_BINARY_OP_H
11#define EIGEN_SPARSE_CWISE_BINARY_OP_H
12
13namespace Eigen {
14
15// Here we have to handle 3 cases:
16// 1 - sparse op dense
17// 2 - dense op sparse
18// 3 - sparse op sparse
19// We also need to implement a 4th iterator for:
20// 4 - dense op dense
21// Finally, we also need to distinguish between the product and other operations :
22// configuration returned mode
23// 1 - sparse op dense product sparse
24// generic dense
25// 2 - dense op sparse product sparse
26// generic dense
27// 3 - sparse op sparse product sparse
28// generic sparse
29// 4 - dense op dense product dense
30// generic dense
31//
32// TODO to ease compiler job, we could specialize product/quotient with a scalar
33// and fallback to cwise-unary evaluator using bind1st_op and bind2nd_op.
34
35template<typename BinaryOp, typename Lhs, typename Rhs>
36class CwiseBinaryOpImpl<BinaryOp, Lhs, Rhs, Sparse>
37 : public SparseMatrixBase<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >
38{
39 public:
44 {
49 THE_STORAGE_ORDER_OF_BOTH_SIDES_MUST_MATCH);
50 }
51};
52
53namespace internal {
54
55
56// Generic "sparse OP sparse"
57template<typename XprType> struct binary_sparse_evaluator;
58
59template<typename BinaryOp, typename Lhs, typename Rhs>
61 : evaluator_base<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >
62{
63protected:
68 typedef typename XprType::StorageIndex StorageIndex;
69public:
70
72 {
73 public:
74
76 : m_lhsIter(aEval.m_lhsImpl,outer), m_rhsIter(aEval.m_rhsImpl,outer), m_functor(aEval.m_functor)
77 {
78 this->operator++();
79 }
80
82 {
83 if (m_lhsIter && m_rhsIter && (m_lhsIter.index() == m_rhsIter.index()))
84 {
85 m_id = m_lhsIter.index();
86 m_value = m_functor(m_lhsIter.value(), m_rhsIter.value());
87 ++m_lhsIter;
88 ++m_rhsIter;
89 }
90 else if (m_lhsIter && (!m_rhsIter || (m_lhsIter.index() < m_rhsIter.index())))
91 {
92 m_id = m_lhsIter.index();
93 m_value = m_functor(m_lhsIter.value(), Scalar(0));
94 ++m_lhsIter;
95 }
96 else if (m_rhsIter && (!m_lhsIter || (m_lhsIter.index() > m_rhsIter.index())))
97 {
98 m_id = m_rhsIter.index();
99 m_value = m_functor(Scalar(0), m_rhsIter.value());
100 ++m_rhsIter;
101 }
102 else
103 {
104 m_value = Scalar(0); // this is to avoid a compilation warning
105 m_id = -1;
106 }
107 return *this;
108 }
109
110 EIGEN_STRONG_INLINE Scalar value() const { return m_value; }
111
112 EIGEN_STRONG_INLINE StorageIndex index() const { return m_id; }
113 EIGEN_STRONG_INLINE Index outer() const { return m_lhsIter.outer(); }
114 EIGEN_STRONG_INLINE Index row() const { return Lhs::IsRowMajor ? m_lhsIter.row() : index(); }
115 EIGEN_STRONG_INLINE Index col() const { return Lhs::IsRowMajor ? index() : m_lhsIter.col(); }
116
117 EIGEN_STRONG_INLINE operator bool() const { return m_id>=0; }
118
119 protected:
122 const BinaryOp& m_functor;
125 };
126
127
128 enum {
130 Flags = XprType::Flags
131 };
132
133 explicit binary_evaluator(const XprType& xpr)
134 : m_functor(xpr.functor()),
135 m_lhsImpl(xpr.lhs()),
136 m_rhsImpl(xpr.rhs())
137 {
139 EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
140 }
141
142 inline Index nonZerosEstimate() const {
143 return m_lhsImpl.nonZerosEstimate() + m_rhsImpl.nonZerosEstimate();
144 }
145
146protected:
147 const BinaryOp m_functor;
150};
151
152// dense op sparse
153template<typename BinaryOp, typename Lhs, typename Rhs>
155 : evaluator_base<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >
156{
157protected:
161 typedef typename XprType::StorageIndex StorageIndex;
162public:
163
165 {
166 enum { IsRowMajor = (int(Rhs::Flags)&RowMajorBit)==RowMajorBit };
167 public:
168
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())
171 {
172 this->operator++();
173 }
174
176 {
177 ++m_id;
178 if(m_id<m_innerSize)
179 {
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)
183 {
184 m_value = m_functor(lhsVal, m_rhsIter.value());
185 ++m_rhsIter;
186 }
187 else
188 m_value = m_functor(lhsVal, Scalar(0));
189 }
190
191 return *this;
192 }
193
194 EIGEN_STRONG_INLINE Scalar value() const { eigen_internal_assert(m_id<m_innerSize); return m_value; }
195
196 EIGEN_STRONG_INLINE StorageIndex index() const { return m_id; }
197 EIGEN_STRONG_INLINE Index outer() const { return m_rhsIter.outer(); }
198 EIGEN_STRONG_INLINE Index row() const { return IsRowMajor ? m_rhsIter.outer() : m_id; }
199 EIGEN_STRONG_INLINE Index col() const { return IsRowMajor ? m_id : m_rhsIter.outer(); }
200
201 EIGEN_STRONG_INLINE operator bool() const { return m_id<m_innerSize; }
202
203 protected:
206 const BinaryOp& m_functor;
210 };
211
212
213 enum {
215 Flags = XprType::Flags
216 };
217
218 explicit binary_evaluator(const XprType& xpr)
219 : m_functor(xpr.functor()),
220 m_lhsImpl(xpr.lhs()),
221 m_rhsImpl(xpr.rhs()),
222 m_expr(xpr)
223 {
225 EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
226 }
227
228 inline Index nonZerosEstimate() const {
229 return m_expr.size();
230 }
231
232protected:
233 const BinaryOp m_functor;
237};
238
239// sparse op dense
240template<typename BinaryOp, typename Lhs, typename Rhs>
242 : evaluator_base<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >
243{
244protected:
248 typedef typename XprType::StorageIndex StorageIndex;
249public:
250
252 {
253 enum { IsRowMajor = (int(Lhs::Flags)&RowMajorBit)==RowMajorBit };
254 public:
255
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())
258 {
259 this->operator++();
260 }
261
263 {
264 ++m_id;
265 if(m_id<m_innerSize)
266 {
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)
270 {
271 m_value = m_functor(m_lhsIter.value(), rhsVal);
272 ++m_lhsIter;
274 else
275 m_value = m_functor(Scalar(0),rhsVal);
276 }
277
278 return *this;
279 }
281 EIGEN_STRONG_INLINE Scalar value() const { eigen_internal_assert(m_id<m_innerSize); return m_value; }
282
283 EIGEN_STRONG_INLINE StorageIndex index() const { return m_id; }
284 EIGEN_STRONG_INLINE Index outer() const { return m_lhsIter.outer(); }
285 EIGEN_STRONG_INLINE Index row() const { return IsRowMajor ? m_lhsIter.outer() : m_id; }
286 EIGEN_STRONG_INLINE Index col() const { return IsRowMajor ? m_id : m_lhsIter.outer(); }
287
288 EIGEN_STRONG_INLINE operator bool() const { return m_id<m_innerSize; }
289
290 protected:
293 const BinaryOp& m_functor;
297 };
298
299
300 enum {
302 Flags = XprType::Flags
303 };
304
305 explicit binary_evaluator(const XprType& xpr)
306 : m_functor(xpr.functor()),
307 m_lhsImpl(xpr.lhs()),
308 m_rhsImpl(xpr.rhs()),
309 m_expr(xpr)
310 {
312 EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
313 }
314
315 inline Index nonZerosEstimate() const {
316 return m_expr.size();
317 }
318
319protected:
320 const BinaryOp m_functor;
324};
325
326template<typename T,
327 typename LhsKind = typename evaluator_traits<typename T::Lhs>::Kind,
328 typename RhsKind = typename evaluator_traits<typename T::Rhs>::Kind,
329 typename LhsScalar = typename traits<typename T::Lhs>::Scalar,
331
332// "sparse .* sparse"
333template<typename T1, typename T2, typename Lhs, typename Rhs>
335 : sparse_conjunction_evaluator<CwiseBinaryOp<scalar_product_op<T1,T2>, Lhs, Rhs> >
336{
339 explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
340};
341// "dense .* sparse"
342template<typename T1, typename T2, typename Lhs, typename Rhs>
344 : sparse_conjunction_evaluator<CwiseBinaryOp<scalar_product_op<T1,T2>, Lhs, Rhs> >
345{
348 explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
349};
350// "sparse .* dense"
351template<typename T1, typename T2, typename Lhs, typename Rhs>
353 : sparse_conjunction_evaluator<CwiseBinaryOp<scalar_product_op<T1,T2>, Lhs, Rhs> >
354{
357 explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
358};
359
360// "sparse ./ dense"
361template<typename T1, typename T2, typename Lhs, typename Rhs>
363 : sparse_conjunction_evaluator<CwiseBinaryOp<scalar_quotient_op<T1,T2>, Lhs, Rhs> >
364{
367 explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
368};
369
370// "sparse && sparse"
371template<typename Lhs, typename Rhs>
373 : sparse_conjunction_evaluator<CwiseBinaryOp<scalar_boolean_and_op, Lhs, Rhs> >
374{
377 explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
378};
379// "dense && sparse"
380template<typename Lhs, typename Rhs>
382 : sparse_conjunction_evaluator<CwiseBinaryOp<scalar_boolean_and_op, Lhs, Rhs> >
383{
386 explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
387};
388// "sparse && dense"
389template<typename Lhs, typename Rhs>
391 : sparse_conjunction_evaluator<CwiseBinaryOp<scalar_boolean_and_op, Lhs, Rhs> >
392{
395 explicit binary_evaluator(const XprType& xpr) : Base(xpr) {}
396};
397
398// "sparse ^ sparse"
399template<typename XprType>
401 : evaluator_base<XprType>
402{
403protected:
404 typedef typename XprType::Functor BinaryOp;
405 typedef typename XprType::Lhs LhsArg;
406 typedef typename XprType::Rhs RhsArg;
409 typedef typename XprType::StorageIndex StorageIndex;
411public:
412
414 {
415 public:
416
418 : m_lhsIter(aEval.m_lhsImpl,outer), m_rhsIter(aEval.m_rhsImpl,outer), m_functor(aEval.m_functor)
419 {
420 while (m_lhsIter && m_rhsIter && (m_lhsIter.index() != m_rhsIter.index()))
421 {
422 if (m_lhsIter.index() < m_rhsIter.index())
423 ++m_lhsIter;
424 else
425 ++m_rhsIter;
426 }
427 }
428
430 {
431 ++m_lhsIter;
432 ++m_rhsIter;
433 while (m_lhsIter && m_rhsIter && (m_lhsIter.index() != m_rhsIter.index()))
434 {
435 if (m_lhsIter.index() < m_rhsIter.index())
436 ++m_lhsIter;
437 else
438 ++m_rhsIter;
439 }
440 return *this;
441 }
442
443 EIGEN_STRONG_INLINE Scalar value() const { return m_functor(m_lhsIter.value(), m_rhsIter.value()); }
444
445 EIGEN_STRONG_INLINE StorageIndex index() const { return m_lhsIter.index(); }
446 EIGEN_STRONG_INLINE Index outer() const { return m_lhsIter.outer(); }
447 EIGEN_STRONG_INLINE Index row() const { return m_lhsIter.row(); }
448 EIGEN_STRONG_INLINE Index col() const { return m_lhsIter.col(); }
449
450 EIGEN_STRONG_INLINE operator bool() const { return (m_lhsIter && m_rhsIter); }
451
452 protected:
456 };
457
458
459 enum {
461 Flags = XprType::Flags
462 };
463
464 explicit sparse_conjunction_evaluator(const XprType& xpr)
465 : m_functor(xpr.functor()),
466 m_lhsImpl(xpr.lhs()),
467 m_rhsImpl(xpr.rhs())
468 {
470 EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
471 }
472
473 inline Index nonZerosEstimate() const {
474 return (std::min)(m_lhsImpl.nonZerosEstimate(), m_rhsImpl.nonZerosEstimate());
475 }
476
477protected:
481};
482
483// "dense ^ sparse"
484template<typename XprType>
486 : evaluator_base<XprType>
487{
488protected:
489 typedef typename XprType::Functor BinaryOp;
490 typedef typename XprType::Lhs LhsArg;
491 typedef typename XprType::Rhs RhsArg;
494 typedef typename XprType::StorageIndex StorageIndex;
496public:
497
499 {
500 enum { IsRowMajor = (int(RhsArg::Flags)&RowMajorBit)==RowMajorBit };
501
502 public:
503
505 : m_lhsEval(aEval.m_lhsImpl), m_rhsIter(aEval.m_rhsImpl,outer), m_functor(aEval.m_functor), m_outer(outer)
506 {}
507
509 {
510 ++m_rhsIter;
511 return *this;
512 }
513
515 { return m_functor(m_lhsEval.coeff(IsRowMajor?m_outer:m_rhsIter.index(),IsRowMajor?m_rhsIter.index():m_outer), m_rhsIter.value()); }
516
517 EIGEN_STRONG_INLINE StorageIndex index() const { return m_rhsIter.index(); }
518 EIGEN_STRONG_INLINE Index outer() const { return m_rhsIter.outer(); }
519 EIGEN_STRONG_INLINE Index row() const { return m_rhsIter.row(); }
520 EIGEN_STRONG_INLINE Index col() const { return m_rhsIter.col(); }
521
522 EIGEN_STRONG_INLINE operator bool() const { return m_rhsIter; }
523
524 protected:
529 };
530
531
532 enum {
534 Flags = XprType::Flags
535 };
536
537 explicit sparse_conjunction_evaluator(const XprType& xpr)
538 : m_functor(xpr.functor()),
539 m_lhsImpl(xpr.lhs()),
540 m_rhsImpl(xpr.rhs())
541 {
543 EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
544 }
545
546 inline Index nonZerosEstimate() const {
547 return m_rhsImpl.nonZerosEstimate();
548 }
549
550protected:
554};
555
556// "sparse ^ dense"
557template<typename XprType>
559 : evaluator_base<XprType>
560{
561protected:
562 typedef typename XprType::Functor BinaryOp;
563 typedef typename XprType::Lhs LhsArg;
564 typedef typename XprType::Rhs RhsArg;
567 typedef typename XprType::StorageIndex StorageIndex;
569public:
570
572 {
573 enum { IsRowMajor = (int(LhsArg::Flags)&RowMajorBit)==RowMajorBit };
574
575 public:
576
578 : m_lhsIter(aEval.m_lhsImpl,outer), m_rhsEval(aEval.m_rhsImpl), m_functor(aEval.m_functor), m_outer(outer)
579 {}
580
582 {
583 ++m_lhsIter;
584 return *this;
585 }
586
588 { return m_functor(m_lhsIter.value(),
589 m_rhsEval.coeff(IsRowMajor?m_outer:m_lhsIter.index(),IsRowMajor?m_lhsIter.index():m_outer)); }
590
591 EIGEN_STRONG_INLINE StorageIndex index() const { return m_lhsIter.index(); }
592 EIGEN_STRONG_INLINE Index outer() const { return m_lhsIter.outer(); }
593 EIGEN_STRONG_INLINE Index row() const { return m_lhsIter.row(); }
594 EIGEN_STRONG_INLINE Index col() const { return m_lhsIter.col(); }
595
596 EIGEN_STRONG_INLINE operator bool() const { return m_lhsIter; }
597
598 protected:
603 };
604
605
606 enum {
608 Flags = XprType::Flags
609 };
610
611 explicit sparse_conjunction_evaluator(const XprType& xpr)
612 : m_functor(xpr.functor()),
613 m_lhsImpl(xpr.lhs()),
614 m_rhsImpl(xpr.rhs())
615 {
617 EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost);
618 }
619
620 inline Index nonZerosEstimate() const {
621 return m_lhsImpl.nonZerosEstimate();
622 }
623
624protected:
628};
629
630}
631
632/***************************************************************************
633* Implementation of SparseMatrixBase and SparseCwise functions/operators
634***************************************************************************/
635
636template<typename Derived>
637template<typename OtherDerived>
639{
641 return derived();
642}
643
644template<typename Derived>
645template<typename OtherDerived>
647{
649 return derived();
650}
651
652template<typename Derived>
653template<typename OtherDerived>
654EIGEN_STRONG_INLINE Derived &
656{
657 return derived() = derived() - other.derived();
658}
659
660template<typename Derived>
661template<typename OtherDerived>
662EIGEN_STRONG_INLINE Derived &
664{
665 return derived() = derived() + other.derived();
666}
667
668template<typename Derived>
669template<typename OtherDerived>
671{
673 return derived();
674}
675
676template<typename Derived>
677template<typename OtherDerived>
679{
681 return derived();
682}
683
684template<typename Derived>
685template<typename OtherDerived>
688{
689 return typename CwiseProductDenseReturnType<OtherDerived>::Type(derived(), other.derived());
690}
691
692template<typename DenseDerived, typename SparseDerived>
695{
696 return CwiseBinaryOp<internal::scalar_sum_op<typename DenseDerived::Scalar,typename SparseDerived::Scalar>, const DenseDerived, const SparseDerived>(a.derived(), b.derived());
697}
698
699template<typename SparseDerived, typename DenseDerived>
700EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_sum_op<typename SparseDerived::Scalar,typename DenseDerived::Scalar>, const SparseDerived, const DenseDerived>
702{
703 return CwiseBinaryOp<internal::scalar_sum_op<typename SparseDerived::Scalar,typename DenseDerived::Scalar>, const SparseDerived, const DenseDerived>(a.derived(), b.derived());
704}
705
706template<typename DenseDerived, typename SparseDerived>
707EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_difference_op<typename DenseDerived::Scalar,typename SparseDerived::Scalar>, const DenseDerived, const SparseDerived>
709{
710 return CwiseBinaryOp<internal::scalar_difference_op<typename DenseDerived::Scalar,typename SparseDerived::Scalar>, const DenseDerived, const SparseDerived>(a.derived(), b.derived());
711}
712
713template<typename SparseDerived, typename DenseDerived>
714EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_difference_op<typename SparseDerived::Scalar,typename DenseDerived::Scalar>, const SparseDerived, const DenseDerived>
716{
718}
719
720} // end namespace Eigen
721
722#endif // EIGEN_SPARSE_CWISE_BINARY_OP_H
#define eigen_internal_assert(x)
Definition: Macros.h:1053
#define EIGEN_STRONG_INLINE
Definition: Macros.h:927
#define EIGEN_SPARSE_PUBLIC_INTERFACE(Derived)
Definition: SparseUtil.h:43
#define EIGEN_INTERNAL_CHECK_COST_VALUE(C)
Definition: StaticAssert.h:218
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition: StaticAssert.h:127
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:84
CwiseBinaryOp< BinaryOp, Lhs, Rhs > Derived
Definition: SparseCwiseBinaryOp.h:40
SparseMatrixBase< Derived > Base
Definition: SparseCwiseBinaryOp.h:41
Definition: CwiseBinaryOp.h:150
Definition: DiagonalMatrix.h:19
EIGEN_DEVICE_FUNC const Derived & derived() const
Definition: DiagonalMatrix.h:41
An InnerIterator allows to loop over the element of any matrix expression.
Definition: CoreIterators.h:34
EIGEN_STRONG_INLINE Index index() const
Definition: CoreIterators.h:57
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:50
Base class of any sparse matrices or sparse expressions.
Definition: SparseMatrixBase.h:28
const Derived & derived() const
Definition: SparseMatrixBase.h:143
internal::traits< Block< SparseMatrix< _Scalar, _Options, _StorageIndex >, BlockRows, BlockCols, true > >::Scalar Scalar
Definition: SparseMatrixBase.h:31
Derived & operator-=(const SparseMatrixBase< OtherDerived > &other)
Derived & operator+=(const SparseMatrixBase< OtherDerived > &other)
EIGEN_STRONG_INLINE const CwiseProductDenseReturnType< OtherDerived >::Type cwiseProduct(const MatrixBase< OtherDerived > &other) const
EIGEN_STRONG_INLINE InnerIterator & operator++()
Definition: SparseCwiseBinaryOp.h:262
EIGEN_STRONG_INLINE InnerIterator(const binary_evaluator &aEval, Index outer)
Definition: SparseCwiseBinaryOp.h:256
EIGEN_STRONG_INLINE StorageIndex index() const
Definition: SparseCwiseBinaryOp.h:283
EIGEN_STRONG_INLINE StorageIndex index() const
Definition: SparseCwiseBinaryOp.h:112
EIGEN_STRONG_INLINE InnerIterator(const binary_evaluator &aEval, Index outer)
Definition: SparseCwiseBinaryOp.h:75
EIGEN_STRONG_INLINE InnerIterator(const binary_evaluator &aEval, Index outer)
Definition: SparseCwiseBinaryOp.h:169
EIGEN_STRONG_INLINE InnerIterator & operator++()
Definition: SparseCwiseBinaryOp.h:175
EIGEN_STRONG_INLINE StorageIndex index() const
Definition: SparseCwiseBinaryOp.h:196
EIGEN_STRONG_INLINE StorageIndex index() const
Definition: SparseCwiseBinaryOp.h:517
EIGEN_STRONG_INLINE InnerIterator & operator++()
Definition: SparseCwiseBinaryOp.h:508
EIGEN_STRONG_INLINE Index outer() const
Definition: SparseCwiseBinaryOp.h:518
EIGEN_STRONG_INLINE InnerIterator(const sparse_conjunction_evaluator &aEval, Index outer)
Definition: SparseCwiseBinaryOp.h:504
EIGEN_STRONG_INLINE Index row() const
Definition: SparseCwiseBinaryOp.h:519
EIGEN_STRONG_INLINE Index col() const
Definition: SparseCwiseBinaryOp.h:520
EIGEN_STRONG_INLINE Scalar value() const
Definition: SparseCwiseBinaryOp.h:514
EIGEN_STRONG_INLINE Index col() const
Definition: SparseCwiseBinaryOp.h:594
EIGEN_STRONG_INLINE InnerIterator & operator++()
Definition: SparseCwiseBinaryOp.h:581
EIGEN_STRONG_INLINE StorageIndex index() const
Definition: SparseCwiseBinaryOp.h:591
EIGEN_STRONG_INLINE Index row() const
Definition: SparseCwiseBinaryOp.h:593
EIGEN_STRONG_INLINE InnerIterator(const sparse_conjunction_evaluator &aEval, Index outer)
Definition: SparseCwiseBinaryOp.h:577
const evaluator< RhsArg > & m_rhsEval
Definition: SparseCwiseBinaryOp.h:600
EIGEN_STRONG_INLINE Scalar value() const
Definition: SparseCwiseBinaryOp.h:587
EIGEN_STRONG_INLINE Index outer() const
Definition: SparseCwiseBinaryOp.h:592
EIGEN_STRONG_INLINE Scalar value() const
Definition: SparseCwiseBinaryOp.h:443
EIGEN_STRONG_INLINE Index col() const
Definition: SparseCwiseBinaryOp.h:448
EIGEN_STRONG_INLINE Index outer() const
Definition: SparseCwiseBinaryOp.h:446
EIGEN_STRONG_INLINE StorageIndex index() const
Definition: SparseCwiseBinaryOp.h:445
EIGEN_STRONG_INLINE InnerIterator & operator++()
Definition: SparseCwiseBinaryOp.h:429
EIGEN_STRONG_INLINE InnerIterator(const sparse_conjunction_evaluator &aEval, Index outer)
Definition: SparseCwiseBinaryOp.h:417
EIGEN_STRONG_INLINE Index row() const
Definition: SparseCwiseBinaryOp.h:447
Definition: core.h:1240
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:66
constexpr common_t< T1, T2 > min(const T1 x, const T2 y) noexcept
Compile-time pairwise minimum function.
Definition: min.hpp:35
Type
Definition: Constants.h:471
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment_no_alias(Dst &dst, const Src &src, const Func &func)
Definition: AssignEvaluator.h:873
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment(Dst &dst, const Src &src)
Definition: AssignEvaluator.h:834
Namespace containing all symbols from the Eigen library.
Definition: Core:141
EIGEN_STRONG_INLINE const CwiseBinaryOp< internal::scalar_sum_op< typename DenseDerived::Scalar, typename SparseDerived::Scalar >, const DenseDerived, const SparseDerived > operator+(const MatrixBase< DenseDerived > &a, const SparseMatrixBase< SparseDerived > &b)
Definition: SparseCwiseBinaryOp.h:694
EIGEN_STRONG_INLINE const CwiseBinaryOp< internal::scalar_difference_op< typename DenseDerived::Scalar, typename SparseDerived::Scalar >, const DenseDerived, const SparseDerived > operator-(const MatrixBase< DenseDerived > &a, const SparseMatrixBase< SparseDerived > &b)
Definition: SparseCwiseBinaryOp.h:708
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Definition: Eigen_Colamd.h:50
b
Definition: data.h:44
unit_t< Units, T, NonLinearScale > & operator++(unit_t< Units, T, NonLinearScale > &u) noexcept
Definition: base.h:2346
Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor Matrix...
Definition: EigenBase.h:30
EIGEN_DEVICE_FUNC Derived & derived()
Definition: EigenBase.h:46
The type used to identify a general sparse storage.
Definition: Constants.h:510
Definition: Constants.h:542
Definition: Constants.h:545
Definition: AssignmentFunctors.h:46
Definition: AssignmentFunctors.h:21
evaluator< Rhs >::InnerIterator RhsIterator
Definition: SparseCwiseBinaryOp.h:65
evaluator< Lhs >::InnerIterator LhsIterator
Definition: SparseCwiseBinaryOp.h:64
CwiseBinaryOp< BinaryOp, Lhs, Rhs > XprType
Definition: SparseCwiseBinaryOp.h:66
evaluator< Lhs >::InnerIterator LhsIterator
Definition: SparseCwiseBinaryOp.h:245
CwiseBinaryOp< BinaryOp, Lhs, Rhs > XprType
Definition: SparseCwiseBinaryOp.h:246
CwiseBinaryOp< BinaryOp, Lhs, Rhs > XprType
Definition: SparseCwiseBinaryOp.h:159
evaluator< Rhs >::InnerIterator RhsIterator
Definition: SparseCwiseBinaryOp.h:158
CwiseBinaryOp< scalar_boolean_and_op, Lhs, Rhs > XprType
Definition: SparseCwiseBinaryOp.h:375
sparse_conjunction_evaluator< XprType > Base
Definition: SparseCwiseBinaryOp.h:376
CwiseBinaryOp< scalar_boolean_and_op, Lhs, Rhs > XprType
Definition: SparseCwiseBinaryOp.h:384
sparse_conjunction_evaluator< XprType > Base
Definition: SparseCwiseBinaryOp.h:385
sparse_conjunction_evaluator< XprType > Base
Definition: SparseCwiseBinaryOp.h:394
CwiseBinaryOp< scalar_boolean_and_op, Lhs, Rhs > XprType
Definition: SparseCwiseBinaryOp.h:393
CwiseBinaryOp< scalar_product_op< T1, T2 >, Lhs, Rhs > XprType
Definition: SparseCwiseBinaryOp.h:346
CwiseBinaryOp< scalar_product_op< T1, T2 >, Lhs, Rhs > XprType
Definition: SparseCwiseBinaryOp.h:337
CwiseBinaryOp< scalar_product_op< T1, T2 >, Lhs, Rhs > XprType
Definition: SparseCwiseBinaryOp.h:355
CwiseBinaryOp< scalar_quotient_op< T1, T2 >, Lhs, Rhs > XprType
Definition: SparseCwiseBinaryOp.h:365
Definition: CoreEvaluators.h:61
Definition: SparseCwiseBinaryOp.h:57
Definition: CoreEvaluators.h:111
Definition: CoreEvaluators.h:91
Definition: XprHelper.h:176
Definition: Meta.h:148
Definition: BinaryFunctors.h:409
Definition: BinaryFunctors.h:71
Definition: BinaryFunctors.h:379
XprType::Functor BinaryOp
Definition: SparseCwiseBinaryOp.h:489
sparse_conjunction_evaluator(const XprType &xpr)
Definition: SparseCwiseBinaryOp.h:537
traits< XprType >::Scalar Scalar
Definition: SparseCwiseBinaryOp.h:495
evaluator< RhsArg >::InnerIterator RhsIterator
Definition: SparseCwiseBinaryOp.h:493
evaluator< LhsArg > LhsEvaluator
Definition: SparseCwiseBinaryOp.h:492
evaluator< RhsArg > m_rhsImpl
Definition: SparseCwiseBinaryOp.h:553
evaluator< LhsArg > m_lhsImpl
Definition: SparseCwiseBinaryOp.h:552
XprType::StorageIndex StorageIndex
Definition: SparseCwiseBinaryOp.h:494
evaluator< RhsArg > m_rhsImpl
Definition: SparseCwiseBinaryOp.h:627
sparse_conjunction_evaluator(const XprType &xpr)
Definition: SparseCwiseBinaryOp.h:611
XprType::Functor BinaryOp
Definition: SparseCwiseBinaryOp.h:562
XprType::StorageIndex StorageIndex
Definition: SparseCwiseBinaryOp.h:567
evaluator< LhsArg > m_lhsImpl
Definition: SparseCwiseBinaryOp.h:626
traits< XprType >::Scalar Scalar
Definition: SparseCwiseBinaryOp.h:568
evaluator< RhsArg > RhsEvaluator
Definition: SparseCwiseBinaryOp.h:566
evaluator< LhsArg >::InnerIterator LhsIterator
Definition: SparseCwiseBinaryOp.h:565
sparse_conjunction_evaluator(const XprType &xpr)
Definition: SparseCwiseBinaryOp.h:464
traits< XprType >::Scalar Scalar
Definition: SparseCwiseBinaryOp.h:410
evaluator< RhsArg >::InnerIterator RhsIterator
Definition: SparseCwiseBinaryOp.h:408
evaluator< RhsArg > m_rhsImpl
Definition: SparseCwiseBinaryOp.h:480
XprType::StorageIndex StorageIndex
Definition: SparseCwiseBinaryOp.h:409
evaluator< LhsArg > m_lhsImpl
Definition: SparseCwiseBinaryOp.h:479
evaluator< LhsArg >::InnerIterator LhsIterator
Definition: SparseCwiseBinaryOp.h:407
Definition: SparseCwiseBinaryOp.h:330
Definition: AssignmentFunctors.h:67
Definition: ForwardDeclarations.h:17