WPILibC++ 2023.4.3
ArrayCwiseUnaryOps.h File Reference

Go to the source code of this file.

Classes

struct  ShiftRightXpr< N >
 
struct  ShiftLeftXpr< N >
 

Typedefs

typedef CwiseUnaryOp< internal::scalar_abs_op< Scalar >, const Derived > AbsReturnType
 
typedef CwiseUnaryOp< internal::scalar_arg_op< Scalar >, const Derived > ArgReturnType
 
typedef CwiseUnaryOp< internal::scalar_abs2_op< Scalar >, const Derived > Abs2ReturnType
 
typedef CwiseUnaryOp< internal::scalar_sqrt_op< Scalar >, const Derived > SqrtReturnType
 
typedef CwiseUnaryOp< internal::scalar_rsqrt_op< Scalar >, const Derived > RsqrtReturnType
 
typedef CwiseUnaryOp< internal::scalar_sign_op< Scalar >, const Derived > SignReturnType
 
typedef CwiseUnaryOp< internal::scalar_inverse_op< Scalar >, const Derived > InverseReturnType
 
typedef CwiseUnaryOp< internal::scalar_boolean_not_op< Scalar >, const Derived > BooleanNotReturnType
 
typedef CwiseUnaryOp< internal::scalar_exp_op< Scalar >, const Derived > ExpReturnType
 
typedef CwiseUnaryOp< internal::scalar_expm1_op< Scalar >, const Derived > Expm1ReturnType
 
typedef CwiseUnaryOp< internal::scalar_log_op< Scalar >, const Derived > LogReturnType
 
typedef CwiseUnaryOp< internal::scalar_log1p_op< Scalar >, const Derived > Log1pReturnType
 
typedef CwiseUnaryOp< internal::scalar_log10_op< Scalar >, const Derived > Log10ReturnType
 
typedef CwiseUnaryOp< internal::scalar_log2_op< Scalar >, const Derived > Log2ReturnType
 
typedef CwiseUnaryOp< internal::scalar_cos_op< Scalar >, const Derived > CosReturnType
 
typedef CwiseUnaryOp< internal::scalar_sin_op< Scalar >, const Derived > SinReturnType
 
typedef CwiseUnaryOp< internal::scalar_tan_op< Scalar >, const Derived > TanReturnType
 
typedef CwiseUnaryOp< internal::scalar_acos_op< Scalar >, const Derived > AcosReturnType
 
typedef CwiseUnaryOp< internal::scalar_asin_op< Scalar >, const Derived > AsinReturnType
 
typedef CwiseUnaryOp< internal::scalar_atan_op< Scalar >, const Derived > AtanReturnType
 
typedef CwiseUnaryOp< internal::scalar_tanh_op< Scalar >, const Derived > TanhReturnType
 
typedef CwiseUnaryOp< internal::scalar_logistic_op< Scalar >, const Derived > LogisticReturnType
 
typedef CwiseUnaryOp< internal::scalar_sinh_op< Scalar >, const Derived > SinhReturnType
 
typedef CwiseUnaryOp< internal::scalar_cosh_op< Scalar >, const Derived > CoshReturnType
 
typedef CwiseUnaryOp< internal::scalar_square_op< Scalar >, const Derived > SquareReturnType
 
typedef CwiseUnaryOp< internal::scalar_cube_op< Scalar >, const Derived > CubeReturnType
 
typedef CwiseUnaryOp< internal::scalar_round_op< Scalar >, const Derived > RoundReturnType
 
typedef CwiseUnaryOp< internal::scalar_rint_op< Scalar >, const Derived > RintReturnType
 
typedef CwiseUnaryOp< internal::scalar_floor_op< Scalar >, const Derived > FloorReturnType
 
typedef CwiseUnaryOp< internal::scalar_ceil_op< Scalar >, const Derived > CeilReturnType
 
typedef CwiseUnaryOp< internal::scalar_isnan_op< Scalar >, const Derived > IsNaNReturnType
 
typedef CwiseUnaryOp< internal::scalar_isinf_op< Scalar >, const Derived > IsInfReturnType
 
