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);
   793   return setIdentity();
   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 Generic expression of a matrix where all coefficients are defined by a functor. 
EIGEN_DEVICE_FUNC void fill(const Scalar &value)
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 isZero(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
internal::traits< Derived >::Scalar Scalar
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols() const
static EIGEN_DEVICE_FUNC const BasisReturnType UnitW()
EIGEN_DEVICE_FUNC Derived & setConstant(const Scalar &value)
EIGEN_DEVICE_FUNC Derived & setIdentity()
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & run(Derived &m)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const
EIGEN_DEVICE_FUNC Derived & setOnes()
EIGEN_DEVICE_FUNC Derived & setZero()
const internal::variable_if_dynamic< Index, RowsAtCompileTime > m_rows
static EIGEN_DEVICE_FUNC const BasisReturnType UnitY()
const unsigned int RowMajorBit
const NullaryOp m_functor
static EIGEN_DEVICE_FUNC const ConstantReturnType Zero()
EIGEN_DEVICE_FUNC Derived & setLinSpaced(Index size, const Scalar &low, const Scalar &high)
Sets a linearly spaced vector. 
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 bool isConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
static EIGEN_DEVICE_FUNC const BasisReturnType UnitZ()
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
EIGEN_DEVICE_FUNC Derived & setConstant(Index size, const Scalar &val)
static EIGEN_DEVICE_FUNC const IdentityReturnType Identity()
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & run(Derived &m)
EIGEN_DEVICE_FUNC Derived & setOnes(Index size)
NumTraits< Scalar >::Real RealScalar
Expression of a fixed-size or dynamic-size block. 
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
static EIGEN_DEVICE_FUNC const ConstantReturnType Ones()
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)
static EIGEN_DEVICE_FUNC const BasisReturnType UnitX()
static EIGEN_DEVICE_FUNC const ConstantReturnType Constant(Index rows, Index cols, const Scalar &value)
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
EIGEN_DEVICE_FUNC bool isOnes(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
static EIGEN_DEVICE_FUNC const BasisReturnType Unit(Index size, Index i)
static EIGEN_DEVICE_FUNC const SequentialLinSpacedReturnType LinSpaced(Sequential_t, Index size, const Scalar &low, const Scalar &high)
internal::dense_xpr_base< CwiseNullaryOp >::type Base