Pseudo expression providing additional coefficient-wise operations. More...
Public Types | |
typedef ei_meta_if < ei_must_nest_by_value < ExpressionType >::ret, ExpressionType, const ExpressionType & >::ret | ExpressionTypeNested |
typedef ei_traits < ExpressionType >::Scalar | Scalar |
typedef CwiseUnaryOp < ei_scalar_add_op< Scalar > , ExpressionType > | ScalarAddReturnType |
Public Member Functions | |
const ExpressionType & | _expression () const |
const CwiseUnaryOp < ei_scalar_abs_op< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType > | abs () const |
const CwiseUnaryOp < ei_scalar_abs2_op< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType > | abs2 () const |
const CwiseUnaryOp < ei_scalar_cos_op< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType > | cos () const |
const CwiseUnaryOp < ei_scalar_cube_op< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType > | cube () const |
Cwise (const ExpressionType &matrix) | |
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! |
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 CwiseUnaryOp < ei_scalar_exp_op< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType > | exp () const |
const CwiseUnaryOp < ei_scalar_inverse_op < typename ei_traits < ExpressionType >::Scalar > , ExpressionType > | inverse () const |
const CwiseUnaryOp < ei_scalar_log_op< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType > | log () const |
template<typename OtherDerived > | |
const CwiseBinaryOp < ei_scalar_max_op< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType, OtherDerived > | max (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const CwiseBinaryOp < ei_scalar_min_op< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType, OtherDerived > | min (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const CwiseBinaryOp < std::not_equal_to< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType, OtherDerived > | operator!= (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const EIGEN_CWISE_PRODUCT_RETURN_TYPE | 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 < ei_scalar_quotient_op < typename ei_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 ei_traits < ExpressionType >::Scalar > , ExpressionType, OtherDerived > | operator< (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const CwiseBinaryOp < std::less_equal< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType, OtherDerived > | operator<= (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const CwiseBinaryOp < std::equal_to< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType, OtherDerived > | operator== (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const CwiseBinaryOp < std::greater< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType, OtherDerived > | operator> (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
const CwiseBinaryOp < std::greater_equal< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType, OtherDerived > | operator>= (const MatrixBase< OtherDerived > &other) const |
const CwiseUnaryOp < ei_scalar_pow_op< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType > | pow (const Scalar &exponent) const |
const CwiseUnaryOp < ei_scalar_sin_op< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType > | sin () const |
const CwiseUnaryOp < ei_scalar_sqrt_op< typename ei_traits< ExpressionType > ::Scalar >, ExpressionType > | sqrt () const |
const CwiseUnaryOp < ei_scalar_square_op < typename ei_traits < ExpressionType >::Scalar > , ExpressionType > | square () const |
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.
Note that some methods are defined in the Array module.
Example:
Vector3d v(-1,2,-3); cout << "the absolute values:" << endl << v.cwise().abs() << endl; cout << "the absolute values plus one:" << endl << v.cwise().abs().cwise()+1 << endl; cout << "sum of the squares: " << v.cwise().square().sum() << endl;
Output:
the absolute values: 1 2 3 the absolute values plus one: 2 3 4 sum of the squares: 14
const CwiseUnaryOp< ei_scalar_abs_op< typename ei_traits< ExpressionType >::Scalar >, ExpressionType > abs | ( | ) | const [inline] |
const CwiseUnaryOp< ei_scalar_abs2_op< typename ei_traits< ExpressionType >::Scalar >, ExpressionType > abs2 | ( | ) | const [inline] |
const CwiseUnaryOp< ei_scalar_cos_op< typename ei_traits< ExpressionType >::Scalar >, ExpressionType > cos | ( | ) | const [inline] |
const CwiseUnaryOp< ei_scalar_cube_op< typename ei_traits< ExpressionType >::Scalar >, ExpressionType > cube | ( | ) | const [inline] |
const CwiseUnaryOp< ei_scalar_exp_op< typename ei_traits< ExpressionType >::Scalar >, ExpressionType > exp | ( | ) | const [inline] |
const CwiseUnaryOp< ei_scalar_inverse_op< typename ei_traits< ExpressionType >::Scalar >, ExpressionType > inverse | ( | ) | const [inline] |
This is defined in the Array module.
#include <Eigen/Array>
Example:
Vector3d v(2,3,4); cout << v.cwise().inverse() << endl;
Output:
0.5 0.333 0.25
const CwiseUnaryOp< ei_scalar_log_op< typename ei_traits< ExpressionType >::Scalar >, ExpressionType > log | ( | ) | const [inline] |
const CwiseBinaryOp< ei_scalar_max_op< typename ei_traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > max | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
Example:
Vector3d v(2,3,4), w(4,2,3); cout << v.cwise().max(w) << endl;
Output:
4 3 4
const CwiseBinaryOp< ei_scalar_min_op< typename ei_traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > min | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
Example:
Vector3d v(2,3,4), w(4,2,3); cout << v.cwise().min(w) << endl;
Output:
2 2 3
const CwiseBinaryOp< std::not_equal_to< typename ei_traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > operator!= | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
This is defined in the Array module.
#include <Eigen/Array>
Example:
Vector3d v(1,2,3), w(3,2,1); cout << (v.cwise()!=w) << endl;
Output:
1 0 1
const EIGEN_CWISE_PRODUCT_RETURN_TYPE operator* | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
Example:
Matrix3i a = Matrix3i::Random(), b = Matrix3i::Random(); Matrix3i c = a.cwise() * b; cout << "a:\n" << a << "\nb:\n" << b << "\nc:\n" << c << endl;
Output:
a: 7 6 -3 -2 9 6 6 -6 -5 b: 1 -3 9 0 0 3 3 9 5 c: 7 -18 -27 0 0 18 18 -54 -25
ExpressionType & operator*= | ( | const MatrixBase< OtherDerived > & | other | ) | [inline] |
Replaces this expression by its coefficient-wise product with other.
Example:
Output:
2 6 0
const Cwise< ExpressionType >::ScalarAddReturnType operator+ | ( | const Scalar & | scalar | ) | const [inline] |
This is defined in the Array module.
#include <Eigen/Array>
*this
with each coeff incremented by the constant scalar Example:
Vector3d v(1,2,3); cout << v.cwise()+5 << endl;
Output:
6 7 8
ExpressionType & operator+= | ( | const Scalar & | scalar | ) | [inline] |
This is defined in the Array module.
#include <Eigen/Array>
Adds the given scalar to each coeff of this expression.
Example:
Vector3d v(1,2,3); v.cwise() += 5; cout << v << endl;
Output:
6 7 8
const Cwise< ExpressionType >::ScalarAddReturnType operator- | ( | const Scalar & | scalar | ) | const [inline] |
This is defined in the Array module.
#include <Eigen/Array>
*this
with each coeff decremented by the constant scalar Example:
Vector3d v(1,2,3); cout << v.cwise()-5 << endl;
Output:
-4 -3 -2
ExpressionType & operator-= | ( | const Scalar & | scalar | ) | [inline] |
This is defined in the Array module.
#include <Eigen/Array>
Substracts the given scalar from each coeff of this expression.
Example:
Vector3d v(1,2,3); v.cwise() -= 5; cout << v << endl;
Output:
-4 -3 -2
const CwiseBinaryOp< ei_scalar_quotient_op< typename ei_traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > operator/ | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
Example:
Vector3d v(2,3,4), w(4,2,3); cout << v.cwise()/w << endl;
Output:
0.5 1.5 1.33
ExpressionType & operator/= | ( | const MatrixBase< OtherDerived > & | other | ) | [inline] |
Replaces this expression by its coefficient-wise quotient by other.
Example:
Output:
0.6 0.5 2
const CwiseBinaryOp< std::less< typename ei_traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > operator< | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
This is defined in the Array module.
#include <Eigen/Array>
Example:
Vector3d v(1,2,3), w(3,2,1); cout << (v.cwise()<w) << endl;
Output:
1 0 0
const CwiseBinaryOp< std::less_equal< typename ei_traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > operator<= | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
This is defined in the Array module.
#include <Eigen/Array>
Example:
Vector3d v(1,2,3), w(3,2,1); cout << (v.cwise()<=w) << endl;
Output:
1 1 0
const CwiseBinaryOp< std::equal_to< typename ei_traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > operator== | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
This is defined in the Array module.
#include <Eigen/Array>
Example:
Vector3d v(1,2,3), w(3,2,1); cout << (v.cwise()==w) << endl;
Output:
0 1 0
const CwiseBinaryOp< std::greater< typename ei_traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > operator> | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
This is defined in the Array module.
#include <Eigen/Array>
Example:
Vector3d v(1,2,3), w(3,2,1); cout << (v.cwise()>w) << endl;
Output:
0 0 1
const CwiseBinaryOp< std::greater_equal< typename ei_traits< ExpressionType >::Scalar >, ExpressionType, OtherDerived > operator>= | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
This is defined in the Array module.
#include <Eigen/Array>
Example:
Vector3d v(1,2,3), w(3,2,1); cout << (v.cwise()>=w) << endl;
Output:
0 1 1
const CwiseUnaryOp< ei_scalar_pow_op< typename ei_traits< ExpressionType >::Scalar >, ExpressionType > pow | ( | const Scalar & | exponent | ) | const [inline] |
const CwiseUnaryOp< ei_scalar_sin_op< typename ei_traits< ExpressionType >::Scalar >, ExpressionType > sin | ( | ) | const [inline] |
const CwiseUnaryOp< ei_scalar_sqrt_op< typename ei_traits< ExpressionType >::Scalar >, ExpressionType > sqrt | ( | ) | const [inline] |
const CwiseUnaryOp< ei_scalar_square_op< typename ei_traits< ExpressionType >::Scalar >, ExpressionType > square | ( | ) | const [inline] |
This is defined in the Array module.
#include <Eigen/Array>
Example:
Vector3d v(2,3,4); cout << v.cwise().square() << endl;
Output:
4 9 16
const ScalarAddReturnType operator+ | ( | const Scalar & | scalar, | |
const Cwise< ExpressionType > & | mat | |||
) | [friend] |