ArrayCwiseUnaryOps.h File Reference

Go to the source code of this file.

Classes

struct  ShiftLeftXpr< N >
 
struct  ShiftRightXpr< N >
 

Typedefs

typedef CwiseUnaryOp< internal::scalar_abs2_op< Scalar >, const Derived > Abs2ReturnType
 
typedef CwiseUnaryOp< internal::scalar_abs_op< Scalar >, const Derived > AbsReturnType
 
typedef CwiseUnaryOp< internal::scalar_acosh_op< Scalar >, const Derived > AcoshReturnType
 
typedef CwiseUnaryOp< internal::scalar_acos_op< Scalar >, const Derived > AcosReturnType
 
typedef CwiseUnaryOp< internal::scalar_arg_op< Scalar >, const Derived > ArgReturnType
 
typedef CwiseUnaryOp< internal::scalar_asinh_op< Scalar >, const Derived > AsinhReturnType
 
typedef CwiseUnaryOp< internal::scalar_asin_op< Scalar >, const Derived > AsinReturnType
 
typedef CwiseUnaryOp< internal::scalar_atanh_op< Scalar >, const Derived > AtanhReturnType
 
typedef CwiseUnaryOp< internal::scalar_atan_op< Scalar >, const Derived > AtanReturnType
 
typedef CwiseUnaryOp< internal::scalar_bitwise_not_op< Scalar >, const Derived > BitwiseNotReturnType
 
typedef CwiseUnaryOp< internal::scalar_boolean_not_op< Scalar >, const Derived > BooleanNotReturnType
 
typedef CwiseUnaryOp< internal::scalar_carg_op< Scalar >, const Derived > CArgReturnType
 
typedef CwiseUnaryOp< internal::scalar_ceil_op< Scalar >, const Derived > CeilReturnType
 
typedef CwiseUnaryOp< internal::scalar_cosh_op< Scalar >, const Derived > CoshReturnType
 
typedef CwiseUnaryOp< internal::scalar_cos_op< Scalar >, const Derived > CosReturnType
 
typedef CwiseUnaryOp< internal::scalar_cube_op< Scalar >, const Derived > CubeReturnType
 
typedef CwiseUnaryOp< internal::scalar_digamma_op< Scalar >, const Derived > DigammaReturnType
 
typedef CwiseUnaryOp< internal::scalar_erfc_op< Scalar >, const Derived > ErfcReturnType
 
typedef CwiseUnaryOp< internal::scalar_erf_op< Scalar >, const Derived > ErfReturnType
 
typedef CwiseUnaryOp< internal::scalar_expm1_op< Scalar >, const Derived > Expm1ReturnType
 
typedef CwiseUnaryOp< internal::scalar_exp_op< Scalar >, const Derived > ExpReturnType
 
typedef CwiseUnaryOp< internal::scalar_floor_op< Scalar >, const Derived > FloorReturnType
 
typedef CwiseUnaryOp< internal::scalar_inverse_op< Scalar >, const Derived > InverseReturnType
 
typedef CwiseUnaryOp< internal::scalar_isfinite_op< Scalar >, const Derived > IsFiniteReturnType
 
typedef CwiseUnaryOp< internal::scalar_isinf_op< Scalar >, const Derived > IsInfReturnType
 
typedef CwiseUnaryOp< internal::scalar_isnan_op< Scalar >, const Derived > IsNaNReturnType
 
typedef CwiseUnaryOp< internal::scalar_lgamma_op< Scalar >, const Derived > LgammaReturnType
 
typedef CwiseUnaryOp< internal::scalar_log10_op< Scalar >, const Derived > Log10ReturnType
 
typedef CwiseUnaryOp< internal::scalar_log1p_op< Scalar >, const Derived > Log1pReturnType
 
typedef CwiseUnaryOp< internal::scalar_log2_op< Scalar >, const Derived > Log2ReturnType
 
