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>
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>
358 template<
typename Derived>
382 template<
typename Derived>
402 template<
typename Derived>
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>
498 template<
typename Derived>
513 template<
typename Derived>
531 template<
typename Derived>
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>
639 template<
typename Derived>
657 template<
typename Derived>
681 template<
typename Derived>
698 template<
typename Derived>
715 template<
typename Derived>
741 template<
typename Derived,
bool Big = (Derived::SizeAtCompileTime>=16)>
747 return m = Derived::Identity(m.rows(), m.cols());
751 template<
typename Derived>
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
const internal::variable_if_dynamic< Index, ColsAtCompileTime > m_cols
#define EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
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()
Namespace containing all symbols from the Eigen library.
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()
v setLinSpaced(5, 0.5f, 1.5f)
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
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
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 isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
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