Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
 Eigen  3.3.90 (git rev 598e1b6e54ec51c2448b1a10d4354f165f0b083e)
Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType > Class Template Reference

Detailed Description

template<typename NullaryOp, typename PlainObjectType> class Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >

Generic expression of a matrix where all coefficients are defined by a functor.

Template Parameters
 NullaryOp template functor implementing the operator PlainObjectType the underlying plain matrix/array type

This class represents an expression of a generic nullary operator. It is the return type of the Ones(), Zero(), Constant(), Identity() and Random() methods, and most of the time this is the only way it is used.

However, if you want to write a function returning such an expression, you will need to use this class.

The functor NullaryOp must expose one of the following method:

 operator()() if the procedural generation does not depend on the coefficient entries (e.g., random numbers) operator()(Index i) if the procedural generation makes sense for vectors only and that it depends on the coefficient index i (e.g., linspace) operator()(Index i,Index j) if the procedural generation depends on the matrix coordinates i, j (e.g., to generate a checkerboard with 0 and 1)

It is also possible to expose the last two operators if the generation makes sense for matrices but can be optimized for vectors.

See DenseBase::NullaryExpr(Index,const CustomNullaryOp&) for an example binding C++11 random number generators.

A nullary expression can also be used to implement custom sophisticated matrix manipulations that cannot be covered by the existing set of natively supported matrix manipulations. See this page for some examples and additional explanations on the behavior of CwiseNullaryOp.

class CwiseUnaryOp, class CwiseBinaryOp, DenseBase::NullaryExpr

Inherits type< CwiseNullaryOp< NullaryOp, PlainObjectType > >, and Eigen::internal::no_assignment_operator.

Public Member Functions

const NullaryOp & functor () const

◆ functor()

template<typename NullaryOp , typename PlainObjectType >
 const NullaryOp& Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >::functor ( ) const
inline
Returns
the functor representing the nullary operation

The documentation for this class was generated from the following file: