MOAB  4.9.3pre
CommonCwiseUnaryOps.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CastXpr< NewType >

Typedefs

typedef CwiseUnaryOp
< internal::scalar_multiple_op
< Scalar >, const Derived > 
ScalarMultipleReturnType
typedef CwiseUnaryOp
< internal::scalar_multiple2_op
< Scalar, std::complex< Scalar >
>, const Derived > 
ScalarComplexMultipleReturnType
typedef CwiseUnaryOp
< internal::scalar_quotient1_op
< Scalar >, const Derived > 
ScalarQuotient1ReturnType
typedef internal::conditional
< NumTraits< Scalar >
::IsComplex, const
CwiseUnaryOp
< internal::scalar_conjugate_op
< Scalar >, const Derived >
, const Derived & >::type 
ConjugateReturnType
typedef internal::conditional
< NumTraits< Scalar >
::IsComplex, const
CwiseUnaryOp
< internal::scalar_real_op
< Scalar >, const Derived >
, const Derived & >::type 
RealReturnType
typedef internal::conditional
< NumTraits< Scalar >
::IsComplex, CwiseUnaryView
< internal::scalar_real_ref_op
< Scalar >, Derived >, Derived & >
::type 
NonConstRealReturnType
typedef CwiseUnaryOp
< internal::scalar_imag_op
< Scalar >, const Derived > 
ImagReturnType
typedef CwiseUnaryView
< internal::scalar_imag_ref_op
< Scalar >, Derived > 
NonConstImagReturnType
typedef CwiseUnaryOp
< internal::scalar_opposite_op
< Scalar >, const Derived > 
NegativeReturnType

Functions

EIGEN_DEVICE_FUNC const
NegativeReturnType 
operator- () const
EIGEN_DEVICE_FUNC const
ScalarMultipleReturnType 
operator* (const Scalar &scalar) const
EIGEN_DEVICE_FUNC const
ScalarQuotient1ReturnType 
operator/ (const Scalar &scalar) const
EIGEN_DEVICE_FUNC const
ScalarComplexMultipleReturnType 
operator* (const std::complex< Scalar > &scalar) const
EIGEN_DEVICE_FUNC friend const
ScalarMultipleReturnType 
operator* (const Scalar &scalar, const StorageBaseType &matrix)
EIGEN_DEVICE_FUNC friend const
CwiseUnaryOp
< internal::scalar_multiple2_op
< Scalar, std::complex< Scalar >
>, const Derived > 
operator* (const std::complex< Scalar > &scalar, const StorageBaseType &matrix)
template<typename NewType >
EIGEN_DEVICE_FUNC CastXpr
< NewType >::Type 
cast () const
EIGEN_DEVICE_FUNC
ConjugateReturnType 
conjugate () const
EIGEN_DEVICE_FUNC RealReturnType real () const
EIGEN_DEVICE_FUNC const
ImagReturnType 
imag () const
template<typename CustomUnaryOp >
EIGEN_DEVICE_FUNC const
CwiseUnaryOp< CustomUnaryOp,
const Derived > 
unaryExpr (const CustomUnaryOp &func=CustomUnaryOp()) const
 Apply a unary operator coefficient-wise.
template<typename CustomViewOp >
EIGEN_DEVICE_FUNC const
CwiseUnaryView< CustomViewOp,
const Derived > 
unaryViewExpr (const CustomViewOp &func=CustomViewOp()) const

Typedef Documentation

typedef internal::conditional<NumTraits<Scalar>::IsComplex, const CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>, const Derived>, const Derived& >::type ConjugateReturnType

the return type of conjugate()

Definition at line 25 of file CommonCwiseUnaryOps.h.

typedef CwiseUnaryOp<internal::scalar_imag_op<Scalar>, const Derived> ImagReturnType

the return type of imag() const

Definition at line 37 of file CommonCwiseUnaryOps.h.

typedef CwiseUnaryOp<internal::scalar_opposite_op<Scalar>, const Derived> NegativeReturnType

Definition at line 41 of file CommonCwiseUnaryOps.h.

typedef CwiseUnaryView<internal::scalar_imag_ref_op<Scalar>, Derived> NonConstImagReturnType

the return type of imag()

Definition at line 39 of file CommonCwiseUnaryOps.h.

typedef internal::conditional<NumTraits<Scalar>::IsComplex, CwiseUnaryView<internal::scalar_real_ref_op<Scalar>, Derived>, Derived& >::type NonConstRealReturnType

the return type of real()

Definition at line 35 of file CommonCwiseUnaryOps.h.

typedef internal::conditional<NumTraits<Scalar>::IsComplex, const CwiseUnaryOp<internal::scalar_real_op<Scalar>, const Derived>, const Derived& >::type RealReturnType

the return type of real() const

Definition at line 30 of file CommonCwiseUnaryOps.h.

typedef CwiseUnaryOp<internal::scalar_multiple2_op<Scalar,std::complex<Scalar> >, const Derived> ScalarComplexMultipleReturnType

Definition at line 17 of file CommonCwiseUnaryOps.h.

typedef CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const Derived> ScalarMultipleReturnType

Represents a scalar multiple of an expression

Definition at line 16 of file CommonCwiseUnaryOps.h.

