Pseudo expression providing additional coefficient-wise operations. More...
#include <Cwise.h>
Public Types | |
typedef internal::conditional < internal::must_nest_by_value < ExpressionType >::ret, ExpressionType, const ExpressionType & >::type | ExpressionTypeNested |
typedef internal::traits < ExpressionType >::Scalar | Scalar |
typedef CwiseUnaryOp < internal::scalar_add_op < Scalar >, ExpressionType > | ScalarAddReturnType |
Public Member Functions | |
const ExpressionType & | _expression () const |
Cwise (const ExpressionType &matrix) | |
template<typename OtherDerived > | |
const | EIGEN_CWISE_BINOP_RETURN_TYPE (internal::scalar_quotient_op) operator/(const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const | EIGEN_CWISE_BINOP_RETURN_TYPE (internal::scalar_min_op) min(const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const | EIGEN_CWISE_BINOP_RETURN_TYPE (internal::scalar_max_op) max(const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const | EIGEN_CWISE_BINOP_RETURN_TYPE (std::less) operator<(const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const | EIGEN_CWISE_BINOP_RETURN_TYPE (std::less_equal) operator< |
template<typename OtherDerived > | |
const | EIGEN_CWISE_BINOP_RETURN_TYPE (std::greater) operator>(const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const | EIGEN_CWISE_BINOP_RETURN_TYPE (std::greater_equal) operator> |
template<typename OtherDerived > | |
const | EIGEN_CWISE_BINOP_RETURN_TYPE (std::equal_to) operator |
template<typename OtherDerived > | |
const | EIGEN_CWISE_BINOP_RETURN_TYPE (std::not_equal_to) operator! |
const | EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE (std::less) operator<(Scalar s) const |
const | EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE (std::less_equal) operator< |
const | EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE (std::greater) operator>(Scalar s) const |
const | EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE (std::greater_equal) operator> |
const | EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE (std::equal_to) operator |
const | EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE (std::not_equal_to) operator! |
template<typename OtherDerived > | |
const | EIGEN_CWISE_PRODUCT_RETURN_TYPE (ExpressionType, OtherDerived) operator*(const MatrixBase< OtherDerived > &other) const |
const | EIGEN_CWISE_UNOP_RETURN_TYPE (internal::scalar_abs_op) abs() const |
const | EIGEN_CWISE_UNOP_RETURN_TYPE (internal::scalar_abs2_op) abs2() const |
const | EIGEN_CWISE_UNOP_RETURN_TYPE (internal::scalar_square_op) square() const |
const | EIGEN_CWISE_UNOP_RETURN_TYPE (internal::scalar_cube_op) cube() const |
const | EIGEN_CWISE_UNOP_RETURN_TYPE (internal::scalar_inverse_op) inverse() const |
const | EIGEN_CWISE_UNOP_RETURN_TYPE (internal::scalar_sqrt_op) sqrt() const |
const | EIGEN_CWISE_UNOP_RETURN_TYPE (internal::scalar_exp_op) exp() const |
const | EIGEN_CWISE_UNOP_RETURN_TYPE (internal::scalar_log_op) log() const |
const | EIGEN_CWISE_UNOP_RETURN_TYPE (internal::scalar_cos_op) cos() const |
const | EIGEN_CWISE_UNOP_RETURN_TYPE (internal::scalar_sin_op) sin() const |
const | EIGEN_CWISE_UNOP_RETURN_TYPE (internal::scalar_pow_op) pow(const Scalar &exponent) 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 > | |
ExpressionType & | operator/= (const MatrixBase< OtherDerived > &other) |
Protected Attributes | |
ExpressionTypeNested | m_matrix |
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:
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
.
typedef internal::conditional<internal::must_nest_by_value<ExpressionType>::ret, ExpressionType, const ExpressionType&>::type Cwise< ExpressionType >::ExpressionTypeNested |
typedef CwiseUnaryOp<internal::scalar_add_op<Scalar>, ExpressionType> Cwise< ExpressionType >::ScalarAddReturnType |
const ExpressionType& Cwise< ExpressionType >::_expression | ( | ) | const [inline] |
const Cwise< ExpressionType >::EIGEN_CWISE_BINOP_RETURN_TYPE | ( | internal::scalar_quotient_op | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_BINOP_RETURN_TYPE | ( | internal::scalar_min_op | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_BINOP_RETURN_TYPE | ( | internal::scalar_max_op | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_BINOP_RETURN_TYPE | ( | std::less | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_BINOP_RETURN_TYPE | ( | std::less_equal | ) |
const Cwise< ExpressionType >::EIGEN_CWISE_BINOP_RETURN_TYPE | ( | std::greater | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_BINOP_RETURN_TYPE | ( | std::greater_equal | ) |
const Cwise< ExpressionType >::EIGEN_CWISE_BINOP_RETURN_TYPE | ( | std::equal_to | ) |
const Cwise< ExpressionType >::EIGEN_CWISE_BINOP_RETURN_TYPE | ( | std::not_equal_to | ) |
const Cwise< ExpressionType >::EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE | ( | std::less | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE | ( | std::less_equal | ) |
const Cwise< ExpressionType >::EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE | ( | std::greater | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE | ( | std::greater_equal | ) |
const Cwise< ExpressionType >::EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE | ( | std::equal_to | ) |
const Cwise< ExpressionType >::EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE | ( | std::not_equal_to | ) |
const Cwise< ExpressionType >::EIGEN_CWISE_PRODUCT_RETURN_TYPE | ( | ExpressionType | , |
OtherDerived | |||
) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_UNOP_RETURN_TYPE | ( | internal::scalar_abs_op | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_UNOP_RETURN_TYPE | ( | internal::scalar_abs2_op | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_UNOP_RETURN_TYPE | ( | internal::scalar_square_op | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_UNOP_RETURN_TYPE | ( | internal::scalar_cube_op | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_UNOP_RETURN_TYPE | ( | internal::scalar_inverse_op | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_UNOP_RETURN_TYPE | ( | internal::scalar_sqrt_op | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_UNOP_RETURN_TYPE | ( | internal::scalar_exp_op | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_UNOP_RETURN_TYPE | ( | internal::scalar_log_op | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_UNOP_RETURN_TYPE | ( | internal::scalar_cos_op | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_UNOP_RETURN_TYPE | ( | internal::scalar_sin_op | ) | const |
const Cwise< ExpressionType >::EIGEN_CWISE_UNOP_RETURN_TYPE | ( | internal::scalar_pow_op | ) | const |
ExpressionType & Cwise< ExpressionType >::operator*= | ( | const MatrixBase< OtherDerived > & | other | ) | [inline] |
Definition at line 86 of file CwiseOperators.h.
const Cwise< ExpressionType >::ScalarAddReturnType Cwise< ExpressionType >::operator+ | ( | const Scalar & | scalar | ) | const [inline] |
Definition at line 300 of file CwiseOperators.h.
ExpressionType & Cwise< ExpressionType >::operator+= | ( | const Scalar & | scalar | ) | [inline] |
Definition at line 307 of file CwiseOperators.h.
const Cwise< ExpressionType >::ScalarAddReturnType Cwise< ExpressionType >::operator- | ( | const Scalar & | scalar | ) | const [inline] |
Definition at line 315 of file CwiseOperators.h.
ExpressionType & Cwise< ExpressionType >::operator-= | ( | const Scalar & | scalar | ) | [inline] |
Definition at line 322 of file CwiseOperators.h.
ExpressionType & Cwise< ExpressionType >::operator/= | ( | const MatrixBase< OtherDerived > & | other | ) | [inline] |
Definition at line 94 of file CwiseOperators.h.
const ScalarAddReturnType operator+ | ( | const Scalar & | scalar, |
const Cwise< ExpressionType > & | mat | ||
) | [friend] |
ExpressionTypeNested Cwise< ExpressionType >::m_matrix [protected] |