MOAB  4.9.3pre
Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType > Class Template Reference

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

#include <CwiseNullaryOp.h>

Inheritance diagram for Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >:
Collaboration diagram for Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >:

List of all members.

Public Types

typedef
internal::dense_xpr_base
< CwiseNullaryOp >::type 
Base

Public Member Functions

EIGEN_DEVICE_FUNC CwiseNullaryOp (Index rows, Index cols, const NullaryOp &func=NullaryOp())
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Index 
rows () const
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Index 
cols () const
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const
Scalar 
coeff (Index rowId, Index colId) const
template<int LoadMode>
EIGEN_STRONG_INLINE PacketScalar packet (Index rowId, Index colId) const
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const
Scalar 
coeff (Index index) const
template<int LoadMode>
EIGEN_STRONG_INLINE PacketScalar packet (Index index) const
EIGEN_DEVICE_FUNC const NullaryOp & functor () const

Protected Attributes

const
internal::variable_if_dynamic
< Index, RowsAtCompileTime > 
m_rows
const
internal::variable_if_dynamic
< Index, ColsAtCompileTime > 
m_cols
const NullaryOp m_functor

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:
NullaryOptemplate functor implementing the operator
PlainObjectTypethe 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.

See also:
class CwiseUnaryOp, class CwiseBinaryOp, DenseBase::NullaryExpr()

Definition at line 43 of file CwiseNullaryOp.h.


Member Typedef Documentation

template<typename NullaryOp, typename PlainObjectType>
typedef internal::dense_xpr_base<CwiseNullaryOp>::type Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >::Base

Definition at line 47 of file CwiseNullaryOp.h.


Constructor & Destructor Documentation

template<typename NullaryOp, typename PlainObjectType>
EIGEN_DEVICE_FUNC Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >::CwiseNullaryOp ( Index  rows,
Index  cols,
const NullaryOp &  func = NullaryOp() 
) [inline]

Definition at line 51 of file CwiseNullaryOp.h.

      : m_rows(rows), m_cols(cols), m_functor(func)
    {
      eigen_assert(rows >= 0
            && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows)
            &&  cols >= 0
            && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols));
    }

Member Function Documentation

template<typename NullaryOp, typename PlainObjectType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >::coeff ( Index  rowId,
Index  colId 
) const [inline]

Definition at line 66 of file CwiseNullaryOp.h.

    {
      return m_functor(rowId, colId);
    }
template<typename NullaryOp, typename PlainObjectType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >::coeff ( Index  index) const [inline]

Definition at line 78 of file CwiseNullaryOp.h.

    {
      return m_functor(index);
    }
template<typename NullaryOp, typename PlainObjectType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >::cols ( ) const [inline]

Definition at line 63 of file CwiseNullaryOp.h.

{ return m_cols.value(); }
template<typename NullaryOp, typename PlainObjectType>
EIGEN_DEVICE_FUNC const NullaryOp& Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >::functor ( ) const [inline]
Returns:
the functor representing the nullary operation

Definition at line 91 of file CwiseNullaryOp.h.

{ return m_functor; }
template<typename NullaryOp, typename PlainObjectType>
template<int LoadMode>
EIGEN_STRONG_INLINE PacketScalar Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >::packet ( Index  rowId,
Index  colId 
) const [inline]

Definition at line 72 of file CwiseNullaryOp.h.

    {
      return m_functor.packetOp(rowId, colId);
    }
template<typename NullaryOp, typename PlainObjectType>
template<int LoadMode>
EIGEN_STRONG_INLINE PacketScalar Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >::packet ( Index  index) const [inline]

Definition at line 84 of file CwiseNullaryOp.h.

    {
      return m_functor.packetOp(index);
    }
template<typename NullaryOp, typename PlainObjectType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >::rows ( ) const [inline]

Definition at line 61 of file CwiseNullaryOp.h.

{ return m_rows.value(); }

Member Data Documentation

template<typename NullaryOp, typename PlainObjectType>
const internal::variable_if_dynamic<Index, ColsAtCompileTime> Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >::m_cols [protected]

Definition at line 95 of file CwiseNullaryOp.h.

template<typename NullaryOp, typename PlainObjectType>
const NullaryOp Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >::m_functor [protected]

Definition at line 96 of file CwiseNullaryOp.h.

template<typename NullaryOp, typename PlainObjectType>
const internal::variable_if_dynamic<Index, RowsAtCompileTime> Eigen::CwiseNullaryOp< NullaryOp, PlainObjectType >::m_rows [protected]

Definition at line 94 of file CwiseNullaryOp.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines