10 #ifndef EIGEN_SELFCWISEBINARYOP_H 11 #define EIGEN_SELFCWISEBINARYOP_H 31 template<
typename BinaryOp,
typename Lhs,
typename Rhs>
33 :
traits<CwiseBinaryOp<BinaryOp,Lhs,Rhs> >
39 OuterStrideAtCompileTime = Lhs::OuterStrideAtCompileTime,
40 InnerStrideAtCompileTime = Lhs::InnerStrideAtCompileTime
57 inline Index rows()
const {
return m_matrix.rows(); }
58 inline Index cols()
const {
return m_matrix.cols(); }
59 inline Index outerStride()
const {
return m_matrix.outerStride(); }
60 inline Index innerStride()
const {
return m_matrix.innerStride(); }
61 inline const Scalar* data()
const {
return m_matrix.data(); }
65 inline Scalar& coeffRef(Index row, Index col)
67 EIGEN_STATIC_ASSERT_LVALUE(Lhs)
68 return m_matrix.const_cast_derived().coeffRef(row, col);
70 inline const Scalar& coeffRef(Index row, Index col)
const 72 return m_matrix.coeffRef(row, col);
77 inline Scalar& coeffRef(Index index)
79 EIGEN_STATIC_ASSERT_LVALUE(Lhs)
80 return m_matrix.const_cast_derived().coeffRef(index);
82 inline const Scalar& coeffRef(Index index)
const 84 return m_matrix.const_cast_derived().coeffRef(index);
87 template<
typename OtherDerived>
90 OtherDerived& _other = other.const_cast_derived();
91 eigen_internal_assert(row >= 0 && row < rows()
92 && col >= 0 && col < cols());
93 Scalar& tmp = m_matrix.coeffRef(row,col);
94 tmp = m_functor(tmp, _other.coeff(row,col));
97 template<
typename OtherDerived>
100 OtherDerived& _other = other.const_cast_derived();
101 eigen_internal_assert(index >= 0 && index < m_matrix.size());
102 Scalar& tmp = m_matrix.coeffRef(index);
103 tmp = m_functor(tmp, _other.coeff(index));
106 template<
typename OtherDerived,
int StoreMode,
int LoadMode>
109 OtherDerived& _other = other.const_cast_derived();
110 eigen_internal_assert(row >= 0 && row < rows()
111 && col >= 0 && col < cols());
112 m_matrix.template writePacket<StoreMode>(row, col,
113 m_functor.packetOp(m_matrix.template packet<StoreMode>(row, col),_other.template packet<LoadMode>(row, col)) );
116 template<
typename OtherDerived,
int StoreMode,
int LoadMode>
119 OtherDerived& _other = other.const_cast_derived();
120 eigen_internal_assert(index >= 0 && index < m_matrix.size());
121 m_matrix.template writePacket<StoreMode>(index,
122 m_functor.packetOp(m_matrix.template packet<StoreMode>(index),_other.template packet<LoadMode>(index)) );
127 template<
typename RhsDerived>
130 EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Lhs,RhsDerived)
133 #ifdef EIGEN_DEBUG_ASSIGN 136 eigen_assert(rows() == rhs.rows() && cols() == rhs.cols());
138 #ifndef EIGEN_NO_DEBUG 139 this->checkTransposeAliasing(rhs.derived());
150 return Base::operator=(rhs);
153 Lhs& expression()
const 158 const BinaryOp& functor()
const 165 const BinaryOp& m_functor;
171 template<
typename Derived>
174 typedef typename Derived::PlainObject PlainObject;
176 tmp = PlainObject::Constant(rows(),cols(),other);
180 template<
typename Derived>
183 typedef typename Derived::PlainObject PlainObject;
185 tmp = PlainObject::Constant(rows(),cols(), other);
191 #endif // EIGEN_SELFCWISEBINARYOP_H Definition: gtest_unittest.cc:5031
const unsigned int DirectAccessBit
Means that the underlying array of coefficients can be directly accessed as a plain strided array...
Definition: Constants.h:142
const unsigned int LvalueBit
Means the expression has a coeffRef() method, i.e.
Definition: Constants.h:131
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:41
Definition: XprHelper.h:350
Definition: SelfCwiseBinaryOp.h:45
Definition: benchGeometry.cpp:23
Definition: BandTriangularSolver.h:13
Definition: ForwardDeclarations.h:17
double Scalar
Common scalar type.
Definition: FlexibleKalmanBase.h:48