typedef CwiseUnaryOp< internal::scalar_logistic_op< Scalar >, const Derived > LogisticReturnType
 
typedef CwiseUnaryOp< internal::scalar_log_op< Scalar >, const Derived > LogReturnType
 
typedef CwiseUnaryOp< internal::scalar_ndtri_op< Scalar >, const Derived > NdtriReturnType
 
typedef CwiseUnaryOp< internal::scalar_rint_op< Scalar >, const Derived > RintReturnType
 
typedef CwiseUnaryOp< internal::scalar_round_op< Scalar >, const Derived > RoundReturnType
 
typedef CwiseUnaryOp< internal::scalar_rsqrt_op< Scalar >, const Derived > RsqrtReturnType
 
typedef CwiseUnaryOp< internal::scalar_sign_op< Scalar >, const Derived > SignReturnType
 
typedef CwiseUnaryOp< internal::scalar_sinh_op< Scalar >, const Derived > SinhReturnType
 
typedef CwiseUnaryOp< internal::scalar_sin_op< Scalar >, const Derived > SinReturnType
 
typedef CwiseUnaryOp< internal::scalar_sqrt_op< Scalar >, const Derived > SqrtReturnType
 
typedef CwiseUnaryOp< internal::scalar_square_op< Scalar >, const Derived > SquareReturnType
 
typedef CwiseUnaryOp< internal::scalar_tanh_op< Scalar >, const Derived > TanhReturnType
 
typedef CwiseUnaryOp< internal::scalar_tan_op< Scalar >, const Derived > TanReturnType
 
template<typename ScalarExponent >
using UnaryPowReturnType = std::enable_if_t< internal::is_arithmetic< typename NumTraits< ScalarExponent >::Real >::value, CwiseUnaryOp< internal::scalar_unary_pow_op< Scalar, ScalarExponent >, const Derived > >
 

Functions

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

Typedef Documentation

◆ Abs2ReturnType

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

Definition at line 6 of file ArrayCwiseUnaryOps.h.

◆ AbsReturnType

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

Definition at line 3 of file ArrayCwiseUnaryOps.h.

◆ AcoshReturnType

typedef CwiseUnaryOp<internal::scalar_acosh_op<Scalar>, const Derived> AcoshReturnType

Definition at line 31 of file ArrayCwiseUnaryOps.h.

◆ AcosReturnType

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

Definition at line 23 of file ArrayCwiseUnaryOps.h.

◆ ArgReturnType

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

Definition at line 4 of file ArrayCwiseUnaryOps.h.

◆ AsinhReturnType

typedef CwiseUnaryOp<internal::scalar_asinh_op<Scalar>, const Derived> AsinhReturnType

Definition at line 30 of file ArrayCwiseUnaryOps.h.

◆ AsinReturnType

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

Definition at line 24 of file ArrayCwiseUnaryOps.h.

◆ AtanhReturnType

typedef CwiseUnaryOp<internal::scalar_atanh_op<Scalar>, const Derived> AtanhReturnType

Definition at line 29 of file ArrayCwiseUnaryOps.h.

◆ AtanReturnType

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

Definition at line 25 of file ArrayCwiseUnaryOps.h.

◆ BitwiseNotReturnType

typedef CwiseUnaryOp<internal::scalar_bitwise_not_op<Scalar>, const Derived> BitwiseNotReturnType

Definition at line 12 of file ArrayCwiseUnaryOps.h.

◆ BooleanNotReturnType

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

Definition at line 11 of file ArrayCwiseUnaryOps.h.

◆ CArgReturnType

typedef CwiseUnaryOp<internal::scalar_carg_op<Scalar>, const Derived> CArgReturnType

Definition at line 5 of file ArrayCwiseUnaryOps.h.

◆ CeilReturnType

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

Definition at line 38 of file ArrayCwiseUnaryOps.h.

◆ CoshReturnType

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

Definition at line 32 of file ArrayCwiseUnaryOps.h.

