diff options
Diffstat (limited to 'Eigen/src/Eigen2Support')
-rw-r--r-- | Eigen/src/Eigen2Support/Block.h | 8 | ||||
-rw-r--r-- | Eigen/src/Eigen2Support/Cwise.h | 40 | ||||
-rw-r--r-- | Eigen/src/Eigen2Support/CwiseOperators.h | 38 | ||||
-rw-r--r-- | Eigen/src/Eigen2Support/Minor.h | 13 |
4 files changed, 51 insertions, 48 deletions
diff --git a/Eigen/src/Eigen2Support/Block.h b/Eigen/src/Eigen2Support/Block.h index ba0e39650..bc28051e0 100644 --- a/Eigen/src/Eigen2Support/Block.h +++ b/Eigen/src/Eigen2Support/Block.h @@ -49,7 +49,7 @@ inline Block<Derived> DenseBase<Derived> switch(type) { default: - ei_assert(false && "Bad corner type."); + eigen_assert(false && "Bad corner type."); case TopLeft: return Block<Derived>(derived(), 0, 0, cRows, cCols); case TopRight: @@ -69,7 +69,7 @@ DenseBase<Derived>::corner(CornerType type, Index cRows, Index cCols) const switch(type) { default: - ei_assert(false && "Bad corner type."); + eigen_assert(false && "Bad corner type."); case TopLeft: return Block<Derived>(derived(), 0, 0, cRows, cCols); case TopRight: @@ -101,7 +101,7 @@ DenseBase<Derived>::corner(CornerType type) switch(type) { default: - ei_assert(false && "Bad corner type."); + eigen_assert(false && "Bad corner type."); case TopLeft: return Block<Derived, CRows, CCols>(derived(), 0, 0); case TopRight: @@ -122,7 +122,7 @@ DenseBase<Derived>::corner(CornerType type) const switch(type) { default: - ei_assert(false && "Bad corner type."); + eigen_assert(false && "Bad corner type."); case TopLeft: return Block<Derived, CRows, CCols>(derived(), 0, 0); case TopRight: diff --git a/Eigen/src/Eigen2Support/Cwise.h b/Eigen/src/Eigen2Support/Cwise.h index 1489f8f79..74fa63aaa 100644 --- a/Eigen/src/Eigen2Support/Cwise.h +++ b/Eigen/src/Eigen2Support/Cwise.h @@ -29,17 +29,17 @@ /** \internal * convenient macro to defined the return type of a cwise binary operation */ #define EIGEN_CWISE_BINOP_RETURN_TYPE(OP) \ - CwiseBinaryOp<OP<typename ei_traits<ExpressionType>::Scalar>, ExpressionType, OtherDerived> + CwiseBinaryOp<OP<typename internal::traits<ExpressionType>::Scalar>, ExpressionType, OtherDerived> /** \internal * convenient macro to defined the return type of a cwise unary operation */ #define EIGEN_CWISE_UNOP_RETURN_TYPE(OP) \ - CwiseUnaryOp<OP<typename ei_traits<ExpressionType>::Scalar>, ExpressionType> + CwiseUnaryOp<OP<typename internal::traits<ExpressionType>::Scalar>, ExpressionType> /** \internal * convenient macro to defined the return type of a cwise comparison to a scalar */ #define EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(OP) \ - CwiseBinaryOp<OP<typename ei_traits<ExpressionType>::Scalar>, ExpressionType, \ + CwiseBinaryOp<OP<typename internal::traits<ExpressionType>::Scalar>, ExpressionType, \ typename ExpressionType::ConstantReturnType > /** \class Cwise @@ -61,10 +61,10 @@ template<typename ExpressionType> class Cwise { public: - typedef typename ei_traits<ExpressionType>::Scalar Scalar; - typedef typename ei_meta_if<ei_must_nest_by_value<ExpressionType>::ret, + typedef typename internal::traits<ExpressionType>::Scalar Scalar; + typedef typename internal::meta_if<internal::must_nest_by_value<ExpressionType>::ret, ExpressionType, const ExpressionType&>::ret ExpressionTypeNested; - typedef CwiseUnaryOp<ei_scalar_add_op<Scalar>, ExpressionType> ScalarAddReturnType; + typedef CwiseUnaryOp<internal::scalar_add_op<Scalar>, ExpressionType> ScalarAddReturnType; inline Cwise(const ExpressionType& matrix) : m_matrix(matrix) {} @@ -76,28 +76,28 @@ template<typename ExpressionType> class Cwise operator*(const MatrixBase<OtherDerived> &other) const; template<typename OtherDerived> - const EIGEN_CWISE_BINOP_RETURN_TYPE(ei_scalar_quotient_op) + 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(ei_scalar_min_op) + 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(ei_scalar_max_op) + const EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_max_op) max(const MatrixBase<OtherDerived> &other) const; - const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_abs_op) abs() const; - const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_abs2_op) abs2() const; - const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_square_op) square() const; - const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_cube_op) cube() const; - const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_inverse_op) inverse() const; - const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_sqrt_op) sqrt() const; - const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_exp_op) exp() const; - const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_log_op) log() const; - const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_cos_op) cos() const; - const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_sin_op) sin() const; - const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_pow_op) pow(const Scalar& exponent) 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; const ScalarAddReturnType operator+(const Scalar& scalar) const; diff --git a/Eigen/src/Eigen2Support/CwiseOperators.h b/Eigen/src/Eigen2Support/CwiseOperators.h index 74feee4a0..0c7e9db6d 100644 --- a/Eigen/src/Eigen2Support/CwiseOperators.h +++ b/Eigen/src/Eigen2Support/CwiseOperators.h @@ -32,7 +32,7 @@ /** \deprecated ArrayBase::abs() */ template<typename ExpressionType> -EIGEN_STRONG_INLINE const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_abs_op) +EIGEN_STRONG_INLINE const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_abs_op) Cwise<ExpressionType>::abs() const { return _expression(); @@ -40,7 +40,7 @@ Cwise<ExpressionType>::abs() const /** \deprecated ArrayBase::abs2() */ template<typename ExpressionType> -EIGEN_STRONG_INLINE const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_abs2_op) +EIGEN_STRONG_INLINE const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_abs2_op) Cwise<ExpressionType>::abs2() const { return _expression(); @@ -48,7 +48,7 @@ Cwise<ExpressionType>::abs2() const /** \deprecated ArrayBase::exp() */ template<typename ExpressionType> -inline const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_exp_op) +inline const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_exp_op) Cwise<ExpressionType>::exp() const { return _expression(); @@ -56,7 +56,7 @@ Cwise<ExpressionType>::exp() const /** \deprecated ArrayBase::log() */ template<typename ExpressionType> -inline const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_log_op) +inline const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_log_op) Cwise<ExpressionType>::log() const { return _expression(); @@ -74,10 +74,10 @@ Cwise<ExpressionType>::operator*(const MatrixBase<OtherDerived> &other) const /** \deprecated ArrayBase::operator/() */ template<typename ExpressionType> template<typename OtherDerived> -EIGEN_STRONG_INLINE const EIGEN_CWISE_BINOP_RETURN_TYPE(ei_scalar_quotient_op) +EIGEN_STRONG_INLINE const EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_quotient_op) Cwise<ExpressionType>::operator/(const MatrixBase<OtherDerived> &other) const { - return EIGEN_CWISE_BINOP_RETURN_TYPE(ei_scalar_quotient_op)(_expression(), other.derived()); + return EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_quotient_op)(_expression(), other.derived()); } /** \deprecated ArrayBase::operator*=() */ @@ -99,19 +99,19 @@ inline ExpressionType& Cwise<ExpressionType>::operator/=(const MatrixBase<OtherD /** \deprecated ArrayBase::min() */ template<typename ExpressionType> template<typename OtherDerived> -EIGEN_STRONG_INLINE const EIGEN_CWISE_BINOP_RETURN_TYPE(ei_scalar_min_op) +EIGEN_STRONG_INLINE const EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_min_op) Cwise<ExpressionType>::min(const MatrixBase<OtherDerived> &other) const { - return EIGEN_CWISE_BINOP_RETURN_TYPE(ei_scalar_min_op)(_expression(), other.derived()); + return EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_min_op)(_expression(), other.derived()); } /** \deprecated ArrayBase::max() */ template<typename ExpressionType> template<typename OtherDerived> -EIGEN_STRONG_INLINE const EIGEN_CWISE_BINOP_RETURN_TYPE(ei_scalar_max_op) +EIGEN_STRONG_INLINE const EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_max_op) Cwise<ExpressionType>::max(const MatrixBase<OtherDerived> &other) const { - return EIGEN_CWISE_BINOP_RETURN_TYPE(ei_scalar_max_op)(_expression(), other.derived()); + return EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_max_op)(_expression(), other.derived()); } /*************************************************************************** @@ -122,7 +122,7 @@ Cwise<ExpressionType>::max(const MatrixBase<OtherDerived> &other) const /** \deprecated ArrayBase::sqrt() */ template<typename ExpressionType> -inline const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_sqrt_op) +inline const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_sqrt_op) Cwise<ExpressionType>::sqrt() const { return _expression(); @@ -130,7 +130,7 @@ Cwise<ExpressionType>::sqrt() const /** \deprecated ArrayBase::cos() */ template<typename ExpressionType> -inline const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_cos_op) +inline const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_cos_op) Cwise<ExpressionType>::cos() const { return _expression(); @@ -139,7 +139,7 @@ Cwise<ExpressionType>::cos() const /** \deprecated ArrayBase::sin() */ template<typename ExpressionType> -inline const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_sin_op) +inline const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_sin_op) Cwise<ExpressionType>::sin() const { return _expression(); @@ -148,16 +148,16 @@ Cwise<ExpressionType>::sin() const /** \deprecated ArrayBase::log() */ template<typename ExpressionType> -inline const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_pow_op) +inline const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_pow_op) Cwise<ExpressionType>::pow(const Scalar& exponent) const { - return EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_pow_op)(_expression(), ei_scalar_pow_op<Scalar>(exponent)); + return EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_pow_op)(_expression(), internal::scalar_pow_op<Scalar>(exponent)); } /** \deprecated ArrayBase::inverse() */ template<typename ExpressionType> -inline const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_inverse_op) +inline const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_inverse_op) Cwise<ExpressionType>::inverse() const { return _expression(); @@ -165,7 +165,7 @@ Cwise<ExpressionType>::inverse() const /** \deprecated ArrayBase::square() */ template<typename ExpressionType> -inline const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_square_op) +inline const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_square_op) Cwise<ExpressionType>::square() const { return _expression(); @@ -173,7 +173,7 @@ Cwise<ExpressionType>::square() const /** \deprecated ArrayBase::cube() */ template<typename ExpressionType> -inline const EIGEN_CWISE_UNOP_RETURN_TYPE(ei_scalar_cube_op) +inline const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_cube_op) Cwise<ExpressionType>::cube() const { return _expression(); @@ -299,7 +299,7 @@ template<typename ExpressionType> inline const typename Cwise<ExpressionType>::ScalarAddReturnType Cwise<ExpressionType>::operator+(const Scalar& scalar) const { - return typename Cwise<ExpressionType>::ScalarAddReturnType(m_matrix, ei_scalar_add_op<Scalar>(scalar)); + return typename Cwise<ExpressionType>::ScalarAddReturnType(m_matrix, internal::scalar_add_op<Scalar>(scalar)); } /** \deprecated ArrayBase::operator+=(Scalar) */ diff --git a/Eigen/src/Eigen2Support/Minor.h b/Eigen/src/Eigen2Support/Minor.h index 555d1d7f5..a058ac1e0 100644 --- a/Eigen/src/Eigen2Support/Minor.h +++ b/Eigen/src/Eigen2Support/Minor.h @@ -38,12 +38,14 @@ * * \sa MatrixBase::minor() */ + +namespace internal { template<typename MatrixType> -struct ei_traits<Minor<MatrixType> > - : ei_traits<MatrixType> +struct traits<Minor<MatrixType> > + : traits<MatrixType> { - typedef typename ei_nested<MatrixType>::type MatrixTypeNested; - typedef typename ei_unref<MatrixTypeNested>::type _MatrixTypeNested; + typedef typename nested<MatrixType>::type MatrixTypeNested; + typedef typename unref<MatrixTypeNested>::type _MatrixTypeNested; typedef typename MatrixType::StorageKind StorageKind; enum { RowsAtCompileTime = (MatrixType::RowsAtCompileTime != Dynamic) ? @@ -59,6 +61,7 @@ struct ei_traits<Minor<MatrixType> > // where loops are unrolled and the 'if' evaluates at compile time }; }; +} template<typename MatrixType> class Minor : public MatrixBase<Minor<MatrixType> > @@ -72,7 +75,7 @@ template<typename MatrixType> class Minor Index row, Index col) : m_matrix(matrix), m_row(row), m_col(col) { - ei_assert(row >= 0 && row < matrix.rows() + eigen_assert(row >= 0 && row < matrix.rows() && col >= 0 && col < matrix.cols()); } |