Main MRPT website > C++ reference
MRPT logo

ArrayCwiseUnaryOps.h

Go to the documentation of this file.
00001 
00002 
00003 /** \returns an expression of the coefficient-wise absolute value of \c *this
00004   *
00005   * Example: \include Cwise_abs.cpp
00006   * Output: \verbinclude Cwise_abs.out
00007   *
00008   * \sa abs2()
00009   */
00010 EIGEN_STRONG_INLINE const CwiseUnaryOp<internal::scalar_abs_op<Scalar>, Derived>
00011 abs() const
00012 {
00013   return derived();
00014 }
00015 
00016 /** \returns an expression of the coefficient-wise squared absolute value of \c *this
00017   *
00018   * Example: \include Cwise_abs2.cpp
00019   * Output: \verbinclude Cwise_abs2.out
00020   *
00021   * \sa abs(), square()
00022   */
00023 EIGEN_STRONG_INLINE const CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, Derived>
00024 abs2() const
00025 {
00026   return derived();
00027 }
00028 
00029 /** \returns an expression of the coefficient-wise exponential of *this.
00030   *
00031   * Example: \include Cwise_exp.cpp
00032   * Output: \verbinclude Cwise_exp.out
00033   *
00034   * \sa pow(), log(), sin(), cos()
00035   */
00036 inline const CwiseUnaryOp<internal::scalar_exp_op<Scalar>, Derived>
00037 exp() const
00038 {
00039   return derived();
00040 }
00041 
00042 /** \returns an expression of the coefficient-wise logarithm of *this.
00043   *
00044   * Example: \include Cwise_log.cpp
00045   * Output: \verbinclude Cwise_log.out
00046   *
00047   * \sa exp()
00048   */
00049 inline const CwiseUnaryOp<internal::scalar_log_op<Scalar>, Derived>
00050 log() const
00051 {
00052   return derived();
00053 }
00054 
00055 /** \returns an expression of the coefficient-wise square root of *this.
00056   *
00057   * Example: \include Cwise_sqrt.cpp
00058   * Output: \verbinclude Cwise_sqrt.out
00059   *
00060   * \sa pow(), square()
00061   */
00062 inline const CwiseUnaryOp<internal::scalar_sqrt_op<Scalar>, Derived>
00063 sqrt() const
00064 {
00065   return derived();
00066 }
00067 
00068 /** \returns an expression of the coefficient-wise cosine of *this.
00069   *
00070   * Example: \include Cwise_cos.cpp
00071   * Output: \verbinclude Cwise_cos.out
00072   *
00073   * \sa sin(), exp()
00074   */
00075 inline const CwiseUnaryOp<internal::scalar_cos_op<Scalar>, Derived>
00076 cos() const
00077 {
00078   return derived();
00079 }
00080 
00081 
00082 /** \returns an expression of the coefficient-wise sine of *this.
00083   *
00084   * Example: \include Cwise_sin.cpp
00085   * Output: \verbinclude Cwise_sin.out
00086   *
00087   * \sa cos(), exp()
00088   */
00089 inline const CwiseUnaryOp<internal::scalar_sin_op<Scalar>, Derived>
00090 sin() const
00091 {
00092   return derived();
00093 }
00094 
00095 
00096 /** \returns an expression of the coefficient-wise power of *this to the given exponent.
00097   *
00098   * Example: \include Cwise_pow.cpp
00099   * Output: \verbinclude Cwise_pow.out
00100   *
00101   * \sa exp(), log()
00102   */
00103 inline const CwiseUnaryOp<internal::scalar_pow_op<Scalar>, Derived>
00104 pow(const Scalar& exponent) const
00105 {
00106   return CwiseUnaryOp<internal::scalar_pow_op<Scalar>,Derived>
00107           (derived(), internal::scalar_pow_op<Scalar>(exponent));
00108 }
00109 
00110 
00111 /** \returns an expression of the coefficient-wise inverse of *this.
00112   *
00113   * Example: \include Cwise_inverse.cpp
00114   * Output: \verbinclude Cwise_inverse.out
00115   *
00116   * \sa operator/(), operator*()
00117   */
00118 inline const CwiseUnaryOp<internal::scalar_inverse_op<Scalar>, Derived>
00119 inverse() const
00120 {
00121   return derived();
00122 }
00123 
00124 /** \returns an expression of the coefficient-wise square of *this.
00125   *
00126   * Example: \include Cwise_square.cpp
00127   * Output: \verbinclude Cwise_square.out
00128   *
00129   * \sa operator/(), operator*(), abs2()
00130   */
00131 inline const CwiseUnaryOp<internal::scalar_square_op<Scalar>, Derived>
00132 square() const
00133 {
00134   return derived();
00135 }
00136 
00137 /** \returns an expression of the coefficient-wise cube of *this.
00138   *
00139   * Example: \include Cwise_cube.cpp
00140   * Output: \verbinclude Cwise_cube.out
00141   *
00142   * \sa square(), pow()
00143   */
00144 inline const CwiseUnaryOp<internal::scalar_cube_op<Scalar>, Derived>
00145 cube() const
00146 {
00147   return derived();
00148 }
00149 
00150 #define EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(METHOD_NAME,FUNCTOR) \
00151   inline const CwiseUnaryOp<std::binder2nd<FUNCTOR<Scalar> >,Derived> \
00152   METHOD_NAME(const Scalar& s) const { \
00153     return CwiseUnaryOp<std::binder2nd<FUNCTOR<Scalar> >,Derived> \
00154             (derived(), std::bind2nd(FUNCTOR<Scalar>(), s)); \
00155   }
00156 
00157 EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator==,  std::equal_to)
00158 EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator!=,  std::not_equal_to)
00159 EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator<,   std::less)
00160 EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator<=,  std::less_equal)
00161 EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator>,   std::greater)
00162 EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator>=,  std::greater_equal)
00163 



Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:16:28 UTC 2011