◆ CosReturnType

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

Definition at line 20 of file ArrayCwiseUnaryOps.h.

◆ CubeReturnType

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

Definition at line 34 of file ArrayCwiseUnaryOps.h.

◆ DigammaReturnType

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

Definition at line 610 of file ArrayCwiseUnaryOps.h.

◆ ErfcReturnType

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

Definition at line 612 of file ArrayCwiseUnaryOps.h.

◆ ErfReturnType

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

Definition at line 611 of file ArrayCwiseUnaryOps.h.

◆ Expm1ReturnType

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

Definition at line 15 of file ArrayCwiseUnaryOps.h.

◆ ExpReturnType

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

Definition at line 14 of file ArrayCwiseUnaryOps.h.

◆ FloorReturnType

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

Definition at line 37 of file ArrayCwiseUnaryOps.h.

◆ InverseReturnType

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

Definition at line 10 of file ArrayCwiseUnaryOps.h.

◆ IsFiniteReturnType

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

Definition at line 41 of file ArrayCwiseUnaryOps.h.

◆ IsInfReturnType

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

Definition at line 40 of file ArrayCwiseUnaryOps.h.

◆ IsNaNReturnType

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

Definition at line 39 of file ArrayCwiseUnaryOps.h.

◆ LgammaReturnType

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

Definition at line 609 of file ArrayCwiseUnaryOps.h.

◆ Log10ReturnType

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

Definition at line 18 of file ArrayCwiseUnaryOps.h.

◆ Log1pReturnType

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

Definition at line 17 of file ArrayCwiseUnaryOps.h.

◆ Log2ReturnType

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

Definition at line 19 of file ArrayCwiseUnaryOps.h.

◆ LogisticReturnType

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

Definition at line 27 of file ArrayCwiseUnaryOps.h.

◆ LogReturnType

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

Definition at line 16 of file ArrayCwiseUnaryOps.h.

◆ NdtriReturnType

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

Definition at line 613 of file ArrayCwiseUnaryOps.h.

◆ RintReturnType

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

Definition at line 36 of file ArrayCwiseUnaryOps.h.

◆ RoundReturnType

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

Definition at line 35 of file ArrayCwiseUnaryOps.h.

◆ RsqrtReturnType

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

Definition at line 8 of file ArrayCwiseUnaryOps.h.

◆ SignReturnType

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

Definition at line 9 of file ArrayCwiseUnaryOps.h.

◆ SinhReturnType

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

Definition at line 28 of file ArrayCwiseUnaryOps.h.

◆ SinReturnType

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

Definition at line 21 of file ArrayCwiseUnaryOps.h.

◆ SqrtReturnType

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

Definition at line 7 of file ArrayCwiseUnaryOps.h.

◆ SquareReturnType

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

Definition at line 33 of file ArrayCwiseUnaryOps.h.

◆ TanhReturnType

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

Definition at line 26 of file ArrayCwiseUnaryOps.h.

◆ TanReturnType

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

Definition at line 22 of file ArrayCwiseUnaryOps.h.

◆ UnaryPowReturnType

template<typename ScalarExponent >
using UnaryPowReturnType = std::enable_if_t<internal::is_arithmetic<typename NumTraits<ScalarExponent>::Real>::value, CwiseUnaryOp<internal::scalar_unary_pow_op<Scalar, ScalarExponent>, const Derived> >

Definition at line 706 of file ArrayCwiseUnaryOps.h.

Function Documentation

◆ abs()

const AbsReturnType abs ( ) const
inline
Returns
an expression of the coefficient-wise absolute value of *this

Example:

Array3d v(1,-2,-3);
cout << v.abs() << endl;
Array< int, Dynamic, 1 > v
Array< double, 3, 1 > Array3d
Definition: Array.h:346

Output:

1
2
3
See also
Math functions, abs2()

Definition at line 52 of file ArrayCwiseUnaryOps.h.

