Pseudo expression providing additional coefficient-wise operations. More...
Public Member Functions | |
const CwiseUnaryOp < internal::scalar_abs_op < typename internal::traits < ExpressionType >::Scalar > , ExpressionType > | abs () const |
const CwiseUnaryOp < internal::scalar_abs2_op < typename internal::traits < ExpressionType >::Scalar > , ExpressionType > | abs2 () const |
const CwiseUnaryOp < internal::scalar_cos_op < typename internal::traits < ExpressionType >::Scalar > , ExpressionType > | cos () const |
const CwiseUnaryOp < internal::scalar_cube_op < typename internal::traits < ExpressionType >::Scalar > , ExpressionType > | cube () const |
template<typename OtherDerived > | |
const | CwiseBinaryOp (min)(const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const | CwiseBinaryOp (max)(const MatrixBase< OtherDerived > &other) const |
const CwiseUnaryOp < internal::scalar_exp_op < typename internal::traits < ExpressionType >::Scalar > , ExpressionType > | exp () const |
const CwiseUnaryOp < internal::scalar_inverse_op < typename internal::traits < ExpressionType >::Scalar > , ExpressionType > | inverse () const |
const CwiseUnaryOp < internal::scalar_log_op < typename internal::traits < ExpressionType >::Scalar > , ExpressionType > | log () const |
template<typename OtherDerived > | |
const CwiseBinaryOp < std::not_equal_to< typename internal::traits < ExpressionType >::Scalar > , ExpressionType, OtherDerived > | operator!= (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const CwiseBinaryOp < internal::scalar_product_op < typename internal::traits < ExpressionType >::Scalar, typename internal::traits < OtherDerived >::Scalar > , const ExpressionType, const OtherDerived > | operator* (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
ExpressionType & | operator*= (const MatrixBase< OtherDerived > &other) |
const ScalarAddReturnType | operator+ (const Scalar &scalar) const |
ExpressionType & | operator+= (const Scalar &scalar) |
const ScalarAddReturnType | operator- (const Scalar &scalar) const |
ExpressionType & | operator-= (const Scalar &scalar) |
template<typename OtherDerived > | |
const CwiseBinaryOp < internal::scalar_quotient_op < typename internal::traits < ExpressionType >::Scalar > , ExpressionType, OtherDerived > | operator/ (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
ExpressionType & | operator/= (const MatrixBase< OtherDerived > &other) |
template<typename OtherDerived > | |
const CwiseBinaryOp< std::less < typename internal::traits < ExpressionType >::Scalar > , ExpressionType, OtherDerived > | operator< (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const CwiseBinaryOp < std::less_equal< typename internal::traits < ExpressionType >::Scalar > , ExpressionType, OtherDerived > | operator<= (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const CwiseBinaryOp < std::equal_to< typename internal::traits < ExpressionType >::Scalar > , ExpressionType, OtherDerived > | operator== (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const CwiseBinaryOp < std::greater< typename internal::traits < ExpressionType >::Scalar > , ExpressionType, OtherDerived > | operator> (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const CwiseBinaryOp < std::greater_equal< typename internal::traits < ExpressionType >::Scalar > , ExpressionType, OtherDerived > | operator>= (const MatrixBase< OtherDerived > &other) const |
const CwiseUnaryOp < internal::scalar_pow_op < typename internal::traits < ExpressionType >::Scalar > , ExpressionType > | pow (const Scalar &exponent) const |
const CwiseUnaryOp < internal::scalar_sin_op < typename internal::traits < ExpressionType >::Scalar > , ExpressionType > | sin () const |
const CwiseUnaryOp < internal::scalar_sqrt_op < typename internal::traits < ExpressionType >::Scalar > , ExpressionType > | sqrt () const |
const CwiseUnaryOp < internal::scalar_square_op < typename internal::traits < ExpressionType >::Scalar > , ExpressionType > | square () const |
Related Functions | |
(Note that these are not member functions.) | |
const ScalarAddReturnType | operator+ (const Scalar &scalar, const Cwise &mat) |
Pseudo expression providing additional coefficient-wise operations.
ExpressionType | the type of the object on which to do coefficient-wise operations |
This class represents an expression with additional coefficient-wise features. It is the return type of MatrixBase::cwise() and most of the time this is the only way it is used.
Example:
#define EIGEN2_SUPPORT #include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; int main() { Matrix3i m = Matrix3i::Random(); cout << "Here is the matrix m:" << endl << m << endl; Matrix3i n = Matrix3i::Random(); cout << "And here is the matrix n:" << endl << n << endl; cout << "The coefficient-wise product of m and n is:" << endl; cout << m.cwise() * n << endl; cout << "Taking the cube of the coefficients of m yields:" << endl; cout << m.cwise().pow(3) << endl; }
Output:
Here is the matrix m: 7 6 -3 -2 9 6 6 -6 -5 And here is the matrix n: 1 -3 9 0 0 3 3 9 5 The coefficient-wise product of m and n is: 7 -18 -27 0 0 18 18 -54 -25 Taking the cube of the coefficients of m yields: 343 216 -27 -8 729 216 216 -216 -125
This class can be extended with the help of the plugin mechanism described on the page Customizing/Extending Eigen by defining the preprocessor symbol EIGEN_CWISE_PLUGIN
.
const CwiseUnaryOp< internal::scalar_abs_op< typename internal::traits< ExpressionType >::Scalar >, ExpressionType > abs | ( | ) | const [inline] |
const CwiseUnaryOp< internal::scalar_abs2_op< typename internal::traits< ExpressionType >::Scalar >, ExpressionType > abs2 | ( | ) | const [inline] |
const CwiseUnaryOp< internal::scalar_cos_op< typename internal::traits< ExpressionType >::Scalar >, ExpressionType > cos | ( | ) | const [inline] |
const CwiseUnaryOp< internal::scalar_cube_op< typename internal::traits< ExpressionType >::Scalar >, ExpressionType > cube | ( | ) | const [inline] |
const CwiseBinaryOp | ( | min | ) | const [inline] |
const CwiseBinaryOp | ( | max | ) | const [inline] |
const CwiseUnaryOp< internal::scalar_exp_op< typename internal::traits< ExpressionType >::Scalar >, ExpressionType > exp | ( | ) | const [inline] |
const CwiseUnaryOp< internal::scalar_inverse_op< typename internal::traits< ExpressionType >::Scalar >, ExpressionType > inverse | ( | ) | const [inline] |
const CwiseUnaryOp< internal::scalar_log_op< typename internal::traits< ExpressionType >::Scalar >, ExpressionType > log | ( | ) | const [inline] |
const CwiseBinaryOp< std::not_equal_to< typename internal::traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > operator!= | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
const CwiseBinaryOp< internal::scalar_product_op< typename internal::traits< ExpressionType >::Scalar, typename internal::traits< OtherDerived >::Scalar >, const ExpressionType, const OtherDerived > operator* | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
ExpressionType & operator*= | ( | const MatrixBase< OtherDerived > & | other | ) | [inline] |
const Cwise< ExpressionType >::ScalarAddReturnType operator+ | ( | const Scalar & | scalar | ) | const [inline] |
ExpressionType & operator+= | ( | const Scalar & | scalar | ) | [inline] |
const Cwise< ExpressionType >::ScalarAddReturnType operator- | ( | const Scalar & | scalar | ) | const [inline] |
ExpressionType & operator-= | ( | const Scalar & | scalar | ) | [inline] |
const CwiseBinaryOp< internal::scalar_quotient_op< typename internal::traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > operator/ | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
ExpressionType & operator/= | ( | const MatrixBase< OtherDerived > & | other | ) | [inline] |
const CwiseBinaryOp< std::less< typename internal::traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > operator< | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
const CwiseBinaryOp< std::less_equal< typename internal::traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > operator<= | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
const CwiseBinaryOp< std::equal_to< typename internal::traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > operator== | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
const CwiseBinaryOp< std::greater< typename internal::traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > operator> | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
const CwiseBinaryOp< std::greater_equal< typename internal::traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > operator>= | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
const CwiseUnaryOp< internal::scalar_pow_op< typename internal::traits< ExpressionType >::Scalar >, ExpressionType > pow | ( | const Scalar & | exponent | ) | const [inline] |
const CwiseUnaryOp< internal::scalar_sin_op< typename internal::traits< ExpressionType >::Scalar >, ExpressionType > sin | ( | ) | const [inline] |
const CwiseUnaryOp< internal::scalar_sqrt_op< typename internal::traits< ExpressionType >::Scalar >, ExpressionType > sqrt | ( | ) | const [inline] |
const CwiseUnaryOp< internal::scalar_square_op< typename internal::traits< ExpressionType >::Scalar >, ExpressionType > square | ( | ) | const [inline] |
const ScalarAddReturnType operator+ | ( | const Scalar & | scalar, |
const Cwise & | mat | ||
) | [friend] |