typedef CwiseUnaryOp< internal::scalar_isfinite_op< Scalar >, const Derived > IsFiniteReturnType
 
typedef CwiseUnaryOp< internal::scalar_lgamma_op< Scalar >, const Derived > LgammaReturnType
 
typedef CwiseUnaryOp< internal::scalar_digamma_op< Scalar >, const Derived > DigammaReturnType
 
typedef CwiseUnaryOp< internal::scalar_erf_op< Scalar >, const Derived > ErfReturnType
 
typedef CwiseUnaryOp< internal::scalar_erfc_op< Scalar >, const Derived > ErfcReturnType
 
typedef CwiseUnaryOp< internal::scalar_ndtri_op< Scalar >, const Derived > NdtriReturnType
 

Functions

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const AbsReturnType abs () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArgReturnType arg () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Abs2ReturnType abs2 () const
 
EIGEN_DEVICE_FUNC const ExpReturnType exp () const
 
EIGEN_DEVICE_FUNC const Expm1ReturnType expm1 () const
 
EIGEN_DEVICE_FUNC const LogReturnType log () const
 
EIGEN_DEVICE_FUNC const Log1pReturnType log1p () const
 
EIGEN_DEVICE_FUNC const Log10ReturnType log10 () const
 
EIGEN_DEVICE_FUNC const Log2ReturnType log2 () const
 
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt () const
 
EIGEN_DEVICE_FUNC const RsqrtReturnType rsqrt () const
 
EIGEN_DEVICE_FUNC const SignReturnType sign () const
 
EIGEN_DEVICE_FUNC const CosReturnType cos () const
 
EIGEN_DEVICE_FUNC const SinReturnType sin () const
 
EIGEN_DEVICE_FUNC const TanReturnType tan () const
 
EIGEN_DEVICE_FUNC const AtanReturnType atan () const
 
EIGEN_DEVICE_FUNC const AcosReturnType acos () const
 
EIGEN_DEVICE_FUNC const AsinReturnType asin () const
 
EIGEN_DEVICE_FUNC const TanhReturnType tanh () const
 
EIGEN_DEVICE_FUNC const SinhReturnType sinh () const
 
EIGEN_DEVICE_FUNC const CoshReturnType cosh () const
 
EIGEN_DEVICE_FUNC const LogisticReturnType logistic () const
 
EIGEN_DEVICE_FUNC const InverseReturnType inverse () const
 
EIGEN_DEVICE_FUNC const SquareReturnType square () const
 
EIGEN_DEVICE_FUNC const CubeReturnType cube () const
 
EIGEN_DEVICE_FUNC const RintReturnType rint () const
 
EIGEN_DEVICE_FUNC const RoundReturnType round () const
 
EIGEN_DEVICE_FUNC const FloorReturnType floor () const
 
EIGEN_DEVICE_FUNC const CeilReturnType ceil () const
 
template<int N>
EIGEN_DEVICE_FUNC ShiftRightXpr< N >::Type shiftRight () const
 
template<int N>
EIGEN_DEVICE_FUNC ShiftLeftXpr< N >::Type shiftLeft () const
 
EIGEN_DEVICE_FUNC const IsNaNReturnType isNaN () const
 
EIGEN_DEVICE_FUNC const IsInfReturnType isInf () const
 
EIGEN_DEVICE_FUNC const IsFiniteReturnType isFinite () const
 
EIGEN_DEVICE_FUNC const BooleanNotReturnType operator! () const
 
EIGEN_DEVICE_FUNC const LgammaReturnType lgamma () const
 \cpp11 More...
 
EIGEN_DEVICE_FUNC const DigammaReturnType digamma () const
 
EIGEN_DEVICE_FUNC const ErfReturnType erf () const
 \cpp11 More...
 
EIGEN_DEVICE_FUNC const ErfcReturnType erfc () const
 \cpp11 More...
 
EIGEN_DEVICE_FUNC const NdtriReturnType ndtri () const
 

Typedef Documentation

◆ Abs2ReturnType

typedef CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, const Derived> Abs2ReturnType

◆ AbsReturnType

typedef CwiseUnaryOp<internal::scalar_abs_op<Scalar>, const Derived> AbsReturnType