53 {
54  return AbsReturnType(derived());
55 }
CwiseUnaryOp< internal::scalar_abs_op< Scalar >, const Derived > AbsReturnType

◆ abs2()

const Abs2ReturnType 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
Math functions, abs(), square()

Definition at line 84 of file ArrayCwiseUnaryOps.h.

85 {
86  return Abs2ReturnType(derived());
87 }
CwiseUnaryOp< internal::scalar_abs2_op< Scalar >, const Derived > Abs2ReturnType

◆ acos()

const AcosReturnType 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;
const SqrtReturnType sqrt() const

Output:

 1.57
0.785
    0
See also
Math functions, cos(), asin()

Definition at line 301 of file ArrayCwiseUnaryOps.h.

302 {
303  return AcosReturnType(derived());
304 }
CwiseUnaryOp< internal::scalar_acos_op< Scalar >, const Derived > AcosReturnType

◆ acosh()

const AcoshReturnType acosh ( ) const
inline
Returns
an expression of the coefficient-wise inverse hyperbolic cos of *this.
See also
Math functions, atanh(), asinh(), acosh()

Definition at line 390 of file ArrayCwiseUnaryOps.h.

391 {
392  return AcoshReturnType(derived());
393 }
CwiseUnaryOp< internal::scalar_acosh_op< Scalar >, const Derived > AcoshReturnType

◆ arg()

const ArgReturnType arg ( ) const
inline
Returns
an expression of the coefficient-wise phase angle of *this

Example:

ArrayXcf v = ArrayXcf::Random(3);
cout << v << endl << endl;
cout << arg(v) << endl;
const ArgReturnType arg() const
Array< std::complex< float >, Dynamic, 1 > ArrayXcf
Definition: Array.h:347

Output:

 (-0.211,0.68)
 (0.597,0.566)
(-0.605,0.823)

 1.87
0.759
  2.2
See also
abs()

Definition at line 66 of file ArrayCwiseUnaryOps.h.

67 {
68  return ArgReturnType(derived());
69 }
CwiseUnaryOp< internal::scalar_arg_op< Scalar >, const Derived > ArgReturnType

◆ asin()

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

Example:

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

Output:

    0
0.785
 1.57
See also
Math functions, sin(), acos()

Definition at line 315 of file ArrayCwiseUnaryOps.h.

316 {
317  return AsinReturnType(derived());
318 }
CwiseUnaryOp< internal::scalar_asin_op< Scalar >, const Derived > AsinReturnType

◆ asinh()

const AsinhReturnType asinh ( ) const
inline
Returns
an expression of the coefficient-wise inverse hyperbolic sin of *this.
See also
Math functions, atanh(), asinh(), acosh()

Definition at line 379 of file ArrayCwiseUnaryOps.h.

380 {
381  return AsinhReturnType(derived());
382 }
CwiseUnaryOp< internal::scalar_asinh_op< Scalar >, const Derived > AsinhReturnType

◆ atan()

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

Example:

ArrayXd v = ArrayXd::LinSpaced(5,0,1);
cout << v.atan() << endl;
Array< double, Dynamic, 1 > ArrayXd
Definition: Array.h:346

Output:

    0
0.245
0.464
0.644
0.785
See also
Math functions, tan(), asin(), acos()

Definition at line 287 of file ArrayCwiseUnaryOps.h.

288 {
289  return AtanReturnType(derived());
290 }
CwiseUnaryOp< internal::scalar_atan_op< Scalar >, const Derived > AtanReturnType

◆ atanh()

const AtanhReturnType atanh ( ) const
inline
Returns
an expression of the coefficient-wise inverse hyperbolic tan of *this.
See also
Math functions, atanh(), asinh(), acosh()

Definition at line 368 of file ArrayCwiseUnaryOps.h.

369 {
370  return AtanhReturnType(derived());
371 }
CwiseUnaryOp< internal::scalar_atanh_op< Scalar >, const Derived > AtanhReturnType

