Macros | Functions
ArrayCwiseUnaryOps.h File Reference

Go to the source code of this file.

Macros

#define EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(METHOD_NAME, FUNCTOR)
#define EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(METHOD_NAME, FUNCTOR)

Functions

const CwiseUnaryOp
< internal::scalar_abs_op
< Scalar >, const Derived > 
abs () const
const CwiseUnaryOp
< internal::scalar_abs2_op
< Scalar >, const Derived > 
abs2 () const
const CwiseUnaryOp
< internal::scalar_acos_op
< Scalar >, const Derived > 
acos () const
const CwiseUnaryOp
< internal::scalar_asin_op
< Scalar >, const Derived > 
asin () const
const CwiseUnaryOp
< internal::scalar_cos_op
< Scalar >, const Derived > 
cos () const
const CwiseUnaryOp
< internal::scalar_cube_op
< Scalar >, const Derived > 
cube () const
const CwiseUnaryOp
< internal::scalar_exp_op
< Scalar >, const Derived > 
exp () const
const CwiseUnaryOp
< internal::scalar_inverse_op
< Scalar >, const Derived > 
inverse () const
const CwiseUnaryOp
< internal::scalar_log_op
< Scalar >, const Derived > 
log () const
const CwiseUnaryOp
< internal::scalar_pow_op
< Scalar >, const Derived > 
pow (const Scalar &exponent) const
const CwiseUnaryOp
< internal::scalar_sin_op
< Scalar >, const Derived > 
sin () const
const CwiseUnaryOp
< internal::scalar_sqrt_op
< Scalar >, const Derived > 
sqrt () const
const CwiseUnaryOp
< internal::scalar_square_op
< Scalar >, const Derived > 
square () const
const CwiseUnaryOp
< internal::scalar_tan_op
< Scalar >, Derived > 
tan () const

Macro Definition Documentation

#define EIGEN_MAKE_SCALAR_CWISE_UNARY_OP (   METHOD_NAME,
  FUNCTOR 
)
#define EIGEN_MAKE_SCALAR_CWISE_UNARY_OP (   METHOD_NAME,
  FUNCTOR 
)

Function Documentation

const CwiseUnaryOp<internal::scalar_abs_op<Scalar>, const Derived> abs ( ) const
inline
Returns:
an expression of the coefficient-wise absolute value of *this

Example:

Array3d v(1,-2,-3);
cout << v.abs() << endl;

Output:

1
2
3
See also:
abs2()
const CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, const Derived> abs2 ( ) const
inline
Returns:
an expression of the coefficient-wise squared absolute value of *this

Example:

Array3d v(1,-2,-3);
cout << v.abs2() << endl;

Output:

1
4
9
See also:
abs(), square()
const CwiseUnaryOp<internal::scalar_acos_op<Scalar>, const Derived> acos ( ) const
inline
Returns:
an expression of the coefficient-wise arc cosine of *this.

Example:

Array3d v(0, sqrt(2.)/2, 1);
cout << v.acos() << endl;

Output:

1.57
0.785
0
See also:
cos(), asin()

Referenced by QuaternionBase< Derived >::angularDistance(), AngleAxis< _Scalar >::operator=(), Eigen::internal::pacos(), and QuaternionBase< Derived >::slerp().

const CwiseUnaryOp<internal::scalar_asin_op<Scalar>, const Derived> asin ( ) const
inline
Returns:
an expression of the coefficient-wise arc sine of *this.

Example:

Output:

See also:
sin(), acos()

Referenced by Eigen::internal::pasin().

const CwiseUnaryOp<internal::scalar_cos_op<Scalar>, const Derived> cos ( ) const
inline
Returns:
an expression of the coefficient-wise cosine of *this.

Example:

Array3d v(M_PI, M_PI/2, M_PI/3);
cout << v.cos() << endl;

Output:

-1
6.12e-17
0.5
See also:
sin(), acos()

Referenced by QuaternionBase< Derived >::operator=(), Eigen::internal::pcos(), Rotation2D< _Scalar >::toRotationMatrix(), and AngleAxis< _Scalar >::toRotationMatrix().

const CwiseUnaryOp<internal::scalar_cube_op<Scalar>, const Derived> cube ( ) const
inline
Returns:
an expression of the coefficient-wise cube of *this.

Example:

Array3d v(2,3,4);
cout << v.cube() << endl;

Output:

8
27
64
See also:
square(), pow()
const CwiseUnaryOp<internal::scalar_exp_op<Scalar>, const Derived> exp ( ) const
inline
Returns:
an expression of the coefficient-wise exponential of *this.

Example:

Array3d v(1,2,3);
cout << v.exp() << endl;

Output:

2.72
7.39
20.1
See also:
pow(), log(), sin(), cos()

Referenced by Eigen::internal::pexp().

const CwiseUnaryOp<internal::scalar_inverse_op<Scalar>, const Derived> inverse ( ) const
inline
Returns:
an expression of the coefficient-wise inverse of *this.

Example:

Array3d v(2,3,4);
cout << v.inverse() << endl;

Output:

0.5
0.333
0.25
See also:
operator/(), operator*()
const CwiseUnaryOp<internal::scalar_log_op<Scalar>, const Derived> log ( ) const
inline
Returns:
an expression of the coefficient-wise logarithm of *this.

Example:

Array3d v(1,2,3);
cout << v.log() << endl;

Output:

0
0.693
1.1
See also:
exp()

Referenced by Eigen::internal::plog().

const CwiseUnaryOp<internal::scalar_pow_op<Scalar>, const Derived> pow ( const Scalar &  exponent) const
inline
Returns:
an expression of the coefficient-wise power of *this to the given exponent.

Example:

Array3d v(8,27,64);
cout << v.pow(0.333333) << endl;

Output:

2
3
4
See also:
exp(), log()

Referenced by MatrixBase< Derived >::blueNorm().

const CwiseUnaryOp<internal::scalar_sin_op<Scalar>, const Derived> sin ( ) const
inline
Returns:
an expression of the coefficient-wise sine of *this.

Example:

Array3d v(M_PI, M_PI/2, M_PI/3);
cout << v.sin() << endl;

Output:

1.22e-16
1
0.866
See also:
cos(), asin()

Referenced by QuaternionBase< Derived >::operator=(), Eigen::internal::psin(), QuaternionBase< Derived >::slerp(), Rotation2D< _Scalar >::toRotationMatrix(), and AngleAxis< _Scalar >::toRotationMatrix().

const CwiseUnaryOp<internal::scalar_sqrt_op<Scalar>, const Derived> sqrt ( ) const
inline
const CwiseUnaryOp<internal::scalar_square_op<Scalar>, const Derived> square ( ) const
inline
Returns:
an expression of the coefficient-wise square of *this.

Example:

Array3d v(2,3,4);
cout << v.square() << endl;

Output:

4
9
16
See also:
operator/(), operator*(), abs2()
const CwiseUnaryOp<internal::scalar_tan_op<Scalar>, Derived> tan ( ) const
inline
Returns:
an expression of the coefficient-wise tan of *this.

Example:

Array3d v(M_PI, M_PI/2, M_PI/3);
cout << v.tan() << endl;

Output:

-1.22e-16
1.63e+16
1.73
See also:
cos(), sin()

Referenced by Eigen::internal::ptan().