◆ AcosReturnType

typedef CwiseUnaryOp<internal::scalar_acos_op<Scalar>, const Derived> AcosReturnType

◆ ArgReturnType

typedef CwiseUnaryOp<internal::scalar_arg_op<Scalar>, const Derived> ArgReturnType

◆ AsinReturnType

typedef CwiseUnaryOp<internal::scalar_asin_op<Scalar>, const Derived> AsinReturnType

◆ AtanReturnType

typedef CwiseUnaryOp<internal::scalar_atan_op<Scalar>, const Derived> AtanReturnType

◆ BooleanNotReturnType

typedef CwiseUnaryOp<internal::scalar_boolean_not_op<Scalar>, const Derived> BooleanNotReturnType

◆ CeilReturnType

typedef CwiseUnaryOp<internal::scalar_ceil_op<Scalar>, const Derived> CeilReturnType

◆ CoshReturnType

typedef CwiseUnaryOp<internal::scalar_cosh_op<Scalar>, const Derived> CoshReturnType

◆ CosReturnType

typedef CwiseUnaryOp<internal::scalar_cos_op<Scalar>, const Derived> CosReturnType

◆ CubeReturnType

typedef CwiseUnaryOp<internal::scalar_cube_op<Scalar>, const Derived> CubeReturnType

◆ DigammaReturnType

typedef CwiseUnaryOp<internal::scalar_digamma_op<Scalar>, const Derived> DigammaReturnType

◆ ErfcReturnType

typedef CwiseUnaryOp<internal::scalar_erfc_op<Scalar>, const Derived> ErfcReturnType

◆ ErfReturnType

typedef CwiseUnaryOp<internal::scalar_erf_op<Scalar>, const Derived> ErfReturnType

◆ Expm1ReturnType

typedef CwiseUnaryOp<internal::scalar_expm1_op<Scalar>, const Derived> Expm1ReturnType

◆ ExpReturnType

typedef CwiseUnaryOp<internal::scalar_exp_op<Scalar>, const Derived> ExpReturnType

◆ FloorReturnType

typedef CwiseUnaryOp<internal::scalar_floor_op<Scalar>, const Derived> FloorReturnType

◆ InverseReturnType

typedef CwiseUnaryOp<internal::scalar_inverse_op<Scalar>, const Derived> InverseReturnType

◆ IsFiniteReturnType

typedef CwiseUnaryOp<internal::scalar_isfinite_op<Scalar>, const Derived> IsFiniteReturnType

◆ IsInfReturnType

typedef CwiseUnaryOp<internal::scalar_isinf_op<Scalar>, const Derived> IsInfReturnType

◆ IsNaNReturnType

typedef CwiseUnaryOp<internal::scalar_isnan_op<Scalar>, const Derived> IsNaNReturnType

◆ LgammaReturnType

typedef CwiseUnaryOp<internal::scalar_lgamma_op<Scalar>, const Derived> LgammaReturnType

◆ Log10ReturnType

typedef CwiseUnaryOp<internal::scalar_log10_op<Scalar>, const Derived> Log10ReturnType

◆ Log1pReturnType

typedef CwiseUnaryOp<internal::scalar_log1p_op<Scalar>, const Derived> Log1pReturnType

◆ Log2ReturnType

typedef CwiseUnaryOp<internal::scalar_log2_op<Scalar>, const Derived> Log2ReturnType

◆ LogisticReturnType

typedef CwiseUnaryOp<internal::scalar_logistic_op<Scalar>, const Derived> LogisticReturnType

◆ LogReturnType

typedef CwiseUnaryOp<internal::scalar_log_op<Scalar>, const Derived> LogReturnType

◆ NdtriReturnType

typedef CwiseUnaryOp<internal::scalar_ndtri_op<Scalar>, const Derived> NdtriReturnType

◆ RintReturnType

typedef CwiseUnaryOp<internal::scalar_rint_op<Scalar>, const Derived> RintReturnType

◆ RoundReturnType

typedef CwiseUnaryOp<internal::scalar_round_op<Scalar>, const Derived> RoundReturnType

◆ RsqrtReturnType