◆ carg()

const CArgReturnType carg ( ) const
inline

Definition at line 73 of file ArrayCwiseUnaryOps.h.

73 { return CArgReturnType(derived()); }
CwiseUnaryOp< internal::scalar_carg_op< Scalar >, const Derived > CArgReturnType

◆ ceil()

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

Example:

ArrayXd v = ArrayXd::LinSpaced(7,-2,2);
cout << v << endl << endl;
cout << ceil(v) << endl;
const CeilReturnType ceil() const

Output:

    -2
 -1.33
-0.667
     0
 0.667
  1.33
     2

-2
-1
 0
 0
 1
 2
 2
See also
Math functions, floor(), round()

Definition at line 497 of file ArrayCwiseUnaryOps.h.

498 {
499  return CeilReturnType(derived());
500 }
CwiseUnaryOp< internal::scalar_ceil_op< Scalar >, const Derived > CeilReturnType

◆ cos()

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:

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

Output:

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

Definition at line 241 of file ArrayCwiseUnaryOps.h.

242 {
243  return CosReturnType(derived());
244 }
CwiseUnaryOp< internal::scalar_cos_op< Scalar >, const Derived > CosReturnType

◆ cosh()

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

Example:

ArrayXd v = ArrayXd::LinSpaced(5,0,1);
cout << cosh(v) << endl;
const CoshReturnType cosh() const

Output:

   1
1.03
1.13
1.29
1.54
See also
Math functions, tanh(), sinh(), cosh()

Definition at line 357 of file ArrayCwiseUnaryOps.h.

358 {
359  return CoshReturnType(derived());
360 }
CwiseUnaryOp< internal::scalar_cosh_op< Scalar >, const Derived > CoshReturnType

◆ cube()

const CubeReturnType 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
Math functions, square(), pow()

Definition at line 441 of file ArrayCwiseUnaryOps.h.

442 {
443  return CubeReturnType(derived());
444 }
CwiseUnaryOp< internal::scalar_cube_op< Scalar >, const Derived > CubeReturnType

◆ digamma()

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

This is defined in the unsupported SpecialFunctions module.

#include <Eigen/SpecialFunctions>
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()

Definition at line 644 of file ArrayCwiseUnaryOps.h.

645 {
646  return DigammaReturnType(derived());
647 }
CwiseUnaryOp< internal::scalar_digamma_op< Scalar >, const Derived > DigammaReturnType

◆ erf()

const ErfReturnType erf ( ) const
inline

[c++11]

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

This is defined in the unsupported SpecialFunctions module.

#include <Eigen/SpecialFunctions>
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()

Definition at line 662 of file ArrayCwiseUnaryOps.h.

663 {
664  return ErfReturnType(derived());
665 }
CwiseUnaryOp< internal::scalar_erf_op< Scalar >, const Derived > ErfReturnType

◆ erfc()

const ErfcReturnType erfc ( ) const
inline

[c++11]

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

This is defined in the unsupported SpecialFunctions module.

#include <Eigen/SpecialFunctions>
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()

Definition at line 680 of file ArrayCwiseUnaryOps.h.

681 {
682  return ErfcReturnType(derived());
683 }
CwiseUnaryOp< internal::scalar_erfc_op< Scalar >, const Derived > ErfcReturnType

◆ exp()

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:

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

Output:

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

Definition at line 101 of file ArrayCwiseUnaryOps.h.

102 {
103  return ExpReturnType(derived());
104 }
CwiseUnaryOp< internal::scalar_exp_op< Scalar >, const Derived > ExpReturnType

◆ expm1()

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()

Definition at line 115 of file ArrayCwiseUnaryOps.h.

116 {
117  return Expm1ReturnType(derived());
118 }
CwiseUnaryOp< internal::scalar_expm1_op< Scalar >, const Derived > Expm1ReturnType

◆ floor()

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

Example:

