WPILibC++ 2023.4.3-108-ge5452e3
MatrixCwiseUnaryOps.h
Go to the documentation of this file.
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
5// Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
6//
7// This Source Code Form is subject to the terms of the Mozilla
8// Public License v. 2.0. If a copy of the MPL was not distributed
9// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
11// This file is included into the body of the base classes supporting matrix specific coefficient-wise functions.
12// This include MatrixBase and SparseMatrixBase.
13
14
15typedef CwiseUnaryOp<internal::scalar_abs_op<Scalar>, const Derived> CwiseAbsReturnType;
16typedef CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, const Derived> CwiseAbs2ReturnType;
17typedef CwiseUnaryOp<internal::scalar_arg_op<Scalar>, const Derived> CwiseArgReturnType;
18typedef CwiseUnaryOp<internal::scalar_sqrt_op<Scalar>, const Derived> CwiseSqrtReturnType;
19typedef CwiseUnaryOp<internal::scalar_sign_op<Scalar>, const Derived> CwiseSignReturnType;
20typedef CwiseUnaryOp<internal::scalar_inverse_op<Scalar>, const Derived> CwiseInverseReturnType;
21
22/// \returns an expression of the coefficient-wise absolute value of \c *this
23///
24/// Example: \include MatrixBase_cwiseAbs.cpp
25/// Output: \verbinclude MatrixBase_cwiseAbs.out
26///
28///
29/// \sa cwiseAbs2()
30///
33cwiseAbs() const { return CwiseAbsReturnType(derived()); }
34
35/// \returns an expression of the coefficient-wise squared absolute value of \c *this
36///
37/// Example: \include MatrixBase_cwiseAbs2.cpp
38/// Output: \verbinclude MatrixBase_cwiseAbs2.out
39///
41///
42/// \sa cwiseAbs()
43///
46cwiseAbs2() const { return CwiseAbs2ReturnType(derived()); }
47
48/// \returns an expression of the coefficient-wise square root of *this.
49///
50/// Example: \include MatrixBase_cwiseSqrt.cpp
51/// Output: \verbinclude MatrixBase_cwiseSqrt.out
52///
54///
55/// \sa cwisePow(), cwiseSquare()
56///
58inline const CwiseSqrtReturnType
59cwiseSqrt() const { return CwiseSqrtReturnType(derived()); }
60
61/// \returns an expression of the coefficient-wise signum of *this.
62///
63/// Example: \include MatrixBase_cwiseSign.cpp
64/// Output: \verbinclude MatrixBase_cwiseSign.out
65///
67///
69inline const CwiseSignReturnType
70cwiseSign() const { return CwiseSignReturnType(derived()); }
71
72
73/// \returns an expression of the coefficient-wise inverse of *this.
74///
75/// Example: \include MatrixBase_cwiseInverse.cpp
76/// Output: \verbinclude MatrixBase_cwiseInverse.out
77///
79///
80/// \sa cwiseProduct()
81///
83inline const CwiseInverseReturnType
84cwiseInverse() const { return CwiseInverseReturnType(derived()); }
85
86/// \returns an expression of the coefficient-wise phase angle of \c *this
87///
88/// Example: \include MatrixBase_cwiseArg.cpp
89/// Output: \verbinclude MatrixBase_cwiseArg.out
90///
92
94inline const CwiseArgReturnType
95cwiseArg() const { return CwiseArgReturnType(derived()); }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArgReturnType arg() const
Definition: ArrayCwiseUnaryOps.h:66
EIGEN_DEVICE_FUNC const SquareReturnType square() const
Definition: ArrayCwiseUnaryOps.h:425
EIGEN_DEVICE_FUNC const InverseReturnType inverse() const
Definition: ArrayCwiseUnaryOps.h:411
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:986
#define EIGEN_STRONG_INLINE
Definition: Macros.h:927
EIGEN_DEVICE_FUNC const CwiseSqrtReturnType cwiseSqrt() const
Definition: MatrixCwiseUnaryOps.h:59
CwiseUnaryOp< internal::scalar_abs_op< Scalar >, const Derived > CwiseAbsReturnType
Definition: MatrixCwiseUnaryOps.h:15
EIGEN_DEVICE_FUNC const CwiseArgReturnType cwiseArg() const
Definition: MatrixCwiseUnaryOps.h:95
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseAbs2ReturnType cwiseAbs2() const
Definition: MatrixCwiseUnaryOps.h:46
CwiseUnaryOp< internal::scalar_arg_op< Scalar >, const Derived > CwiseArgReturnType
Definition: MatrixCwiseUnaryOps.h:17
CwiseUnaryOp< internal::scalar_abs2_op< Scalar >, const Derived > CwiseAbs2ReturnType
Definition: MatrixCwiseUnaryOps.h:16
EIGEN_DEVICE_FUNC const CwiseInverseReturnType cwiseInverse() const
Definition: MatrixCwiseUnaryOps.h:84
CwiseUnaryOp< internal::scalar_sign_op< Scalar >, const Derived > CwiseSignReturnType
Definition: MatrixCwiseUnaryOps.h:19
EIGEN_DEVICE_FUNC const CwiseSignReturnType cwiseSign() const
Definition: MatrixCwiseUnaryOps.h:70
CwiseUnaryOp< internal::scalar_sqrt_op< Scalar >, const Derived > CwiseSqrtReturnType
Definition: MatrixCwiseUnaryOps.h:18
CwiseUnaryOp< internal::scalar_inverse_op< Scalar >, const Derived > CwiseInverseReturnType
Definition: MatrixCwiseUnaryOps.h:20
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseAbsReturnType cwiseAbs() const
Definition: MatrixCwiseUnaryOps.h:33
#define EIGEN_DOC_UNARY_ADDONS(X, Y)
Definition: SparseMatrixBase.h:158
Definition: core.h:1240
typename units::detail::squared_impl< U >::type squared
represents the unit type of class U squared
Definition: base.h:1176
Definition: core.h:2085