typedef CwiseUnaryOp<internal::scalar_rsqrt_op<Scalar>, const Derived> RsqrtReturnType

◆ SignReturnType

typedef CwiseUnaryOp<internal::scalar_sign_op<Scalar>, const Derived> SignReturnType

◆ SinhReturnType

typedef CwiseUnaryOp<internal::scalar_sinh_op<Scalar>, const Derived> SinhReturnType

◆ SinReturnType

typedef CwiseUnaryOp<internal::scalar_sin_op<Scalar>, const Derived> SinReturnType

◆ SqrtReturnType

typedef CwiseUnaryOp<internal::scalar_sqrt_op<Scalar>, const Derived> SqrtReturnType

◆ SquareReturnType

typedef CwiseUnaryOp<internal::scalar_square_op<Scalar>, const Derived> SquareReturnType

◆ TanhReturnType

typedef CwiseUnaryOp<internal::scalar_tanh_op<Scalar>, const Derived> TanhReturnType

◆ TanReturnType

typedef CwiseUnaryOp<internal::scalar_tan_op<Scalar>, const Derived> TanReturnType

Function Documentation

◆ abs()

Returns
an expression of the coefficient-wise absolute value of *this

Example:

Output:

See also
Math functions, abs2()

◆ abs2()

Returns
an expression of the coefficient-wise squared absolute value of *this

Example:

Output:

See also
Math functions, abs(), square()

◆ acos()

EIGEN_DEVICE_FUNC const AcosReturnType acos ( ) const
inline
Returns
an expression of the coefficient-wise arc cosine of *this.

Example:

Output:

See also
Math functions, cos(), asin()

◆ arg()

Returns
an expression of the coefficient-wise phase angle of *this

Example:

Output:

See also
abs()

◆ asin()

EIGEN_DEVICE_FUNC const AsinReturnType asin ( ) const
inline
Returns
an expression of the coefficient-wise arc sine of *this.

Example:

Output:

See also
Math functions, sin(), acos()

◆ atan()

EIGEN_DEVICE_FUNC const AtanReturnType atan ( ) const
inline
Returns
an expression of the coefficient-wise arc tan of *this.

Example:

Output:

See also
Math functions, tan(), asin(), acos()

◆ ceil()

EIGEN_DEVICE_FUNC const CeilReturnType ceil ( ) const
inline
Returns
an expression of the coefficient-wise ceil of *this.

Example:

Output:

See also
Math functions, floor(), round()

◆ cos()

EIGEN_DEVICE_FUNC const CosReturnType cos ( ) const
inline
Returns
an expression of the coefficient-wise cosine of *this.

This function computes the coefficient-wise cosine. The function MatrixBase::cos() in the unsupported module MatrixFunctions computes the matrix cosine.

Example:

Output:

See also
Math functions, sin(), acos()

◆ cosh()

EIGEN_DEVICE_FUNC const CoshReturnType cosh ( ) const
inline
Returns
an expression of the coefficient-wise hyperbolic cos of *this.

Example:

Output:

See also
Math functions, tanh(), sinh(), cosh()

◆ cube()

EIGEN_DEVICE_FUNC const CubeReturnType cube ( ) const
inline
Returns
an expression of the coefficient-wise cube of *this.

Example:

Output:

See also
Math functions, square(), pow()

◆ digamma()

EIGEN_DEVICE_FUNC const DigammaReturnType digamma ( ) const
inline
Returns
an expression of the coefficient-wise digamma (psi, derivative of lgamma).

\specialfunctions_module

Note
This function supports only float and double scalar types. To support other scalar types, the user has to provide implementations of digamma(T) for any scalar type T to be supported.
See also
Math functions, Eigen::digamma(), Eigen::polygamma(), lgamma()

◆ erf()

EIGEN_DEVICE_FUNC const ErfReturnType erf ( ) const
inline

\cpp11

Returns
an expression of the coefficient-wise Gauss error function of *this.

\specialfunctions_module

Note
This function supports only float and double scalar types in c++11 mode. To support other scalar types, or float/double in non c++11 mode, the user has to provide implementations of erf(T) for any scalar type T to be supported.
See also
Math functions, erfc()