ArrayXd v = ArrayXd::LinSpaced(7,-2,2);
cout << v << endl << endl;
cout << floor(v) << endl;
const FloorReturnType floor() const

Output:

    -2
 -1.33
-0.667
     0
 0.667
  1.33
     2

-2
-2
-1
 0
 0
 1
 2
See also
Math functions, ceil(), round()

Definition at line 483 of file ArrayCwiseUnaryOps.h.

484 {
485  return FloorReturnType(derived());
486 }
CwiseUnaryOp< internal::scalar_floor_op< Scalar >, const Derived > FloorReturnType

◆ inverse()

const InverseReturnType 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*()

Definition at line 413 of file ArrayCwiseUnaryOps.h.

414 {
415  return InverseReturnType(derived());
416 }
CwiseUnaryOp< internal::scalar_inverse_op< Scalar >, const Derived > InverseReturnType

◆ isFinite()

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

Example:

Array3d v(1,2,3);
v(1) *= 0.0/0.0;
v(2) /= 0.0;
cout << v << endl << endl;
cout << isfinite(v) << endl;
bool() isfinite(const bfloat16 &a)
Definition: BFloat16.h:597

Output:

   1
-nan
 inf

1
0
0
See also
isnan(), isinf()

Definition at line 578 of file ArrayCwiseUnaryOps.h.

579 {
580  return IsFiniteReturnType(derived());
581 }
CwiseUnaryOp< internal::scalar_isfinite_op< Scalar >, const Derived > IsFiniteReturnType

◆ isInf()

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

Example:

Array3d v(1,2,3);
v(1) *= 0.0/0.0;
v(2) /= 0.0;
cout << v << endl << endl;
cout << isinf(v) << endl;
bool() isinf(const bfloat16 &a)
Definition: BFloat16.h:581

Output:

   1
-nan
 inf

0
0
1
See also
isnan(), isfinite()

Definition at line 564 of file ArrayCwiseUnaryOps.h.

565 {
566  return IsInfReturnType(derived());
567 }
CwiseUnaryOp< internal::scalar_isinf_op< Scalar >, const Derived > IsInfReturnType

◆ isNaN()

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

Example:

Array3d v(1,2,3);
v(1) *= 0.0/0.0;
v(2) /= 0.0;
cout << v << endl << endl;
cout << isnan(v) << endl;
bool() isnan(const bfloat16 &a)
Definition: BFloat16.h:589

Output:

   1
-nan
 inf

0
1
0
See also
isfinite(), isinf()

Definition at line 550 of file ArrayCwiseUnaryOps.h.

551 {
552  return IsNaNReturnType(derived());
553 }
CwiseUnaryOp< internal::scalar_isnan_op< Scalar >, const Derived > IsNaNReturnType

◆ lgamma()

const LgammaReturnType lgamma ( ) const
inline

[c++11]

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

This is defined in the unsupported SpecialFunctions module.

#include <Eigen/SpecialFunctions>
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()

Definition at line 627 of file ArrayCwiseUnaryOps.h.

628 {
629  return LgammaReturnType(derived());
630 }
CwiseUnaryOp< internal::scalar_lgamma_op< Scalar >, const Derived > LgammaReturnType

◆ log()

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:

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

Output:

    0
0.693
  1.1
See also
Math functions, log()

Definition at line 132 of file ArrayCwiseUnaryOps.h.

133 {
134  return LogReturnType(derived());
135 }
CwiseUnaryOp< internal::scalar_log_op< Scalar >, const Derived > LogReturnType

◆ log10()

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:

Array4d v(-1,0,1,2);
cout << log10(v) << endl;
const Log10ReturnType log10() const
Array< double, 4, 1 > Array4d
Definition: Array.h:346

Output:

  nan
 -inf
    0
0.301
See also
Math functions, log()

Definition at line 162 of file ArrayCwiseUnaryOps.h.

163 {
164  return Log10ReturnType(derived());
165 }
CwiseUnaryOp< internal::scalar_log10_op< Scalar >, const Derived > Log10ReturnType

