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>
109 #ifndef EIGEN_PARSED_BY_DOXYGEN 137 template<
typename Derived>
138 template<
typename CustomNullaryOp>
140 #ifndef EIGEN_PARSED_BY_DOXYGEN 161 template<
typename Derived>
162 template<
typename CustomNullaryOp>
164 #ifndef EIGEN_PARSED_BY_DOXYGEN 187 template<
typename Derived>
209 template<
typename Derived>
225 template<
typename Derived>
242 template<
typename Derived>
254 template<
typename Derived>
286 template<
typename Derived>
298 template<
typename Derived>
308 template<
typename Derived>
323 template<
typename Derived>
327 return isApproxToConstant(val, prec);
334 template<
typename Derived>
344 template<
typename Derived>
347 return derived() = Constant(
rows(),
cols(), val);
359 template<
typename Derived>
378 template<
typename Derived>
392 template<
typename Derived>
405 template<
typename Derived>
429 template<
typename Derived>
449 template<
typename Derived>
472 template<
typename Derived>
476 return Constant(rows, cols,
Scalar(0));
495 template<
typename Derived>
499 return Constant(size,
Scalar(0));
512 template<
typename Derived>
516 return Constant(
Scalar(0));
527 template<
typename Derived>
545 template<
typename Derived>
560 template<
typename Derived>
578 template<
typename Derived>
592 template<
typename Derived>
605 template<
typename Derived>
628 template<
typename Derived>
632 return Constant(rows, cols,
Scalar(1));
651 template<
typename Derived>
655 return Constant(newSize,
Scalar(1));
668 template<
typename Derived>
672 return Constant(
Scalar(1));
683 template<
typename Derived>
687 return isApproxToConstant(
Scalar(1), prec);
697 template<
typename Derived>
712 template<
typename Derived>
730 template<
typename Derived>
744 template<
typename Derived>
757 template<
typename Derived>
780 template<
typename Derived>
797 template<
typename Derived>
814 template<
typename Derived>
840 template<
typename Derived,
bool Big = (Derived::SizeAtCompileTime>=16)>
846 return m = Derived::Identity(m.rows(), m.cols());
850 template<
typename Derived>
872 template<
typename Derived>
888 template<
typename Derived>
891 derived().resize(rows, cols);
901 template<
typename Derived>
905 return BasisReturnType(SquareMatrixType::Identity(newSize,newSize), i);
916 template<
typename Derived>
929 template<
typename Derived>
931 {
return Derived::Unit(0); }
939 template<
typename Derived>
941 {
return Derived::Unit(1); }
949 template<
typename Derived>
951 {
return Derived::Unit(2); }
959 template<
typename Derived>
961 {
return Derived::Unit(3); }
971 template<
typename Derived>
977 derived().coeffRef(i) =
Scalar(1);
990 template<
typename Derived>
995 derived().resize(newSize);
1001 #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 ConstantReturnType Constant(Index rows, Index cols, const Scalar &value)
EIGEN_DEVICE_FUNC bool isConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
static EIGEN_DEVICE_FUNC const BasisReturnType Unit(Index size, Index i)
internal::traits< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::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
EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & run(Derived &m)
EIGEN_DEVICE_FUNC void fill(const Scalar &value)
EIGEN_DEVICE_FUNC Derived & setOnes()
EIGEN_DEVICE_FUNC Derived & setUnit(Index i)
Set the coefficients of *this to the i-th unit (basis) vector.
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)
EIGEN_DEPRECATED static EIGEN_DEVICE_FUNC const RandomAccessLinSpacedReturnType LinSpaced(Sequential_t, Index size, const Scalar &low, const Scalar &high)
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.
EIGEN_DEVICE_FUNC const NullaryOp & functor() const
EIGEN_DEVICE_FUNC CwiseNullaryOp(Index rows, Index cols, const NullaryOp &func=NullaryOp())
#define EIGEN_STATIC_ASSERT_FIXED_SIZE(TYPE)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const
EIGEN_DEVICE_FUNC Derived & setConstant(Index size, const Scalar &val)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & run(Derived &m)
EIGEN_CONSTEXPR Index size(const T &x)
#define EIGEN_DEVICE_FUNC
static EIGEN_DEVICE_FUNC const ConstantReturnType Zero()
NumTraits< Scalar >::Real RealScalar
Expression of a fixed-size or dynamic-size block.
EIGEN_DEVICE_FUNC Derived & setLinSpaced(Index size, const Scalar &low, const Scalar &high)
Sets a linearly spaced vector.
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
bool isIdentity(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObject > NullaryExpr(Index rows, Index cols, const CustomNullaryOp &func)
Generic expression where a coefficient-wise unary operator is applied to an expression.
EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
EIGEN_DEVICE_FUNC bool isOnes(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
EIGEN_DEVICE_FUNC Derived & setIdentity()
internal::dense_xpr_base< CwiseNullaryOp >::type Base
EIGEN_DEVICE_FUNC bool isZero(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const