ArrayCwiseUnaryOps.h
Go to the documentation of this file.
1 
2 
3 typedef CwiseUnaryOp<internal::scalar_abs_op<Scalar>, const Derived> AbsReturnType;
4 typedef CwiseUnaryOp<internal::scalar_arg_op<Scalar>, const Derived> ArgReturnType;
5 typedef CwiseUnaryOp<internal::scalar_carg_op<Scalar>, const Derived> CArgReturnType;
6 typedef CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, const Derived> Abs2ReturnType;
7 typedef CwiseUnaryOp<internal::scalar_sqrt_op<Scalar>, const Derived> SqrtReturnType;
8 typedef CwiseUnaryOp<internal::scalar_rsqrt_op<Scalar>, const Derived> RsqrtReturnType;
9 typedef CwiseUnaryOp<internal::scalar_sign_op<Scalar>, const Derived> SignReturnType;
10 typedef CwiseUnaryOp<internal::scalar_inverse_op<Scalar>, const Derived> InverseReturnType;
11 typedef CwiseUnaryOp<internal::scalar_boolean_not_op<Scalar>, const Derived> BooleanNotReturnType;
12 typedef CwiseUnaryOp<internal::scalar_bitwise_not_op<Scalar>, const Derived> BitwiseNotReturnType;
13 
14 typedef CwiseUnaryOp<internal::scalar_exp_op<Scalar>, const Derived> ExpReturnType;
15 typedef CwiseUnaryOp<internal::scalar_expm1_op<Scalar>, const Derived> Expm1ReturnType;
16 typedef CwiseUnaryOp<internal::scalar_log_op<Scalar>, const Derived> LogReturnType;
17 typedef CwiseUnaryOp<internal::scalar_log1p_op<Scalar>, const Derived> Log1pReturnType;
18 typedef CwiseUnaryOp<internal::scalar_log10_op<Scalar>, const Derived> Log10ReturnType;
19 typedef CwiseUnaryOp<internal::scalar_log2_op<Scalar>, const Derived> Log2ReturnType;
20 typedef CwiseUnaryOp<internal::scalar_cos_op<Scalar>, const Derived> CosReturnType;
21 typedef CwiseUnaryOp<internal::scalar_sin_op<Scalar>, const Derived> SinReturnType;
22 typedef CwiseUnaryOp<internal::scalar_tan_op<Scalar>, const Derived> TanReturnType;
23 typedef CwiseUnaryOp<internal::scalar_acos_op<Scalar>, const Derived> AcosReturnType;
24 typedef CwiseUnaryOp<internal::scalar_asin_op<Scalar>, const Derived> AsinReturnType;
25 typedef CwiseUnaryOp<internal::scalar_atan_op<Scalar>, const Derived> AtanReturnType;
26 typedef CwiseUnaryOp<internal::scalar_tanh_op<Scalar>, const Derived> TanhReturnType;
27 typedef CwiseUnaryOp<internal::scalar_logistic_op<Scalar>, const Derived> LogisticReturnType;
28 typedef CwiseUnaryOp<internal::scalar_sinh_op<Scalar>, const Derived> SinhReturnType;
29 typedef CwiseUnaryOp<internal::scalar_atanh_op<Scalar>, const Derived> AtanhReturnType;
30 typedef CwiseUnaryOp<internal::scalar_asinh_op<Scalar>, const Derived> AsinhReturnType;
31 typedef CwiseUnaryOp<internal::scalar_acosh_op<Scalar>, const Derived> AcoshReturnType;
32 typedef CwiseUnaryOp<internal::scalar_cosh_op<Scalar>, const Derived> CoshReturnType;
33 typedef CwiseUnaryOp<internal::scalar_square_op<Scalar>, const Derived> SquareReturnType;
34 typedef CwiseUnaryOp<internal::scalar_cube_op<Scalar>, const Derived> CubeReturnType;
35 typedef CwiseUnaryOp<internal::scalar_round_op<Scalar>, const Derived> RoundReturnType;
36 typedef CwiseUnaryOp<internal::scalar_rint_op<Scalar>, const Derived> RintReturnType;
37 typedef CwiseUnaryOp<internal::scalar_floor_op<Scalar>, const Derived> FloorReturnType;
38 typedef CwiseUnaryOp<internal::scalar_ceil_op<Scalar>, const Derived> CeilReturnType;
39 typedef CwiseUnaryOp<internal::scalar_isnan_op<Scalar>, const Derived> IsNaNReturnType;
40 typedef CwiseUnaryOp<internal::scalar_isinf_op<Scalar>, const Derived> IsInfReturnType;
41 typedef CwiseUnaryOp<internal::scalar_isfinite_op<Scalar>, const Derived> IsFiniteReturnType;
42 
51 EIGEN_STRONG_INLINE const AbsReturnType
52 abs() const
53 {
54  return AbsReturnType(derived());
55 }
56 
65 EIGEN_STRONG_INLINE const ArgReturnType
66 arg() const
67 {
68  return ArgReturnType(derived());
69 }
70 
72 EIGEN_STRONG_INLINE const CArgReturnType
73 carg() const { return CArgReturnType(derived()); }
74 
83 EIGEN_STRONG_INLINE const Abs2ReturnType
84 abs2() const
85 {
86  return Abs2ReturnType(derived());
87 }
88 
100 inline const ExpReturnType
101 exp() const
102 {
103  return ExpReturnType(derived());
104 }
105 
114 inline const Expm1ReturnType
115 expm1() const
116 {
117  return Expm1ReturnType(derived());
118 }
119 
131 inline const LogReturnType
132 log() const
133 {
134  return LogReturnType(derived());
135 }
136 
145 inline const Log1pReturnType
146 log1p() const
147 {
148  return Log1pReturnType(derived());
149 }
150 
161 inline const Log10ReturnType
162 log10() const
163 {
164  return Log10ReturnType(derived());
165 }
166 
173 inline const Log2ReturnType
174 log2() const
175 {
176  return Log2ReturnType(derived());
177 }
178 
190 inline const SqrtReturnType
191 sqrt() const
192 {
193  return SqrtReturnType(derived());
194 }
195 
206 inline const RsqrtReturnType
207 rsqrt() const
208 {
209  return RsqrtReturnType(derived());
210 }
211 
222 inline const SignReturnType
223 sign() const
224 {
225  return SignReturnType(derived());
226 }
227 
228 
240 inline const CosReturnType
241 cos() const
242 {
243  return CosReturnType(derived());
244 }
245 
246 
258 inline const SinReturnType
259 sin() const
260 {
261  return SinReturnType(derived());
262 }
263 
272 inline const TanReturnType
273 tan() const
274 {
275  return TanReturnType(derived());
276 }
277 
286 inline const AtanReturnType
287 atan() const
288 {
289  return AtanReturnType(derived());
290 }
291 
300 inline const AcosReturnType
301 acos() const
302 {
303  return AcosReturnType(derived());
304 }
305 
314 inline const AsinReturnType
315 asin() const
316 {
317  return AsinReturnType(derived());
318 }
319 
328 inline const TanhReturnType
329 tanh() const
330 {
331  return TanhReturnType(derived());
332 }
333 
342 inline const SinhReturnType
343 sinh() const
344 {
345  return SinhReturnType(derived());
346 }
347 
356 inline const CoshReturnType
357 cosh() const
358 {
359  return CoshReturnType(derived());
360 }
361 
367 inline const AtanhReturnType
368 atanh() const
369 {
370  return AtanhReturnType(derived());
371 }
372 
378 inline const AsinhReturnType
379 asinh() const
380 {
381  return AsinhReturnType(derived());
382 }
383 
389 inline const AcoshReturnType
390 acosh() const
391 {
392  return AcoshReturnType(derived());
393 }
394 
398 inline const LogisticReturnType
399 logistic() const
400 {
401  return LogisticReturnType(derived());
402 }
403 
412 inline const InverseReturnType
413 inverse() const
414 {
415  return InverseReturnType(derived());
416 }
417 
426 inline const SquareReturnType
427 square() const
428 {
429  return SquareReturnType(derived());
430 }
431 
440 inline const CubeReturnType
441 cube() const
442 {
443  return CubeReturnType(derived());
444 }
445 
454 inline const RintReturnType
455 rint() const
456 {
457  return RintReturnType(derived());
458 }
459 
468 inline const RoundReturnType
469 round() const
470 {
471  return RoundReturnType(derived());
472 }
473 
482 inline const FloorReturnType
483 floor() const
484 {
485  return FloorReturnType(derived());
486 }
487 
496 inline const CeilReturnType
497 ceil() const
498 {
499  return CeilReturnType(derived());
500 }
501 
502 template<int N> struct ShiftRightXpr {
503  typedef CwiseUnaryOp<internal::scalar_shift_right_op<Scalar, N>, const Derived> Type;
504 };
505 
513 template<int N>
515 typename ShiftRightXpr<N>::Type
516 shiftRight() const
517 {
518  return typename ShiftRightXpr<N>::Type(derived());
519 }
520 
521 
522 template<int N> struct ShiftLeftXpr {
523  typedef CwiseUnaryOp<internal::scalar_shift_left_op<Scalar, N>, const Derived> Type;
524 };
525 
533 template<int N>
535 typename ShiftLeftXpr<N>::Type
536 shiftLeft() const
537 {
538  return typename ShiftLeftXpr<N>::Type(derived());
539 }
540 
549 inline const IsNaNReturnType
550 isNaN() const
551 {
552  return IsNaNReturnType(derived());
553 }
554 
563 inline const IsInfReturnType
564 isInf() const
565 {
566  return IsInfReturnType(derived());
567 }
568 
577 inline const IsFiniteReturnType
578 isFinite() const
579 {
580  return IsFiniteReturnType(derived());
581 }
582 
591 inline const BooleanNotReturnType
592 operator!() const
593 {
594  return BooleanNotReturnType(derived());
595 }
596 
600 inline const BitwiseNotReturnType
601 operator~() const
602 {
603  return BitwiseNotReturnType(derived());
604 }
605 
606 
607 // --- SpecialFunctions module ---
608 
609 typedef CwiseUnaryOp<internal::scalar_lgamma_op<Scalar>, const Derived> LgammaReturnType;
610 typedef CwiseUnaryOp<internal::scalar_digamma_op<Scalar>, const Derived> DigammaReturnType;
611 typedef CwiseUnaryOp<internal::scalar_erf_op<Scalar>, const Derived> ErfReturnType;
612 typedef CwiseUnaryOp<internal::scalar_erfc_op<Scalar>, const Derived> ErfcReturnType;
613 typedef CwiseUnaryOp<internal::scalar_ndtri_op<Scalar>, const Derived> NdtriReturnType;
614 
626 inline const LgammaReturnType
627 lgamma() const
628 {
629  return LgammaReturnType(derived());
630 }
631 
643 inline const DigammaReturnType
644 digamma() const
645 {
646  return DigammaReturnType(derived());
647 }
648 
661 inline const ErfReturnType
662 erf() const
663 {
664  return ErfReturnType(derived());
665 }
666 
679 inline const ErfcReturnType
680 erfc() const
681 {
682  return ErfcReturnType(derived());
683 }
684 
699 inline const NdtriReturnType
700 ndtri() const
701 {
702  return NdtriReturnType(derived());
703 }
704 
705 template <typename ScalarExponent>
707  std::enable_if_t<internal::is_arithmetic<typename NumTraits<ScalarExponent>::Real>::value,
708  CwiseUnaryOp<internal::scalar_unary_pow_op<Scalar, ScalarExponent>, const Derived>>;
709 
710 #ifndef EIGEN_PARSED_BY_DOXYGEN
711 template <typename ScalarExponent>
713  const ScalarExponent& exponent) const {
714  return UnaryPowReturnType<ScalarExponent>(derived(), internal::scalar_unary_pow_op<Scalar, ScalarExponent>(exponent));
715 #else
728 template <typename ScalarExponent>
730  const ScalarExponent& exponent) const;
731 #endif
732 }
CwiseUnaryOp< internal::scalar_bitwise_not_op< Scalar >, const Derived > BitwiseNotReturnType
const NdtriReturnType ndtri() const
const AtanReturnType atan() const
CwiseUnaryOp< internal::scalar_sin_op< Scalar >, const Derived > SinReturnType
CwiseUnaryOp< internal::scalar_cosh_op< Scalar >, const Derived > CoshReturnType
CwiseUnaryOp< internal::scalar_ceil_op< Scalar >, const Derived > CeilReturnType
const AcosReturnType acos() const
CwiseUnaryOp< internal::scalar_log_op< Scalar >, const Derived > LogReturnType
std::enable_if_t< internal::is_arithmetic< typename NumTraits< ScalarExponent >::Real >::value, CwiseUnaryOp< internal::scalar_unary_pow_op< Scalar, ScalarExponent >, const Derived > > UnaryPowReturnType
const SignReturnType sign() const
CwiseUnaryOp< internal::scalar_square_op< Scalar >, const Derived > SquareReturnType
const AcoshReturnType acosh() const
CwiseUnaryOp< internal::scalar_inverse_op< Scalar >, const Derived > InverseReturnType
CwiseUnaryOp< internal::scalar_asinh_op< Scalar >, const Derived > AsinhReturnType
CwiseUnaryOp< internal::scalar_arg_op< Scalar >, const Derived > ArgReturnType
const IsNaNReturnType isNaN() const
CwiseUnaryOp< internal::scalar_log1p_op< Scalar >, const Derived > Log1pReturnType
CwiseUnaryOp< internal::scalar_abs_op< Scalar >, const Derived > AbsReturnType
CwiseUnaryOp< internal::scalar_floor_op< Scalar >, const Derived > FloorReturnType
CwiseUnaryOp< internal::scalar_erfc_op< Scalar >, const Derived > ErfcReturnType
CwiseUnaryOp< internal::scalar_exp_op< Scalar >, const Derived > ExpReturnType
const AsinReturnType asin() const
CwiseUnaryOp< internal::scalar_sinh_op< Scalar >, const Derived > SinhReturnType
const CArgReturnType carg() const
const ExpReturnType exp() const
CwiseUnaryOp< internal::scalar_acos_op< Scalar >, const Derived > AcosReturnType
const Abs2ReturnType abs2() const
const LgammaReturnType lgamma() const
CwiseUnaryOp< internal::scalar_asin_op< Scalar >, const Derived > AsinReturnType
CwiseUnaryOp< internal::scalar_round_op< Scalar >, const Derived > RoundReturnType
const ArgReturnType arg() const
const CeilReturnType ceil() const
const RoundReturnType round() const
CwiseUnaryOp< internal::scalar_atan_op< Scalar >, const Derived > AtanReturnType
const SinReturnType sin() const
CwiseUnaryOp< internal::scalar_abs2_op< Scalar >, const Derived > Abs2ReturnType
const DigammaReturnType digamma() const
const BooleanNotReturnType operator!() const
CwiseUnaryOp< internal::scalar_digamma_op< Scalar >, const Derived > DigammaReturnType
const AsinhReturnType asinh() const
CwiseUnaryOp< internal::scalar_logistic_op< Scalar >, const Derived > LogisticReturnType
CwiseUnaryOp< internal::scalar_isfinite_op< Scalar >, const Derived > IsFiniteReturnType
const SinhReturnType sinh() const
const SquareReturnType square() const
const InverseReturnType inverse() const
const TanReturnType tan() const
const Log2ReturnType log2() const
CwiseUnaryOp< internal::scalar_lgamma_op< Scalar >, const Derived > LgammaReturnType
ShiftLeftXpr< N >::Type shiftLeft() const
CwiseUnaryOp< internal::scalar_sqrt_op< Scalar >, const Derived > SqrtReturnType
CwiseUnaryOp< internal::scalar_isinf_op< Scalar >, const Derived > IsInfReturnType
CwiseUnaryOp< internal::scalar_rsqrt_op< Scalar >, const Derived > RsqrtReturnType
const Log1pReturnType log1p() const
const CubeReturnType cube() const
const RintReturnType rint() const
CwiseUnaryOp< internal::scalar_cos_op< Scalar >, const Derived > CosReturnType
const ErfReturnType erf() const
CwiseUnaryOp< internal::scalar_atanh_op< Scalar >, const Derived > AtanhReturnType
CwiseUnaryOp< internal::scalar_tanh_op< Scalar >, const Derived > TanhReturnType
CwiseUnaryOp< internal::scalar_acosh_op< Scalar >, const Derived > AcoshReturnType
const AbsReturnType abs() const
const BitwiseNotReturnType operator~() const
const AtanhReturnType atanh() const
const IsInfReturnType isInf() const
CwiseUnaryOp< internal::scalar_sign_op< Scalar >, const Derived > SignReturnType
const SqrtReturnType sqrt() const
CwiseUnaryOp< internal::scalar_erf_op< Scalar >, const Derived > ErfReturnType
const LogisticReturnType logistic() const
ShiftRightXpr< N >::Type shiftRight() const
CwiseUnaryOp< internal::scalar_log2_op< Scalar >, const Derived > Log2ReturnType
CwiseUnaryOp< internal::scalar_cube_op< Scalar >, const Derived > CubeReturnType
const Expm1ReturnType expm1() const
CwiseUnaryOp< internal::scalar_isnan_op< Scalar >, const Derived > IsNaNReturnType
const FloorReturnType floor() const
CwiseUnaryOp< internal::scalar_carg_op< Scalar >, const Derived > CArgReturnType
CwiseUnaryOp< internal::scalar_log10_op< Scalar >, const Derived > Log10ReturnType
const IsFiniteReturnType isFinite() const
const CoshReturnType cosh() const
CwiseUnaryOp< internal::scalar_tan_op< Scalar >, const Derived > TanReturnType
const RsqrtReturnType rsqrt() const
const TanhReturnType tanh() const
CwiseUnaryOp< internal::scalar_ndtri_op< Scalar >, const Derived > NdtriReturnType
const LogReturnType log() const
CwiseUnaryOp< internal::scalar_rint_op< Scalar >, const Derived > RintReturnType
CwiseUnaryOp< internal::scalar_boolean_not_op< Scalar >, const Derived > BooleanNotReturnType
CwiseUnaryOp< internal::scalar_expm1_op< Scalar >, const Derived > Expm1ReturnType
const CosReturnType cos() const
const Log10ReturnType log10() const
const ErfcReturnType erfc() const
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:883
const GlobalUnaryPowReturnType< Derived, ScalarExponent > pow(const Eigen::ArrayBase< Derived > &x, const ScalarExponent &exponent)
CwiseUnaryOp< internal::scalar_shift_left_op< Scalar, N >, const Derived > Type
CwiseUnaryOp< internal::scalar_shift_right_op< Scalar, N >, const Derived > Type