◆ log1p()

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()

Definition at line 146 of file ArrayCwiseUnaryOps.h.

147 {
148  return Log1pReturnType(derived());
149 }
CwiseUnaryOp< internal::scalar_log1p_op< Scalar >, const Derived > Log1pReturnType

◆ log2()

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.

Definition at line 174 of file ArrayCwiseUnaryOps.h.

175 {
176  return Log2ReturnType(derived());
177 }
CwiseUnaryOp< internal::scalar_log2_op< Scalar >, const Derived > Log2ReturnType

◆ logistic()

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

Definition at line 399 of file ArrayCwiseUnaryOps.h.

400 {
401  return LogisticReturnType(derived());
402 }
CwiseUnaryOp< internal::scalar_logistic_op< Scalar >, const Derived > LogisticReturnType

◆ ndtri()

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

This is defined in the unsupported SpecialFunctions module.

#include <Eigen/SpecialFunctions>

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

Definition at line 700 of file ArrayCwiseUnaryOps.h.

701 {
702  return NdtriReturnType(derived());
703 }
CwiseUnaryOp< internal::scalar_ndtri_op< Scalar >, const Derived > NdtriReturnType

◆ operator!()

const BooleanNotReturnType operator! ( ) const
inline
Returns
an expression of the coefficient-wise ! operator of *this

Example:

Array3d v(1,2,3);
v(1) *= 0.0/0.0;
v(2) /= 0.0;
cout << v << endl << endl;
cout << !isfinite(v) << endl;

Output:

   1
-nan
 inf

0
1
1
See also
operator!=()

Definition at line 592 of file ArrayCwiseUnaryOps.h.

593 {
594  return BooleanNotReturnType(derived());
595 }
CwiseUnaryOp< internal::scalar_boolean_not_op< Scalar >, const Derived > BooleanNotReturnType

◆ operator~()

const BitwiseNotReturnType operator~ ( ) const
inline
Returns
an expression of the bitwise ~ operator of *this

Definition at line 601 of file ArrayCwiseUnaryOps.h.

602 {
603  return BitwiseNotReturnType(derived());
604 }
CwiseUnaryOp< internal::scalar_bitwise_not_op< Scalar >, const Derived > BitwiseNotReturnType

◆ pow()

template<typename ScalarExponent >
const UnaryPowReturnType<ScalarExponent> pow ( const ScalarExponent &  exponent) const
inline
Returns
an expression of the coefficients of *this rasied to the constant power exponent
Template Parameters
Tis the scalar type of exponent. It must be compatible with the scalar type of the given expression.

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

Example:

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

Output:

2
3
4
See also
ArrayBase::pow(ArrayBase), square(), cube(), exp(), log()

◆ rint()

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

Example:

ArrayXd v = ArrayXd::LinSpaced(7,-2,2);
cout << v << endl << endl;
cout << rint(v) << endl;
const RintReturnType rint() const

Output:

    -2
 -1.33
-0.667
     0
 0.667
  1.33
     2

-2
-1
-1
 0
 1
 1
 2
See also
Math functions, ceil(), floor()

Definition at line 455 of file ArrayCwiseUnaryOps.h.

456 {
457  return RintReturnType(derived());
458 }
CwiseUnaryOp< internal::scalar_rint_op< Scalar >, const Derived > RintReturnType

◆ round()

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

Example:

ArrayXd v = ArrayXd::LinSpaced(7,-2,2);
cout << v << endl << endl;
cout << round(v) << endl;
const RoundReturnType round() const

Output:

    -2
 -1.33
-0.667
     0
 0.667
  1.33
     2

-2
-1
-1
 0
 1
 1
 2
See also
Math functions, ceil(), floor()

Definition at line 469 of file ArrayCwiseUnaryOps.h.

470 {
471  return RoundReturnType(derived());
472 }
CwiseUnaryOp< internal::scalar_round_op< Scalar >, const Derived > RoundReturnType