typedef CwiseUnaryOp<internal::scalar_quotient1_op<Scalar>, const Derived> ScalarQuotient1ReturnType

Represents a quotient of an expression by a scalar

Definition at line 20 of file CommonCwiseUnaryOps.h.


Function Documentation

template<typename NewType >
EIGEN_DEVICE_FUNC CastXpr<NewType>::Type cast ( ) const
Returns:
an expression of *this with the Scalar type casted to NewScalar.

The template parameter NewScalar is the type we are casting the scalars to.

See also:
class CwiseUnaryOp

Definition at line 104 of file CommonCwiseUnaryOps.h.

{
  return typename CastXpr<NewType>::Type(derived());
}
EIGEN_DEVICE_FUNC ConjugateReturnType conjugate ( ) const [inline]
Returns:
an expression of the complex conjugate of *this.
See also:
adjoint()

Definition at line 114 of file CommonCwiseUnaryOps.h.

{
  return ConjugateReturnType(derived());
}
EIGEN_DEVICE_FUNC NonConstImagReturnType imag ( ) const [inline]
Returns:
an read-only expression of the imaginary part of *this.
See also:
real()
Returns:
a non const expression of the imaginary part of *this.
See also:
real()

Definition at line 131 of file CommonCwiseUnaryOps.h.

{ return ImagReturnType(derived()); }
EIGEN_DEVICE_FUNC const ScalarMultipleReturnType operator* ( const Scalar &  scalar) const [inline]
Returns:
an expression of *this scaled by the scalar factor scalar

Definition at line 56 of file CommonCwiseUnaryOps.h.

{
  return ScalarMultipleReturnType(derived(), internal::scalar_multiple_op<Scalar>(scalar));
}
EIGEN_DEVICE_FUNC const ScalarComplexMultipleReturnType operator* ( const std::complex< Scalar > &  scalar) const [inline]

Overloaded for efficient real matrix times complex scalar value

Definition at line 76 of file CommonCwiseUnaryOps.h.

{
  return ScalarComplexMultipleReturnType(derived(), internal::scalar_multiple2_op<Scalar,std::complex<Scalar> >(scalar));
}
EIGEN_DEVICE_FUNC friend const ScalarMultipleReturnType operator* ( const Scalar &  scalar,
const StorageBaseType &  matrix 
) [inline]

Definition at line 83 of file CommonCwiseUnaryOps.h.

{ return matrix*scalar; }
EIGEN_DEVICE_FUNC friend const CwiseUnaryOp<internal::scalar_multiple2_op<Scalar,std::complex<Scalar> >, const Derived> operator* ( const std::complex< Scalar > &  scalar,
const StorageBaseType &  matrix 
) [inline]

Definition at line 88 of file CommonCwiseUnaryOps.h.

{ return matrix*scalar; }
EIGEN_DEVICE_FUNC const NegativeReturnType operator- ( ) const [inline]
Returns:
an expression of the opposite of *this

Definition at line 50 of file CommonCwiseUnaryOps.h.

{ return NegativeReturnType(derived()); }
EIGEN_DEVICE_FUNC const ScalarQuotient1ReturnType operator/ ( const Scalar &  scalar) const [inline]
Returns:
an expression of *this divided by the scalar value scalar

Definition at line 68 of file CommonCwiseUnaryOps.h.

{
  return ScalarQuotient1ReturnType(derived(), internal::scalar_quotient1_op<Scalar>(scalar));
}
EIGEN_DEVICE_FUNC RealReturnType real ( ) const [inline]
Returns:
a read-only expression of the real part of *this.
See also:
imag()
Returns:
a non const expression of the real part of *this.
See also:
imag()

Definition at line 124 of file CommonCwiseUnaryOps.h.

{ return RealReturnType(derived()); }
template<typename CustomUnaryOp >
EIGEN_DEVICE_FUNC const CwiseUnaryOp<CustomUnaryOp, const Derived> unaryExpr ( const CustomUnaryOp &  func = CustomUnaryOp()) const [inline]

Apply a unary operator coefficient-wise.

Parameters:
[in]funcFunctor implementing the unary operator
Template Parameters:
CustomUnaryOpType of func
Returns:
An expression of a custom coefficient-wise unary operator func of *this

The function ptr_fun() from the C++ standard library can be used to make functors out of normal functions.

Example:

Output:

Genuine functors allow for more possibilities, for instance it may contain a state.

Example:

Output:

See also:
class CwiseUnaryOp, class CwiseBinaryOp

Definition at line 155 of file CommonCwiseUnaryOps.h.

{
  return CwiseUnaryOp<CustomUnaryOp, const Derived>(derived(), func);
}
template<typename CustomViewOp >
EIGEN_DEVICE_FUNC const CwiseUnaryView<CustomViewOp, const Derived> unaryViewExpr ( const CustomViewOp &  func = CustomViewOp()) const [inline]
Returns:
an expression of a custom coefficient-wise unary operator func of *this

The template parameter CustomUnaryOp is the type of the functor of the custom unary operator.

Example:

Output:

See also:
class CwiseUnaryOp, class CwiseBinaryOp

Definition at line 174 of file CommonCwiseUnaryOps.h.

{
  return CwiseUnaryView<CustomViewOp, const Derived>(derived(), func);
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines