CommonCwiseUnaryOps.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 a base class plugin containing common coefficient wise functions.
12 
13 #ifndef EIGEN_PARSED_BY_DOXYGEN
14 
17  const CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>, const Derived>,
18  const Derived&
22  const CwiseUnaryOp<internal::scalar_real_op<Scalar>, const Derived>,
23  const Derived&
27  CwiseUnaryView<internal::scalar_real_ref_op<Scalar>, Derived>,
28  Derived&
31 typedef CwiseUnaryOp<internal::scalar_imag_op<Scalar>, const Derived> ImagReturnType;
33 typedef CwiseUnaryView<internal::scalar_imag_ref_op<Scalar>, Derived> NonConstImagReturnType;
34 
35 typedef CwiseUnaryOp<internal::scalar_opposite_op<Scalar>, const Derived> NegativeReturnType;
36 
37 #endif // not EIGEN_PARSED_BY_DOXYGEN
38 
41 EIGEN_DOC_UNARY_ADDONS(operator-,opposite)
44 inline const NegativeReturnType
45 operator-() const { return NegativeReturnType(derived()); }
46 
47 
48 template<class NewType> struct CastXpr { typedef typename internal::cast_return_type<Derived,const CwiseUnaryOp<internal::scalar_cast_op<Scalar, NewType>, const Derived> >::type Type; };
49 
55 EIGEN_DOC_UNARY_ADDONS(cast,conversion function)
59 template<typename NewType>
62 cast() const
63 {
64  return typename CastXpr<NewType>::Type(derived());
65 }
66 
74 conjugate() const
75 {
76  return ConjugateReturnType(derived());
77 }
78 
84 template<bool Cond>
87 conjugateIf() const
88 {
90  return ReturnType(derived());
91 }
92 
99 inline RealReturnType
100 real() const { return RealReturnType(derived()); }
101 
104 EIGEN_DOC_UNARY_ADDONS(imag,imaginary part function)
108 inline const ImagReturnType
109 imag() const { return ImagReturnType(derived()); }
110 
132 template<typename CustomUnaryOp>
134 inline const CwiseUnaryOp<CustomUnaryOp, const Derived>
135 unaryExpr(const CustomUnaryOp& func = CustomUnaryOp()) const
136 {
137  return CwiseUnaryOp<CustomUnaryOp, const Derived>(derived(), func);
138 }
139 
153 template<typename CustomViewOp>
155 inline const CwiseUnaryView<CustomViewOp, const Derived>
156 unaryViewExpr(const CustomViewOp& func = CustomViewOp()) const
157 {
158  return CwiseUnaryView<CustomViewOp, const Derived>(derived(), func);
159 }
160 
168 real() { return NonConstRealReturnType(derived()); }
169 
172 EIGEN_DOC_UNARY_ADDONS(imag,imaginary part function)
177 imag() { return NonConstImagReturnType(derived()); }
EIGEN_DEVICE_FUNC
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
gtsam.examples.DogLegOptimizerExample.type
type
Definition: DogLegOptimizerExample.py:111
RealReturnType
internal::conditional< NumTraits< Scalar >::IsComplex, const CwiseUnaryOp< internal::scalar_real_op< Scalar >, const Derived >, const Derived & >::type RealReturnType
Definition: CommonCwiseUnaryOps.h:24
CastXpr
Definition: CommonCwiseUnaryOps.h:48
type
Definition: pytypes.h:1491
IsComplex
@ IsComplex
Definition: gtsam/3rdparty/Eigen/blas/common.h:98
NegativeReturnType
CwiseUnaryOp< internal::scalar_opposite_op< Scalar >, const Derived > NegativeReturnType
Definition: CommonCwiseUnaryOps.h:35
unary
Definition: testExpression.cpp:78
unaryExpr
const EIGEN_DEVICE_FUNC CwiseUnaryOp< CustomUnaryOp, const Derived > unaryExpr(const CustomUnaryOp &func=CustomUnaryOp()) const
Apply a unary operator coefficient-wise.
Definition: CommonCwiseUnaryOps.h:135
imag
const EIGEN_DEVICE_FUNC ImagReturnType imag() const
Definition: CommonCwiseUnaryOps.h:109
imag
Definition: main.h:101
part
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t real_t idx_t idx_t idx_t * part
Definition: include/metis.h:200
real
EIGEN_DEVICE_FUNC RealReturnType real() const
Definition: CommonCwiseUnaryOps.h:100
conjugateIf
EIGEN_DEVICE_FUNC internal::conditional< Cond, ConjugateReturnType, const Derived & >::type conjugateIf() const
Definition: CommonCwiseUnaryOps.h:87
CastXpr::Type
internal::cast_return_type< Derived, const CwiseUnaryOp< internal::scalar_cast_op< Scalar, NewType >, const Derived > >::type Type
Definition: CommonCwiseUnaryOps.h:48
conjugate
EIGEN_DEVICE_FUNC ConjugateReturnType conjugate() const
Definition: CommonCwiseUnaryOps.h:74
operator-
const EIGEN_DEVICE_FUNC NegativeReturnType operator-() const
Definition: CommonCwiseUnaryOps.h:45
cast
EIGEN_DEVICE_FUNC CastXpr< NewType >::Type cast() const
Definition: CommonCwiseUnaryOps.h:62
EIGEN_DOC_UNARY_ADDONS
#define EIGEN_DOC_UNARY_ADDONS(X, Y)
Definition: ArrayBase.h:91
Eigen::CwiseUnaryOp
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:55
ConjugateReturnType
internal::conditional< NumTraits< Scalar >::IsComplex, const CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, const Derived >, const Derived & >::type ConjugateReturnType
Definition: CommonCwiseUnaryOps.h:19
NonConstImagReturnType
CwiseUnaryView< internal::scalar_imag_ref_op< Scalar >, Derived > NonConstImagReturnType
Definition: CommonCwiseUnaryOps.h:33
NonConstRealReturnType
internal::conditional< NumTraits< Scalar >::IsComplex, CwiseUnaryView< internal::scalar_real_ref_op< Scalar >, Derived >, Derived & >::type NonConstRealReturnType
Definition: CommonCwiseUnaryOps.h:29
unaryViewExpr
const EIGEN_DEVICE_FUNC CwiseUnaryView< CustomViewOp, const Derived > unaryViewExpr(const CustomViewOp &func=CustomViewOp()) const
Definition: CommonCwiseUnaryOps.h:156
func
Definition: benchGeometry.cpp:23
ImagReturnType
CwiseUnaryOp< internal::scalar_imag_op< Scalar >, const Derived > ImagReturnType
Definition: CommonCwiseUnaryOps.h:31
real
Definition: main.h:100
complex
Definition: datatypes.h:12


gtsam
Author(s):
autogenerated on Thu Jun 13 2024 03:01:55