10#ifndef EIGEN_CWISE_NULLARY_OP_H
11#define EIGEN_CWISE_NULLARY_OP_H
16template<
typename NullaryOp,
typename PlainObjectType>
59template<
typename NullaryOp,
typename PlainObjectType>
72 && (RowsAtCompileTime ==
Dynamic || RowsAtCompileTime ==
rows)
74 && (ColsAtCompileTime ==
Dynamic || ColsAtCompileTime ==
cols));
106template<
typename Derived>
107template<
typename CustomNullaryOp>
109#ifndef EIGEN_PARSED_BY_DOXYGEN
137template<
typename Derived>
138template<
typename CustomNullaryOp>
140#ifndef EIGEN_PARSED_BY_DOXYGEN
161template<
typename Derived>
162template<
typename CustomNullaryOp>
164#ifndef EIGEN_PARSED_BY_DOXYGEN
187template<
typename Derived>
209template<
typename Derived>
225template<
typename Derived>
242template<
typename Derived>
254template<
typename Derived>
260 return
DenseBase<Derived>::NullaryExpr(Derived::SizeAtCompileTime,
internal::linspaced_op<
Scalar>(low,high,Derived::SizeAtCompileTime));
286template<typename Derived>
298template<
typename Derived>
308template<
typename Derived>
313 for(
Index j = 0; j < cols(); ++j)
314 for(
Index i = 0; i < rows(); ++i)
323template<
typename Derived>
327 return isApproxToConstant(val, prec);
334template<
typename Derived>
344template<
typename Derived>
347 return derived() = Constant(rows(), cols(), val);
359template<
typename Derived>
364 return setConstant(val);
378template<
typename Derived>
383 return setConstant(val);
392template<
typename Derived>
396 return setConstant(rows(), cols, val);
405template<
typename Derived>
409 return setConstant(rows, cols(), val);
429template<
typename Derived>
449template<
typename Derived>
453 return setLinSpaced(
size(), low, high);
472template<
typename Derived>
476 return Constant(rows, cols,
Scalar(0));
495template<
typename Derived>
512template<
typename Derived>
516 return Constant(
Scalar(0));
527template<
typename Derived>
531 for(
Index j = 0; j < cols(); ++j)
532 for(
Index i = 0; i < rows(); ++i)
545template<
typename Derived>
548 return setConstant(
Scalar(0));
560template<
typename Derived>
565 return setConstant(
Scalar(0));
578template<
typename Derived>
583 return setConstant(
Scalar(0));
592template<
typename Derived>
596 return setZero(rows(), cols);
605template<
typename Derived>
609 return setZero(rows, cols());
628template<
typename Derived>
632 return Constant(rows, cols,
Scalar(1));
651template<
typename Derived>
655 return Constant(newSize,
Scalar(1));
668template<
typename Derived>
672 return Constant(
Scalar(1));
683template<
typename Derived>
687 return isApproxToConstant(
Scalar(1), prec);
697template<
typename Derived>
700 return setConstant(
Scalar(1));
712template<
typename Derived>
730template<
typename Derived>
735 return setConstant(
Scalar(1));
744template<
typename Derived>
748 return setOnes(rows, cols());
757template<
typename Derived>
761 return setOnes(rows(), cols);
780template<
typename Derived>
797template<
typename Derived>
814template<
typename Derived>
819 for(
Index j = 0; j < cols(); ++j)
821 for(
Index i = 0; i < rows(); ++i)
840template<
typename Derived,
bool Big = (Derived::SizeAtCompileTime>=16)>
846 return m = Derived::Identity(m.rows(), m.cols());
850template<
typename Derived>
858 for(
Index i = 0; i <
size; ++i) m.coeffRef(i,i) =
typename Derived::Scalar(1);
872template<
typename Derived>
888template<
typename Derived>
891 derived().resize(rows, cols);
892 return setIdentity();
901template<
typename Derived>
905 return BasisReturnType(SquareMatrixType::Identity(newSize,newSize), i);
916template<
typename Derived>
929template<
typename Derived>
931{
return Derived::Unit(0); }
939template<
typename Derived>
941{
return Derived::Unit(1); }
949template<
typename Derived>
951{
return Derived::Unit(2); }
959template<
typename Derived>
961{
return Derived::Unit(3); }
971template<
typename Derived>
977 derived().coeffRef(i) =
Scalar(1);
990template<
typename Derived>
995 derived().resize(newSize);
#define EIGEN_DEPRECATED
Definition: Macros.h:1068
#define EIGEN_CONSTEXPR
Definition: Macros.h:797
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:986
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
Definition: Macros.h:1293
#define eigen_assert(x)
Definition: Macros.h:1047
#define EIGEN_STRONG_INLINE
Definition: Macros.h:927
#define EIGEN_STATIC_ASSERT_FIXED_SIZE(TYPE)
Definition: StaticAssert.h:147
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Definition: StaticAssert.h:142
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:105
Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:61
EIGEN_DEVICE_FUNC CwiseNullaryOp(Index rows, Index cols, const NullaryOp &func=NullaryOp())
Definition: CwiseNullaryOp.h:68
const internal::variable_if_dynamic< Index, ColsAtCompileTime > m_cols
Definition: CwiseNullaryOp.h:88
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const
Definition: CwiseNullaryOp.h:78
const internal::variable_if_dynamic< Index, RowsAtCompileTime > m_rows
Definition: CwiseNullaryOp.h:87
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const
Definition: CwiseNullaryOp.h:80
EIGEN_DEVICE_FUNC const NullaryOp & functor() const
Definition: CwiseNullaryOp.h:84
const NullaryOp m_functor
Definition: CwiseNullaryOp.h:89
internal::dense_xpr_base< CwiseNullaryOp >::type Base
Definition: CwiseNullaryOp.h:64
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:47
static EIGEN_DEVICE_FUNC const ConstantReturnType Constant(Index rows, Index cols, const Scalar &value)
Definition: CwiseNullaryOp.h:189
static EIGEN_DEVICE_FUNC const ConstantReturnType Ones()
Definition: CwiseNullaryOp.h:670
EIGEN_DEVICE_FUNC Derived & setLinSpaced(Index size, const Scalar &low, const Scalar &high)
Sets a linearly spaced vector.
Definition: CwiseNullaryOp.h:430
EIGEN_DEVICE_FUNC Derived & setConstant(const Scalar &value)
Sets all coefficients in this expression to value val.
Definition: CwiseNullaryOp.h:345
NumTraits< Scalar >::Real RealScalar
Definition: DenseBase.h:73
EIGEN_DEVICE_FUNC void fill(const Scalar &value)
Alias for setConstant(): sets all coefficients in this expression to val.
Definition: CwiseNullaryOp.h:335
internal::traits< Derived >::Scalar Scalar
The numeric type of the expression' coefficients, e.g.
Definition: DenseBase.h:66
EIGEN_DEPRECATED static EIGEN_DEVICE_FUNC const RandomAccessLinSpacedReturnType LinSpaced(Sequential_t, Index size, const Scalar &low, const Scalar &high)
Definition: CwiseNullaryOp.h:244
static EIGEN_DEVICE_FUNC const ConstantReturnType Zero()
Definition: CwiseNullaryOp.h:514
EIGEN_DEVICE_FUNC bool isOnes(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:685
EIGEN_DEVICE_FUNC bool isZero(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:528
EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:310
EIGEN_DEVICE_FUNC bool isConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
This is just an alias for isApproxToConstant().
Definition: CwiseNullaryOp.h:325
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObject > NullaryExpr(Index rows, Index cols, const CustomNullaryOp &func)
EIGEN_DEVICE_FUNC Derived & setZero()
Sets all coefficients in this expression to zero.
Definition: CwiseNullaryOp.h:546
EIGEN_DEVICE_FUNC Derived & setOnes()
Sets all coefficients in this expression to one.
Definition: CwiseNullaryOp.h:698
static EIGEN_DEVICE_FUNC const BasisReturnType UnitZ()
Definition: CwiseNullaryOp.h:950
static EIGEN_DEVICE_FUNC const BasisReturnType Unit(Index size, Index i)
Definition: CwiseNullaryOp.h:902
static EIGEN_DEVICE_FUNC const IdentityReturnType Identity()
Definition: CwiseNullaryOp.h:799
bool isIdentity(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:816
static EIGEN_DEVICE_FUNC const BasisReturnType UnitY()
Definition: CwiseNullaryOp.h:940
static EIGEN_DEVICE_FUNC const BasisReturnType UnitX()
Definition: CwiseNullaryOp.h:930
static EIGEN_DEVICE_FUNC const BasisReturnType UnitW()
Definition: CwiseNullaryOp.h:960
EIGEN_DEVICE_FUNC Derived & setIdentity()
Writes the identity expression (not necessarily square) into *this.
Definition: CwiseNullaryOp.h:873
EIGEN_DEVICE_FUNC Derived & setUnit(Index i)
Set the coefficients of *this to the i-th unit (basis) vector.
Definition: CwiseNullaryOp.h:972
EIGEN_DEVICE_FUNC Derived & setOnes(Index size)
Resizes to the given newSize, and sets all coefficients in this expression to one.
Definition: CwiseNullaryOp.h:714
internal::traits< Derived >::Scalar Scalar
Definition: PlainObjectBase.h:106
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
Resizes to the given size, and sets all coefficients in this expression to zero.
Definition: CwiseNullaryOp.h:562
EIGEN_DEVICE_FUNC Derived & setConstant(Index size, const Scalar &val)
Resizes to the given size, and sets all coefficients in this expression to the given value val.
Definition: CwiseNullaryOp.h:361
Definition: XprHelper.h:110
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR T value()
Definition: XprHelper.h:135
type
Definition: core.h:575
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:66
EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Definition: MathFunctions.h:1947
EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Definition: MathFunctions.h:1940
EIGEN_CONSTEXPR Index size(const T &x)
Definition: Meta.h:479
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
Definition: MathFunctions.h:1083
Namespace containing all symbols from the Eigen library.
Definition: MatrixExponential.h:16
NoChange_t
Definition: Constants.h:360
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Sequential_t
Definition: Constants.h:361
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time,...
Definition: Constants.h:22
Definition: Eigen_Colamd.h:50
Definition: XprHelper.h:484
Definition: NullaryFunctors.h:131
Definition: NullaryFunctors.h:18
Definition: NullaryFunctors.h:31
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & run(Derived &m)
Definition: CwiseNullaryOp.h:854
Definition: CwiseNullaryOp.h:842
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & run(Derived &m)
Definition: CwiseNullaryOp.h:844
Definition: ForwardDeclarations.h:17