◆ rsqrt()

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:

Array3d v(1,2,4);
cout << v.sqrt() << endl;

Output:

   1
1.41
   2
See also
pow(), square()

Definition at line 207 of file ArrayCwiseUnaryOps.h.

208 {
209  return RsqrtReturnType(derived());
210 }
CwiseUnaryOp< internal::scalar_rsqrt_op< Scalar >, const Derived > RsqrtReturnType

◆ shiftLeft()

template<int N>
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()

Definition at line 536 of file ArrayCwiseUnaryOps.h.

537 {
538  return typename ShiftLeftXpr<N>::Type(derived());
539 }
CwiseUnaryOp< internal::scalar_shift_left_op< Scalar, N >, const Derived > Type

◆ shiftRight()

template<int N>
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()

Definition at line 516 of file ArrayCwiseUnaryOps.h.

517 {
518  return typename ShiftRightXpr<N>::Type(derived());
519 }
CwiseUnaryOp< internal::scalar_shift_right_op< Scalar, N >, const Derived > Type

◆ sign()

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

This function computes the coefficient-wise signum.

Example:

Array3d v(-3,5,0);
cout << v.sign() << endl;

Output:

-1
 1
 0
See also
pow(), square()

Definition at line 223 of file ArrayCwiseUnaryOps.h.

224 {
225  return SignReturnType(derived());
226 }
CwiseUnaryOp< internal::scalar_sign_op< Scalar >, const Derived > SignReturnType

◆ sin()

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:

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

Output:

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

Definition at line 259 of file ArrayCwiseUnaryOps.h.

260 {
261  return SinReturnType(derived());
262 }
CwiseUnaryOp< internal::scalar_sin_op< Scalar >, const Derived > SinReturnType

◆ sinh()

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

Example:

ArrayXd v = ArrayXd::LinSpaced(5,0,1);
cout << sinh(v) << endl;
const SinhReturnType sinh() const

Output:

    0
0.253
0.521
0.822
 1.18
See also
Math functions, sin(), tanh(), cosh()

Definition at line 343 of file ArrayCwiseUnaryOps.h.

344 {
345  return SinhReturnType(derived());
346 }
CwiseUnaryOp< internal::scalar_sinh_op< Scalar >, const Derived > SinhReturnType

◆ sqrt()

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:

Array3d v(1,2,4);
cout << v.sqrt() << endl;

Output:

   1
1.41
   2
See also
Math functions, pow(), square()

Definition at line 191 of file ArrayCwiseUnaryOps.h.

192 {
193  return SqrtReturnType(derived());
194 }
CwiseUnaryOp< internal::scalar_sqrt_op< Scalar >, const Derived > SqrtReturnType

◆ square()

const SquareReturnType 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
Math functions, abs2(), cube(), pow()

Definition at line 427 of file ArrayCwiseUnaryOps.h.

428 {
429  return SquareReturnType(derived());
430 }
CwiseUnaryOp< internal::scalar_square_op< Scalar >, const Derived > SquareReturnType

◆ tan()

const TanReturnType 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
Math functions, cos(), sin()

Definition at line 273 of file ArrayCwiseUnaryOps.h.

274 {
275  return TanReturnType(derived());
276 }
CwiseUnaryOp< internal::scalar_tan_op< Scalar >, const Derived > TanReturnType

◆ tanh()

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

Example:

ArrayXd v = ArrayXd::LinSpaced(5,0,1);
cout << tanh(v) << endl;
const TanhReturnType tanh() const

Output:

    0
0.245
0.462
0.635
0.762
See also
Math functions, tan(), sinh(), cosh()

Definition at line 329 of file ArrayCwiseUnaryOps.h.

330 {
331  return TanhReturnType(derived());
332 }
CwiseUnaryOp< internal::scalar_tanh_op< Scalar >, const Derived > TanhReturnType