aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/plugins/ArrayCwiseUnaryOps.h
diff options
context:
space:
mode:
authorGravatar Mark Borgerding <mark@borgerding.net>2015-11-24 17:15:07 -0500
committerGravatar Mark Borgerding <mark@borgerding.net>2015-11-24 17:15:07 -0500
commit7ddcf97da7683d7149bef880ab3f1967ccf2a7ab (patch)
tree314adc496324d9e0ce8d3a9c5e46416dab8f5f8a /Eigen/src/plugins/ArrayCwiseUnaryOps.h
parent44848ac39bba2ba25514c6c897f5dc7bba1c76ae (diff)
added scalar_sign_op (both real,complex)
Diffstat (limited to 'Eigen/src/plugins/ArrayCwiseUnaryOps.h')
-rw-r--r--Eigen/src/plugins/ArrayCwiseUnaryOps.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/Eigen/src/plugins/ArrayCwiseUnaryOps.h b/Eigen/src/plugins/ArrayCwiseUnaryOps.h
index 5a3c92ea2..60d56a252 100644
--- a/Eigen/src/plugins/ArrayCwiseUnaryOps.h
+++ b/Eigen/src/plugins/ArrayCwiseUnaryOps.h
@@ -4,6 +4,7 @@ typedef CwiseUnaryOp<internal::scalar_abs_op<Scalar>, const Derived> AbsReturnTy
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_sign_op<Scalar>, const Derived> SignReturnType;
typedef CwiseUnaryOp<internal::scalar_inverse_op<Scalar>, const Derived> InverseReturnType;
typedef CwiseUnaryOp<internal::scalar_boolean_not_op<Scalar>, const Derived> BooleanNotReturnType;
@@ -138,6 +139,24 @@ sqrt() const
return SqrtReturnType(derived());
}
+/** \returns an expression of the coefficient-wise signum of *this.
+ *
+ * This function computes the coefficient-wise signum. The function MatrixBase::sign() in the
+ * unsupported module MatrixFunctions computes the matrix square root.
+ *
+ * Example: \include Cwise_sign.cpp
+ * Output: \verbinclude Cwise_sign.out
+ *
+ * \sa pow(), square()
+ */
+EIGEN_DEVICE_FUNC
+inline const SignReturnType
+sign() const
+{
+ return SignReturnType(derived());
+}
+
+
/** \returns an expression of the coefficient-wise cosine of *this.
*
* This function computes the coefficient-wise cosine. The function MatrixBase::cos() in the