10 #ifndef EIGEN_CWISE_NULLARY_OP_H 11 #define EIGEN_CWISE_NULLARY_OP_H 16 template<
typename NullaryOp,
typename PlainObjectType>
59 template<
typename NullaryOp,
typename PlainObjectType>
69 : m_rows(rows), m_cols(cols), m_functor(func)
72 && (RowsAtCompileTime ==
Dynamic || RowsAtCompileTime == rows)
74 && (ColsAtCompileTime ==
Dynamic || ColsAtCompileTime == cols));
84 const NullaryOp&
functor()
const {
return m_functor; }
106 template<
typename Derived>
107 template<
typename CustomNullaryOp>
132 template<
typename Derived>
133 template<
typename CustomNullaryOp>
151 template<
typename Derived>
152 template<
typename CustomNullaryOp>
172 template<
typename Derived>
194 template<
typename Derived>
210 template<
typename Derived>
222 template<
typename Derived>
234 template<
typename Derived>
266 template<
typename Derived>
278 template<
typename Derived>
288 template<
typename Derived>
293 for(
Index j = 0; j < cols(); ++j)
294 for(
Index i = 0; i < rows(); ++i)
295 if(!internal::isApprox(
self.coeff(i, j), val, prec))
303 template<
typename Derived>
307 return isApproxToConstant(val, prec);
314 template<
typename Derived>
324 template<
typename Derived>
327 return derived() = Constant(rows(), cols(), val);
339 template<
typename Derived>
344 return setConstant(val);
358 template<
typename Derived>
363 return setConstant(val);
382 template<
typename Derived>
402 template<
typename Derived>
406 return setLinSpaced(
size(), low, high);
425 template<
typename Derived>
429 return Constant(rows, cols,
Scalar(0));
448 template<
typename Derived>
452 return Constant(size,
Scalar(0));
465 template<
typename Derived>
469 return Constant(
Scalar(0));
480 template<
typename Derived>
484 for(
Index j = 0; j < cols(); ++j)
485 for(
Index i = 0; i < rows(); ++i)
486 if(!internal::isMuchSmallerThan(
self.coeff(i, j), static_cast<Scalar>(1), prec))
498 template<
typename Derived>
501 return setConstant(
Scalar(0));
513 template<
typename Derived>
518 return setConstant(
Scalar(0));
531 template<
typename Derived>
536 return setConstant(
Scalar(0));
555 template<
typename Derived>
559 return Constant(rows, cols,
Scalar(1));
578 template<
typename Derived>
582 return Constant(newSize,
Scalar(1));
595 template<
typename Derived>
599 return Constant(
Scalar(1));
610 template<
typename Derived>
614 return isApproxToConstant(
Scalar(1), prec);
624 template<
typename Derived>
627 return setConstant(
Scalar(1));
639 template<
typename Derived>
644 return setConstant(
Scalar(1));
657 template<
typename Derived>
662 return setConstant(
Scalar(1));
681 template<
typename Derived>
698 template<
typename Derived>
715 template<
typename Derived>
720 for(
Index j = 0; j < cols(); ++j)
722 for(
Index i = 0; i < rows(); ++i)
726 if(!internal::isApprox(
self.coeff(i, j), static_cast<Scalar>(1), prec))
731 if(!internal::isMuchSmallerThan(
self.coeff(i, j), static_cast<RealScalar>(1), prec))
741 template<
typename Derived,
bool Big = (Derived::SizeAtCompileTime>=16)>
747 return m = Derived::Identity(m.rows(), m.cols());
751 template<
typename Derived>
758 const Index size = numext::mini(m.rows(), m.cols());
759 for(
Index i = 0; i <
size; ++i) m.coeffRef(i,i) =
typename Derived::Scalar(1);
773 template<
typename Derived>
789 template<
typename Derived>
792 derived().resize(rows, cols);
802 template<
typename Derived>
806 return BasisReturnType(SquareMatrixType::Identity(newSize,newSize), i);
817 template<
typename Derived>
830 template<
typename Derived>
832 {
return Derived::Unit(0); }
840 template<
typename Derived>
842 {
return Derived::Unit(1); }
850 template<
typename Derived>
852 {
return Derived::Unit(2); }
860 template<
typename Derived>
862 {
return Derived::Unit(3); }
866 #endif // EIGEN_CWISE_NULLARY_OP_H static EIGEN_DEVICE_FUNC const IdentityReturnType Identity()
Generic expression of a matrix where all coefficients are defined by a functor.
static EIGEN_DEVICE_FUNC const ConstantReturnType Ones()
static EIGEN_DEVICE_FUNC const BasisReturnType Unit(Index size, Index i)
internal::traits< Derived >::Scalar Scalar
void setIdentity(geometry_msgs::Transform &tx)
const internal::variable_if_dynamic< Index, ColsAtCompileTime > m_cols
#define EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
EIGEN_DEVICE_FUNC Derived & setZero()
static EIGEN_DEVICE_FUNC const BasisReturnType UnitY()
internal::traits< Derived >::Scalar Scalar
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & run(Derived &m)
EIGEN_DEVICE_FUNC void fill(const Scalar &value)
EIGEN_DEVICE_FUNC Derived & setOnes()
static constexpr size_t size(Tuple< Args... > &)
Provides access to the number of elements in a tuple as a compile-time constant expression.
static EIGEN_DEVICE_FUNC const BasisReturnType UnitW()
static EIGEN_DEVICE_FUNC const BasisReturnType UnitZ()
const internal::variable_if_dynamic< Index, RowsAtCompileTime > m_rows
EIGEN_DEVICE_FUNC Derived & setOnes(Index size)
const unsigned int RowMajorBit
EIGEN_DEVICE_FUNC Derived & setConstant(const Scalar &value)
const NullaryOp m_functor
static EIGEN_DEVICE_FUNC const BasisReturnType UnitX()
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
#define EIGEN_STATIC_ASSERT_FIXED_SIZE(TYPE)
EIGEN_DEVICE_FUNC Derived & setConstant(Index size, const Scalar &val)
EIGEN_DEVICE_FUNC const NullaryOp & functor() const
EIGEN_DEVICE_FUNC bool isZero(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
bool isIdentity(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
static EIGEN_DEVICE_FUNC const SequentialLinSpacedReturnType LinSpaced(Sequential_t, Index size, const Scalar &low, const Scalar &high)
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & run(Derived &m)
static EIGEN_DEVICE_FUNC const ConstantReturnType Zero()
NumTraits< Scalar >::Real RealScalar
Expression of a fixed-size or dynamic-size block.
EIGEN_DEVICE_FUNC bool isConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
EIGEN_DEVICE_FUNC Derived & setLinSpaced(Index size, const Scalar &low, const Scalar &high)
Sets a linearly spaced vector.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols() const
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObject > NullaryExpr(Index rows, Index cols, const CustomNullaryOp &func)
static EIGEN_DEVICE_FUNC const ConstantReturnType Constant(Index rows, Index cols, const Scalar &value)
EIGEN_DEVICE_FUNC bool isOnes(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
EIGEN_DEVICE_FUNC Derived & setIdentity()
internal::dense_xpr_base< CwiseNullaryOp >::type Base