◆ erfc()

EIGEN_DEVICE_FUNC const ErfcReturnType erfc ( ) const
inline

\cpp11

Returns
an expression of the coefficient-wise Complementary error function of *this.

\specialfunctions_module

Note
This function supports only float and double scalar types in c++11 mode. To support other scalar types, or float/double in non c++11 mode, the user has to provide implementations of erfc(T) for any scalar type T to be supported.
See also
Math functions, erf()

◆ exp()

EIGEN_DEVICE_FUNC const ExpReturnType exp ( ) const
inline
Returns
an expression of the coefficient-wise exponential of *this.

This function computes the coefficient-wise exponential. The function MatrixBase::exp() in the unsupported module MatrixFunctions computes the matrix exponential.

Example:

Output:

See also
Math functions, pow(), log(), sin(), cos()

◆ expm1()

EIGEN_DEVICE_FUNC const Expm1ReturnType expm1 ( ) const
inline
Returns
an expression of the coefficient-wise exponential of *this minus 1.

In exact arithmetic, x.expm1() is equivalent to x.exp() - 1, however, with finite precision, this function is much more accurate when x is close to zero.

See also
Math functions, exp()

◆ floor()

EIGEN_DEVICE_FUNC const FloorReturnType floor ( ) const
inline
Returns
an expression of the coefficient-wise floor of *this.

Example:

Output:

See also
Math functions, ceil(), round()

◆ inverse()

EIGEN_DEVICE_FUNC const InverseReturnType inverse ( ) const
inline
Returns
an expression of the coefficient-wise inverse of *this.

Example:

Output:

See also
operator/(), operator*()

◆ isFinite()

EIGEN_DEVICE_FUNC const IsFiniteReturnType isFinite ( ) const
inline
Returns
an expression of the coefficient-wise isfinite of *this.

Example:

Output:

See also
isnan(), isinf()

◆ isInf()

EIGEN_DEVICE_FUNC const IsInfReturnType isInf ( ) const
inline
Returns
an expression of the coefficient-wise isinf of *this.

Example:

Output:

See also
isnan(), isfinite()

◆ isNaN()

EIGEN_DEVICE_FUNC const IsNaNReturnType isNaN ( ) const
inline
Returns
an expression of the coefficient-wise isnan of *this.

Example:

Output:

See also
isfinite(), isinf()

◆ lgamma()

EIGEN_DEVICE_FUNC const LgammaReturnType lgamma ( ) const
inline

\cpp11

Returns
an expression of the coefficient-wise ln(|gamma(*this)|).

\specialfunctions_module

Note
This function supports only float and double scalar types in c++11 mode. To support other scalar types, or float/double in non c++11 mode, the user has to provide implementations of lgamma(T) for any scalar type T to be supported.
See also
Math functions, digamma()

◆ log()

EIGEN_DEVICE_FUNC const LogReturnType log ( ) const
inline
Returns
an expression of the coefficient-wise logarithm of *this.

This function computes the coefficient-wise logarithm. The function MatrixBase::log() in the unsupported module MatrixFunctions computes the matrix logarithm.

Example:

Output:

See also
Math functions, log()

◆ log10()

EIGEN_DEVICE_FUNC const Log10ReturnType log10 ( ) const
inline
Returns
an expression of the coefficient-wise base-10 logarithm of *this.

This function computes the coefficient-wise base-10 logarithm.

Example:

Output:

See also
Math functions, log()

◆ log1p()

EIGEN_DEVICE_FUNC const Log1pReturnType log1p ( ) const
inline
Returns
an expression of the coefficient-wise logarithm of 1 plus *this.

In exact arithmetic, x.log() is equivalent to (x+1).log(), however, with finite precision, this function is much more accurate when x is close to zero.

See also
Math functions, log()

◆ log2()

EIGEN_DEVICE_FUNC const Log2ReturnType log2 ( ) const
inline
Returns
an expression of the coefficient-wise base-2 logarithm of *this.

This function computes the coefficient-wise base-2 logarithm.

◆ logistic()

EIGEN_DEVICE_FUNC const LogisticReturnType logistic ( ) const
inline
Returns
an expression of the coefficient-wise logistic of *this.

