aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/plugins/ArrayCwiseUnaryOps.h
diff options
context:
space:
mode:
authorGravatar Deanna Hood <deanna.m.hood@gmail.com>2015-03-11 06:39:23 +1000
committerGravatar Deanna Hood <deanna.m.hood@gmail.com>2015-03-11 06:39:23 +1000
commit31fdd67756630de05f2464ef620bc62185a53bee (patch)
tree9700728b8ad190ef9b94035c15360c078f0204bd /Eigen/src/plugins/ArrayCwiseUnaryOps.h
parentfd788748889f50536f590b68dfa98db0044e5115 (diff)
Additional unary coeff-wise functors (isnan, round, arg, e.g.)
Diffstat (limited to 'Eigen/src/plugins/ArrayCwiseUnaryOps.h')
-rw-r--r--Eigen/src/plugins/ArrayCwiseUnaryOps.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/Eigen/src/plugins/ArrayCwiseUnaryOps.h b/Eigen/src/plugins/ArrayCwiseUnaryOps.h
index f6f526d2b..b5f66e181 100644
--- a/Eigen/src/plugins/ArrayCwiseUnaryOps.h
+++ b/Eigen/src/plugins/ArrayCwiseUnaryOps.h
@@ -1,6 +1,7 @@
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_inverse_op<Scalar>, const Derived> InverseReturnType;
@@ -16,6 +17,11 @@ typedef CwiseUnaryOp<internal::scalar_atan_op<Scalar>, const Derived> AtanReturn
typedef CwiseUnaryOp<internal::scalar_pow_op<Scalar>, const Derived> PowReturnType;
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_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;
/** \returns an expression of the coefficient-wise absolute value of \c *this
*
@@ -31,6 +37,20 @@ abs() const
return AbsReturnType(derived());
}
+/** \returns an expression of the coefficient-wise phase angle of \c *this
+ *
+ * Example: \include Cwise_arg.cpp
+ * Output: \verbinclude Cwise_arg.out
+ *
+ * \sa abs()
+ */
+EIGEN_DEVICE_FUNC
+EIGEN_STRONG_INLINE const ArgReturnType
+arg() const
+{
+ return ArgReturnType(derived());
+}
+
/** \returns an expression of the coefficient-wise squared absolute value of \c *this
*
* Example: \include Cwise_abs2.cpp
@@ -246,6 +266,71 @@ cube() const
return CubeReturnType(derived());
}
+/** \returns an expression of the coefficient-wise round of *this.
+ *
+ * Example: \include Cwise_round.cpp
+ * Output: \verbinclude Cwise_round.out
+ *
+ * \sa ceil(), floor()
+ */
+inline const RoundReturnType
+round() const
+{
+ return RoundReturnType(derived());
+}
+
+/** \returns an expression of the coefficient-wise floor of *this.
+ *
+ * Example: \include Cwise_floor.cpp
+ * Output: \verbinclude Cwise_floor.out
+ *
+ * \sa ceil(), round()
+ */
+inline const FloorReturnType
+floor() const
+{
+ return FloorReturnType(derived());
+}
+
+/** \returns an expression of the coefficient-wise ceil of *this.
+ *
+ * Example: \include Cwise_ceil.cpp
+ * Output: \verbinclude Cwise_ceil.out
+ *
+ * \sa floor(), round()
+ */
+inline const CeilReturnType
+ceil() const
+{
+ return CeilReturnType(derived());
+}
+
+/** \returns an expression of the coefficient-wise isnan of *this.
+ *
+ * Example: \include Cwise_isnan.cpp
+ * Output: \verbinclude Cwise_isnan.out
+ *
+ * \sa isinf()
+ */
+inline const IsnanReturnType
+isnan() const
+{
+ return IsnanReturnType(derived());
+}
+
+/** \returns an expression of the coefficient-wise isinf of *this.
+ *
+ * Example: \include Cwise_isinf.cpp
+ * Output: \verbinclude Cwise_isinf.out
+ *
+ * \sa isnan()
+ */
+inline const IsinfReturnType
+isinf() const
+{
+ return IsinfReturnType(derived());
+}
+
#define EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(METHOD_NAME,FUNCTOR) \
EIGEN_DEVICE_FUNC \
inline const CwiseUnaryOp<std::binder2nd<FUNCTOR<Scalar> >, const Derived> \