◆ ndtri()

EIGEN_DEVICE_FUNC const NdtriReturnType ndtri ( ) const
inline
Returns
an expression of the coefficient-wise inverse of the CDF of the Normal distribution function function of *this.

\specialfunctions_module

In other words, considering x = ndtri(y), it returns the argument, x, for which the area under the Gaussian probability density function (integrated from minus infinity to x) is equal to y.

Note
This function supports only float and double scalar types. To support other scalar types, the user has to provide implementations of ndtri(T) for any scalar type T to be supported.
See also
Math functions

◆ operator!()

EIGEN_DEVICE_FUNC const BooleanNotReturnType operator! ( ) const
inline
Returns
an expression of the coefficient-wise ! operator of *this
Warning
this operator is for expression of bool only.

Example:

Output:

See also
operator!=()

◆ rint()

EIGEN_DEVICE_FUNC const RintReturnType rint ( ) const
inline
Returns
an expression of the coefficient-wise rint of *this.

Example:

Output:

See also
Math functions, ceil(), floor()

◆ round()

EIGEN_DEVICE_FUNC const RoundReturnType round ( ) const
inline
Returns
an expression of the coefficient-wise round of *this.

Example:

Output:

See also
Math functions, ceil(), floor()

◆ rsqrt()

EIGEN_DEVICE_FUNC const RsqrtReturnType rsqrt ( ) const
inline
Returns
an expression of the coefficient-wise inverse square root of *this.

This function computes the coefficient-wise inverse square root.

Example:

Output:

See also
pow(), square()

◆ shiftLeft()

template<int N>
EIGEN_DEVICE_FUNC ShiftLeftXpr< N >::Type shiftLeft ( ) const
Returns
an expression of *this with the Scalar type logically shifted left by N bit positions.

The template parameter N specifies the number of bit positions to shift.

See also
shiftRight()

◆ shiftRight()

template<int N>
EIGEN_DEVICE_FUNC ShiftRightXpr< N >::Type shiftRight ( ) const
Returns
an expression of *this with the Scalar type arithmetically shifted right by N bit positions.

The template parameter N specifies the number of bit positions to shift.

See also
shiftLeft()

◆ sign()

EIGEN_DEVICE_FUNC const SignReturnType sign ( ) const
inline
Returns
an expression of the coefficient-wise signum of *this.

This function computes the coefficient-wise signum.

Example:

Output:

See also
pow(), square()

◆ sin()

EIGEN_DEVICE_FUNC const SinReturnType sin ( ) const
inline
Returns
an expression of the coefficient-wise sine of *this.

This function computes the coefficient-wise sine. The function MatrixBase::sin() in the unsupported module MatrixFunctions computes the matrix sine.

Example:

Output:

See also
Math functions, cos(), asin()

◆ sinh()

EIGEN_DEVICE_FUNC const SinhReturnType sinh ( ) const
inline
Returns
an expression of the coefficient-wise hyperbolic sin of *this.

Example:

Output:

See also
Math functions, sin(), tanh(), cosh()

◆ sqrt()

EIGEN_DEVICE_FUNC const SqrtReturnType sqrt ( ) const
inline
Returns
an expression of the coefficient-wise square root of *this.

This function computes the coefficient-wise square root. The function MatrixBase::sqrt() in the unsupported module MatrixFunctions computes the matrix square root.

Example:

Output:

See also
Math functions, pow(), square()

◆ square()

EIGEN_DEVICE_FUNC const SquareReturnType square ( ) const
inline
Returns
an expression of the coefficient-wise square of *this.

Example:

Output:

See also
Math functions, abs2(), cube(), pow()

◆ tan()

EIGEN_DEVICE_FUNC const TanReturnType tan ( ) const
inline
Returns
an expression of the coefficient-wise tan of *this.

Example:

Output:

See also
Math functions, cos(), sin()

◆ tanh()

EIGEN_DEVICE_FUNC const TanhReturnType tanh ( ) const
inline
Returns
an expression of the coefficient-wise hyperbolic tan of *this.

Example:

Output:

See also
Math functions, tan(), sinh(), cosh()