merge with default branch

This commit is contained in:
Gael Guennebaud
2013-11-05 10:31:59 +01:00
66 changed files with 1152 additions and 290 deletions

View File

@@ -3,6 +3,7 @@
* \sa MatrixBase::cwiseProduct
*/
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const EIGEN_CWISE_PRODUCT_RETURN_TYPE(Derived,OtherDerived)
operator*(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
{
@@ -14,6 +15,7 @@ operator*(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
* \sa MatrixBase::cwiseQuotient
*/
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const Derived, const OtherDerived>
operator/(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
{
@@ -33,6 +35,7 @@ EIGEN_MAKE_CWISE_BINARY_OP(min,internal::scalar_min_op)
*
* \sa max()
*/
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_min_op<Scalar>, const Derived,
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> >
#ifdef EIGEN_PARSED_BY_DOXYGEN
@@ -58,6 +61,7 @@ EIGEN_MAKE_CWISE_BINARY_OP(max,internal::scalar_max_op)
*
* \sa min()
*/
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_max_op<Scalar>, const Derived,
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> >
#ifdef EIGEN_PARSED_BY_DOXYGEN
@@ -143,12 +147,14 @@ EIGEN_MAKE_CWISE_BINARY_OP(operator!=,std::not_equal_to)
*
* \sa operator+=(), operator-()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Derived>
operator+(const Scalar& scalar) const
{
return CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Derived>(derived(), internal::scalar_add_op<Scalar>(scalar));
}
EIGEN_DEVICE_FUNC
friend inline const CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Derived>
operator+(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>& other)
{
@@ -162,12 +168,14 @@ operator+(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>&
*
* \sa operator+(), operator-=()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_sub_op<Scalar>, const Derived>
operator-(const Scalar& scalar) const
{
return CwiseUnaryOp<internal::scalar_sub_op<Scalar>, const Derived>(derived(), internal::scalar_sub_op<Scalar>(scalar));;
}
EIGEN_DEVICE_FUNC
friend inline const CwiseUnaryOp<internal::scalar_rsub_op<Scalar>, const Derived>
operator-(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>& other)
{
@@ -184,6 +192,7 @@ operator-(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>&
* \sa operator||(), select()
*/
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
inline const CwiseBinaryOp<internal::scalar_boolean_and_op, const Derived, const OtherDerived>
operator&&(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
{
@@ -202,6 +211,7 @@ operator&&(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
* \sa operator&&(), select()
*/
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
inline const CwiseBinaryOp<internal::scalar_boolean_or_op, const Derived, const OtherDerived>
operator||(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
{
@@ -209,3 +219,4 @@ operator||(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
THIS_METHOD_IS_ONLY_FOR_EXPRESSIONS_OF_BOOL);
return CwiseBinaryOp<internal::scalar_boolean_or_op, const Derived, const OtherDerived>(derived(),other.derived());
}

View File

@@ -7,6 +7,7 @@
*
* \sa abs2()
*/
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const CwiseUnaryOp<internal::scalar_abs_op<Scalar>, const Derived>
abs() const
{
@@ -20,6 +21,7 @@ abs() const
*
* \sa abs(), square()
*/
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, const Derived>
abs2() const
{
@@ -33,6 +35,7 @@ abs2() const
*
* \sa pow(), log(), sin(), cos()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_exp_op<Scalar>, const Derived>
exp() const
{
@@ -46,6 +49,7 @@ exp() const
*
* \sa exp()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_log_op<Scalar>, const Derived>
log() const
{
@@ -59,6 +63,7 @@ log() const
*
* \sa pow(), square()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_sqrt_op<Scalar>, const Derived>
sqrt() const
{
@@ -72,6 +77,7 @@ sqrt() const
*
* \sa sin(), acos()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_cos_op<Scalar>, const Derived>
cos() const
{
@@ -86,6 +92,7 @@ cos() const
*
* \sa cos(), asin()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_sin_op<Scalar>, const Derived>
sin() const
{
@@ -99,6 +106,7 @@ sin() const
*
* \sa cos(), asin()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_acos_op<Scalar>, const Derived>
acos() const
{
@@ -112,6 +120,7 @@ acos() const
*
* \sa sin(), acos()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_asin_op<Scalar>, const Derived>
asin() const
{
@@ -125,6 +134,7 @@ asin() const
*
* \sa cos(), sin()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_tan_op<Scalar>, Derived>
tan() const
{
@@ -139,6 +149,7 @@ tan() const
*
* \sa exp(), log()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_pow_op<Scalar>, const Derived>
pow(const Scalar& exponent) const
{
@@ -154,6 +165,7 @@ pow(const Scalar& exponent) const
*
* \sa operator/(), operator*()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_inverse_op<Scalar>, const Derived>
inverse() const
{
@@ -167,6 +179,7 @@ inverse() const
*
* \sa operator/(), operator*(), abs2()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_square_op<Scalar>, const Derived>
square() const
{
@@ -180,6 +193,7 @@ square() const
*
* \sa square(), pow()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_cube_op<Scalar>, const Derived>
cube() const
{
@@ -187,6 +201,7 @@ cube() const
}
#define EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(METHOD_NAME,FUNCTOR) \
EIGEN_DEVICE_FUNC \
inline const CwiseUnaryOp<std::binder2nd<FUNCTOR<Scalar> >, const Derived> \
METHOD_NAME(const Scalar& s) const { \
return CwiseUnaryOp<std::binder2nd<FUNCTOR<Scalar> >, const Derived> \

View File

@@ -53,12 +53,14 @@ template<int Size> struct ConstFixedSegmentReturnType { typedef const VectorBloc
*
* \sa class Block, block(Index,Index)
*/
EIGEN_DEVICE_FUNC
inline Block<Derived> block(Index startRow, Index startCol, Index blockRows, Index blockCols)
{
return Block<Derived>(derived(), startRow, startCol, blockRows, blockCols);
}
/** This is the const version of block(Index,Index,Index,Index). */
EIGEN_DEVICE_FUNC
inline const Block<const Derived> block(Index startRow, Index startCol, Index blockRows, Index blockCols) const
{
return Block<const Derived>(derived(), startRow, startCol, blockRows, blockCols);
@@ -77,12 +79,14 @@ inline const Block<const Derived> block(Index startRow, Index startCol, Index bl
*
* \sa class Block, block(Index,Index,Index,Index)
*/
EIGEN_DEVICE_FUNC
inline Block<Derived> topRightCorner(Index cRows, Index cCols)
{
return Block<Derived>(derived(), 0, cols() - cCols, cRows, cCols);
}
/** This is the const version of topRightCorner(Index, Index).*/
EIGEN_DEVICE_FUNC
inline const Block<const Derived> topRightCorner(Index cRows, Index cCols) const
{
return Block<const Derived>(derived(), 0, cols() - cCols, cRows, cCols);
@@ -99,6 +103,7 @@ inline const Block<const Derived> topRightCorner(Index cRows, Index cCols) const
* \sa class Block, block<int,int>(Index,Index)
*/
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC
inline Block<Derived, CRows, CCols> topRightCorner()
{
return Block<Derived, CRows, CCols>(derived(), 0, cols() - CCols);
@@ -106,6 +111,7 @@ inline Block<Derived, CRows, CCols> topRightCorner()
/** This is the const version of topRightCorner<int, int>().*/
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC
inline const Block<const Derived, CRows, CCols> topRightCorner() const
{
return Block<const Derived, CRows, CCols>(derived(), 0, cols() - CCols);
@@ -153,12 +159,14 @@ inline const Block<const Derived, CRows, CCols> topRightCorner(Index cRows, Inde
*
* \sa class Block, block(Index,Index,Index,Index)
*/
EIGEN_DEVICE_FUNC
inline Block<Derived> topLeftCorner(Index cRows, Index cCols)
{
return Block<Derived>(derived(), 0, 0, cRows, cCols);
}
/** This is the const version of topLeftCorner(Index, Index).*/
EIGEN_DEVICE_FUNC
inline const Block<const Derived> topLeftCorner(Index cRows, Index cCols) const
{
return Block<const Derived>(derived(), 0, 0, cRows, cCols);
@@ -174,6 +182,7 @@ inline const Block<const Derived> topLeftCorner(Index cRows, Index cCols) const
* \sa class Block, block(Index,Index,Index,Index)
*/
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC
inline Block<Derived, CRows, CCols> topLeftCorner()
{
return Block<Derived, CRows, CCols>(derived(), 0, 0);
@@ -181,6 +190,7 @@ inline Block<Derived, CRows, CCols> topLeftCorner()
/** This is the const version of topLeftCorner<int, int>().*/
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC
inline const Block<const Derived, CRows, CCols> topLeftCorner() const
{
return Block<const Derived, CRows, CCols>(derived(), 0, 0);
@@ -228,12 +238,14 @@ inline const Block<const Derived, CRows, CCols> topLeftCorner(Index cRows, Index
*
* \sa class Block, block(Index,Index,Index,Index)
*/
EIGEN_DEVICE_FUNC
inline Block<Derived> bottomRightCorner(Index cRows, Index cCols)
{
return Block<Derived>(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
}
/** This is the const version of bottomRightCorner(Index, Index).*/
EIGEN_DEVICE_FUNC
inline const Block<const Derived> bottomRightCorner(Index cRows, Index cCols) const
{
return Block<const Derived>(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
@@ -249,6 +261,7 @@ inline const Block<const Derived> bottomRightCorner(Index cRows, Index cCols) co
* \sa class Block, block(Index,Index,Index,Index)
*/
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC
inline Block<Derived, CRows, CCols> bottomRightCorner()
{
return Block<Derived, CRows, CCols>(derived(), rows() - CRows, cols() - CCols);
@@ -256,6 +269,7 @@ inline Block<Derived, CRows, CCols> bottomRightCorner()
/** This is the const version of bottomRightCorner<int, int>().*/
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC
inline const Block<const Derived, CRows, CCols> bottomRightCorner() const
{
return Block<const Derived, CRows, CCols>(derived(), rows() - CRows, cols() - CCols);
@@ -303,12 +317,14 @@ inline const Block<const Derived, CRows, CCols> bottomRightCorner(Index cRows, I
*
* \sa class Block, block(Index,Index,Index,Index)
*/
EIGEN_DEVICE_FUNC
inline Block<Derived> bottomLeftCorner(Index cRows, Index cCols)
{
return Block<Derived>(derived(), rows() - cRows, 0, cRows, cCols);
}
/** This is the const version of bottomLeftCorner(Index, Index).*/
EIGEN_DEVICE_FUNC
inline const Block<const Derived> bottomLeftCorner(Index cRows, Index cCols) const
{
return Block<const Derived>(derived(), rows() - cRows, 0, cRows, cCols);
@@ -324,6 +340,7 @@ inline const Block<const Derived> bottomLeftCorner(Index cRows, Index cCols) con
* \sa class Block, block(Index,Index,Index,Index)
*/
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC
inline Block<Derived, CRows, CCols> bottomLeftCorner()
{
return Block<Derived, CRows, CCols>(derived(), rows() - CRows, 0);
@@ -331,6 +348,7 @@ inline Block<Derived, CRows, CCols> bottomLeftCorner()
/** This is the const version of bottomLeftCorner<int, int>().*/
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC
inline const Block<const Derived, CRows, CCols> bottomLeftCorner() const
{
return Block<const Derived, CRows, CCols>(derived(), rows() - CRows, 0);
@@ -377,12 +395,14 @@ inline const Block<const Derived, CRows, CCols> bottomLeftCorner(Index cRows, In
*
* \sa class Block, block(Index,Index,Index,Index)
*/
EIGEN_DEVICE_FUNC
inline RowsBlockXpr topRows(Index n)
{
return RowsBlockXpr(derived(), 0, 0, n, cols());
}
/** This is the const version of topRows(Index).*/
EIGEN_DEVICE_FUNC
inline ConstRowsBlockXpr topRows(Index n) const
{
return ConstRowsBlockXpr(derived(), 0, 0, n, cols());
@@ -398,6 +418,7 @@ inline ConstRowsBlockXpr topRows(Index n) const
* \sa class Block, block(Index,Index,Index,Index)
*/
template<int N>
EIGEN_DEVICE_FUNC
inline typename NRowsBlockXpr<N>::Type topRows()
{
return typename NRowsBlockXpr<N>::Type(derived(), 0, 0, N, cols());
@@ -405,6 +426,7 @@ inline typename NRowsBlockXpr<N>::Type topRows()
/** This is the const version of topRows<int>().*/
template<int N>
EIGEN_DEVICE_FUNC
inline typename ConstNRowsBlockXpr<N>::Type topRows() const
{
return typename ConstNRowsBlockXpr<N>::Type(derived(), 0, 0, N, cols());
@@ -421,12 +443,14 @@ inline typename ConstNRowsBlockXpr<N>::Type topRows() const
*
* \sa class Block, block(Index,Index,Index,Index)
*/
EIGEN_DEVICE_FUNC
inline RowsBlockXpr bottomRows(Index n)
{
return RowsBlockXpr(derived(), rows() - n, 0, n, cols());
}
/** This is the const version of bottomRows(Index).*/
EIGEN_DEVICE_FUNC
inline ConstRowsBlockXpr bottomRows(Index n) const
{
return ConstRowsBlockXpr(derived(), rows() - n, 0, n, cols());
@@ -442,6 +466,7 @@ inline ConstRowsBlockXpr bottomRows(Index n) const
* \sa class Block, block(Index,Index,Index,Index)
*/
template<int N>
EIGEN_DEVICE_FUNC
inline typename NRowsBlockXpr<N>::Type bottomRows()
{
return typename NRowsBlockXpr<N>::Type(derived(), rows() - N, 0, N, cols());
@@ -449,6 +474,7 @@ inline typename NRowsBlockXpr<N>::Type bottomRows()
/** This is the const version of bottomRows<int>().*/
template<int N>
EIGEN_DEVICE_FUNC
inline typename ConstNRowsBlockXpr<N>::Type bottomRows() const
{
return typename ConstNRowsBlockXpr<N>::Type(derived(), rows() - N, 0, N, cols());
@@ -466,12 +492,14 @@ inline typename ConstNRowsBlockXpr<N>::Type bottomRows() const
*
* \sa class Block, block(Index,Index,Index,Index)
*/
EIGEN_DEVICE_FUNC
inline RowsBlockXpr middleRows(Index startRow, Index numRows)
{
return RowsBlockXpr(derived(), startRow, 0, numRows, cols());
}
/** This is the const version of middleRows(Index,Index).*/
EIGEN_DEVICE_FUNC
inline ConstRowsBlockXpr middleRows(Index startRow, Index numRows) const
{
return ConstRowsBlockXpr(derived(), startRow, 0, numRows, cols());
@@ -488,6 +516,7 @@ inline ConstRowsBlockXpr middleRows(Index startRow, Index numRows) const
* \sa class Block, block(Index,Index,Index,Index)
*/
template<int N>
EIGEN_DEVICE_FUNC
inline typename NRowsBlockXpr<N>::Type middleRows(Index startRow)
{
return typename NRowsBlockXpr<N>::Type(derived(), startRow, 0, N, cols());
@@ -495,6 +524,7 @@ inline typename NRowsBlockXpr<N>::Type middleRows(Index startRow)
/** This is the const version of middleRows<int>().*/
template<int N>
EIGEN_DEVICE_FUNC
inline typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow) const
{
return typename ConstNRowsBlockXpr<N>::Type(derived(), startRow, 0, N, cols());
@@ -511,12 +541,14 @@ inline typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow) const
*
* \sa class Block, block(Index,Index,Index,Index)
*/
EIGEN_DEVICE_FUNC
inline ColsBlockXpr leftCols(Index n)
{
return ColsBlockXpr(derived(), 0, 0, rows(), n);
}
/** This is the const version of leftCols(Index).*/
EIGEN_DEVICE_FUNC
inline ConstColsBlockXpr leftCols(Index n) const
{
return ConstColsBlockXpr(derived(), 0, 0, rows(), n);
@@ -532,6 +564,7 @@ inline ConstColsBlockXpr leftCols(Index n) const
* \sa class Block, block(Index,Index,Index,Index)
*/
template<int N>
EIGEN_DEVICE_FUNC
inline typename NColsBlockXpr<N>::Type leftCols()
{
return typename NColsBlockXpr<N>::Type(derived(), 0, 0, rows(), N);
@@ -539,6 +572,7 @@ inline typename NColsBlockXpr<N>::Type leftCols()
/** This is the const version of leftCols<int>().*/
template<int N>
EIGEN_DEVICE_FUNC
inline typename ConstNColsBlockXpr<N>::Type leftCols() const
{
return typename ConstNColsBlockXpr<N>::Type(derived(), 0, 0, rows(), N);
@@ -555,12 +589,14 @@ inline typename ConstNColsBlockXpr<N>::Type leftCols() const
*
* \sa class Block, block(Index,Index,Index,Index)
*/
EIGEN_DEVICE_FUNC
inline ColsBlockXpr rightCols(Index n)
{
return ColsBlockXpr(derived(), 0, cols() - n, rows(), n);
}
/** This is the const version of rightCols(Index).*/
EIGEN_DEVICE_FUNC
inline ConstColsBlockXpr rightCols(Index n) const
{
return ConstColsBlockXpr(derived(), 0, cols() - n, rows(), n);
@@ -576,6 +612,7 @@ inline ConstColsBlockXpr rightCols(Index n) const
* \sa class Block, block(Index,Index,Index,Index)
*/
template<int N>
EIGEN_DEVICE_FUNC
inline typename NColsBlockXpr<N>::Type rightCols()
{
return typename NColsBlockXpr<N>::Type(derived(), 0, cols() - N, rows(), N);
@@ -583,6 +620,7 @@ inline typename NColsBlockXpr<N>::Type rightCols()
/** This is the const version of rightCols<int>().*/
template<int N>
EIGEN_DEVICE_FUNC
inline typename ConstNColsBlockXpr<N>::Type rightCols() const
{
return typename ConstNColsBlockXpr<N>::Type(derived(), 0, cols() - N, rows(), N);
@@ -600,12 +638,14 @@ inline typename ConstNColsBlockXpr<N>::Type rightCols() const
*
* \sa class Block, block(Index,Index,Index,Index)
*/
EIGEN_DEVICE_FUNC
inline ColsBlockXpr middleCols(Index startCol, Index numCols)
{
return ColsBlockXpr(derived(), 0, startCol, rows(), numCols);
}
/** This is the const version of middleCols(Index,Index).*/
EIGEN_DEVICE_FUNC
inline ConstColsBlockXpr middleCols(Index startCol, Index numCols) const
{
return ConstColsBlockXpr(derived(), 0, startCol, rows(), numCols);
@@ -622,6 +662,7 @@ inline ConstColsBlockXpr middleCols(Index startCol, Index numCols) const
* \sa class Block, block(Index,Index,Index,Index)
*/
template<int N>
EIGEN_DEVICE_FUNC
inline typename NColsBlockXpr<N>::Type middleCols(Index startCol)
{
return typename NColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), N);
@@ -629,6 +670,7 @@ inline typename NColsBlockXpr<N>::Type middleCols(Index startCol)
/** This is the const version of middleCols<int>().*/
template<int N>
EIGEN_DEVICE_FUNC
inline typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol) const
{
return typename ConstNColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), N);
@@ -653,6 +695,7 @@ inline typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol) const
* \sa class Block, block(Index,Index,Index,Index)
*/
template<int BlockRows, int BlockCols>
EIGEN_DEVICE_FUNC
inline Block<Derived, BlockRows, BlockCols> block(Index startRow, Index startCol)
{
return Block<Derived, BlockRows, BlockCols>(derived(), startRow, startCol);
@@ -660,6 +703,7 @@ inline Block<Derived, BlockRows, BlockCols> block(Index startRow, Index startCol
/** This is the const version of block<>(Index, Index). */
template<int BlockRows, int BlockCols>
EIGEN_DEVICE_FUNC
inline const Block<const Derived, BlockRows, BlockCols> block(Index startRow, Index startCol) const
{
return Block<const Derived, BlockRows, BlockCols>(derived(), startRow, startCol);
@@ -705,12 +749,14 @@ inline const Block<const Derived, BlockRows, BlockCols> block(Index startRow, In
* Output: \verbinclude MatrixBase_col.out
*
* \sa row(), class Block */
EIGEN_DEVICE_FUNC
inline ColXpr col(Index i)
{
return ColXpr(derived(), i);
}
/** This is the const version of col(). */
EIGEN_DEVICE_FUNC
inline ConstColXpr col(Index i) const
{
return ConstColXpr(derived(), i);
@@ -722,12 +768,14 @@ inline ConstColXpr col(Index i) const
* Output: \verbinclude MatrixBase_row.out
*
* \sa col(), class Block */
EIGEN_DEVICE_FUNC
inline RowXpr row(Index i)
{
return RowXpr(derived(), i);
}
/** This is the const version of row(). */
EIGEN_DEVICE_FUNC
inline ConstRowXpr row(Index i) const
{
return ConstRowXpr(derived(), i);
@@ -749,6 +797,7 @@ inline ConstRowXpr row(Index i) const
*
* \sa class Block, segment(Index)
*/
EIGEN_DEVICE_FUNC
inline SegmentReturnType segment(Index start, Index vecSize)
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
@@ -757,6 +806,7 @@ inline SegmentReturnType segment(Index start, Index vecSize)
/** This is the const version of segment(Index,Index).*/
EIGEN_DEVICE_FUNC
inline ConstSegmentReturnType segment(Index start, Index vecSize) const
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
@@ -778,6 +828,7 @@ inline ConstSegmentReturnType segment(Index start, Index vecSize) const
*
* \sa class Block, block(Index,Index)
*/
EIGEN_DEVICE_FUNC
inline SegmentReturnType head(Index vecSize)
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
@@ -785,6 +836,7 @@ inline SegmentReturnType head(Index vecSize)
}
/** This is the const version of head(Index).*/
EIGEN_DEVICE_FUNC
inline ConstSegmentReturnType
head(Index vecSize) const
{
@@ -807,6 +859,7 @@ inline ConstSegmentReturnType
*
* \sa class Block, block(Index,Index)
*/
EIGEN_DEVICE_FUNC
inline SegmentReturnType tail(Index vecSize)
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
@@ -814,6 +867,7 @@ inline SegmentReturnType tail(Index vecSize)
}
/** This is the const version of tail(Index).*/
EIGEN_DEVICE_FUNC
inline ConstSegmentReturnType tail(Index vecSize) const
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
@@ -834,6 +888,7 @@ inline ConstSegmentReturnType tail(Index vecSize) const
* \sa class Block
*/
template<int Size>
EIGEN_DEVICE_FUNC
inline typename FixedSegmentReturnType<Size>::Type segment(Index start)
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
@@ -842,6 +897,7 @@ inline typename FixedSegmentReturnType<Size>::Type segment(Index start)
/** This is the const version of segment<int>(Index).*/
template<int Size>
EIGEN_DEVICE_FUNC
inline typename ConstFixedSegmentReturnType<Size>::Type segment(Index start) const
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
@@ -860,6 +916,7 @@ inline typename ConstFixedSegmentReturnType<Size>::Type segment(Index start) con
* \sa class Block
*/
template<int Size>
EIGEN_DEVICE_FUNC
inline typename FixedSegmentReturnType<Size>::Type head()
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
@@ -868,6 +925,7 @@ inline typename FixedSegmentReturnType<Size>::Type head()
/** This is the const version of head<int>().*/
template<int Size>
EIGEN_DEVICE_FUNC
inline typename ConstFixedSegmentReturnType<Size>::Type head() const
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
@@ -886,6 +944,7 @@ inline typename ConstFixedSegmentReturnType<Size>::Type head() const
* \sa class Block
*/
template<int Size>
EIGEN_DEVICE_FUNC
inline typename FixedSegmentReturnType<Size>::Type tail()
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
@@ -894,6 +953,7 @@ inline typename FixedSegmentReturnType<Size>::Type tail()
/** This is the const version of tail<int>.*/
template<int Size>
EIGEN_DEVICE_FUNC
inline typename ConstFixedSegmentReturnType<Size>::Type tail() const
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)

View File

@@ -38,6 +38,7 @@ EIGEN_MAKE_CWISE_BINARY_OP(operator+,internal::scalar_sum_op)
* \sa class CwiseBinaryOp, operator+(), operator-(), cwiseProduct()
*/
template<typename CustomBinaryOp, typename OtherDerived>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const CwiseBinaryOp<CustomBinaryOp, const Derived, const OtherDerived>
binaryExpr(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other, const CustomBinaryOp& func = CustomBinaryOp()) const
{

View File

@@ -40,11 +40,13 @@ typedef CwiseUnaryView<internal::scalar_imag_ref_op<Scalar>, Derived> NonConstIm
/** \returns an expression of the opposite of \c *this
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_opposite_op<typename internal::traits<Derived>::Scalar>, const Derived>
operator-() const { return derived(); }
/** \returns an expression of \c *this scaled by the scalar factor \a scalar */
EIGEN_DEVICE_FUNC
inline const ScalarMultipleReturnType
operator*(const Scalar& scalar) const
{
@@ -57,6 +59,7 @@ const ScalarMultipleReturnType operator*(const RealScalar& scalar) const;
#endif
/** \returns an expression of \c *this divided by the scalar value \a scalar */
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_quotient1_op<typename internal::traits<Derived>::Scalar>, const Derived>
operator/(const Scalar& scalar) const
{
@@ -65,6 +68,7 @@ operator/(const Scalar& scalar) const
}
/** Overloaded for efficient real matrix times complex scalar value */
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_multiple2_op<Scalar,std::complex<Scalar> >, const Derived>
operator*(const std::complex<Scalar>& scalar) const
{
@@ -72,10 +76,12 @@ operator*(const std::complex<Scalar>& scalar) const
(*static_cast<const Derived*>(this), internal::scalar_multiple2_op<Scalar,std::complex<Scalar> >(scalar));
}
EIGEN_DEVICE_FUNC
inline friend const ScalarMultipleReturnType
operator*(const Scalar& scalar, const StorageBaseType& matrix)
{ return matrix*scalar; }
EIGEN_DEVICE_FUNC
inline friend const CwiseUnaryOp<internal::scalar_multiple2_op<Scalar,std::complex<Scalar> >, const Derived>
operator*(const std::complex<Scalar>& scalar, const StorageBaseType& matrix)
{ return matrix*scalar; }
@@ -88,6 +94,7 @@ operator*(const std::complex<Scalar>& scalar, const StorageBaseType& matrix)
* \sa class CwiseUnaryOp
*/
template<typename NewType>
EIGEN_DEVICE_FUNC
typename internal::cast_return_type<Derived,const CwiseUnaryOp<internal::scalar_cast_op<typename internal::traits<Derived>::Scalar, NewType>, const Derived> >::type
cast() const
{
@@ -97,6 +104,7 @@ cast() const
/** \returns an expression of the complex conjugate of \c *this.
*
* \sa adjoint() */
EIGEN_DEVICE_FUNC
inline ConjugateReturnType
conjugate() const
{
@@ -106,12 +114,14 @@ conjugate() const
/** \returns a read-only expression of the real part of \c *this.
*
* \sa imag() */
EIGEN_DEVICE_FUNC
inline RealReturnType
real() const { return derived(); }
/** \returns an read-only expression of the imaginary part of \c *this.
*
* \sa real() */
EIGEN_DEVICE_FUNC
inline const ImagReturnType
imag() const { return derived(); }
@@ -135,6 +145,7 @@ imag() const { return derived(); }
* \sa class CwiseUnaryOp, class CwiseBinaryOp
*/
template<typename CustomUnaryOp>
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<CustomUnaryOp, const Derived>
unaryExpr(const CustomUnaryOp& func = CustomUnaryOp()) const
{
@@ -153,6 +164,7 @@ unaryExpr(const CustomUnaryOp& func = CustomUnaryOp()) const
* \sa class CwiseUnaryOp, class CwiseBinaryOp
*/
template<typename CustomViewOp>
EIGEN_DEVICE_FUNC
inline const CwiseUnaryView<CustomViewOp, const Derived>
unaryViewExpr(const CustomViewOp& func = CustomViewOp()) const
{
@@ -162,11 +174,13 @@ unaryViewExpr(const CustomViewOp& func = CustomViewOp()) const
/** \returns a non const expression of the real part of \c *this.
*
* \sa imag() */
EIGEN_DEVICE_FUNC
inline NonConstRealReturnType
real() { return derived(); }
/** \returns a non const expression of the imaginary part of \c *this.
*
* \sa real() */
EIGEN_DEVICE_FUNC
inline NonConstImagReturnType
imag() { return derived(); }

View File

@@ -18,6 +18,7 @@
* \sa class CwiseBinaryOp, cwiseAbs2
*/
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const EIGEN_CWISE_PRODUCT_RETURN_TYPE(Derived,OtherDerived)
cwiseProduct(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
{
@@ -37,6 +38,7 @@ cwiseProduct(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
* \sa cwiseNotEqual(), isApprox(), isMuchSmallerThan()
*/
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
inline const CwiseBinaryOp<std::equal_to<Scalar>, const Derived, const OtherDerived>
cwiseEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
{
@@ -56,6 +58,7 @@ cwiseEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
* \sa cwiseEqual(), isApprox(), isMuchSmallerThan()
*/
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
inline const CwiseBinaryOp<std::not_equal_to<Scalar>, const Derived, const OtherDerived>
cwiseNotEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
{
@@ -70,6 +73,7 @@ cwiseNotEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
* \sa class CwiseBinaryOp, max()
*/
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_min_op<Scalar>, const Derived, const OtherDerived>
cwiseMin(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
{
@@ -80,6 +84,7 @@ cwiseMin(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
*
* \sa class CwiseBinaryOp, min()
*/
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_min_op<Scalar>, const Derived, const ConstantReturnType>
cwiseMin(const Scalar &other) const
{
@@ -94,6 +99,7 @@ cwiseMin(const Scalar &other) const
* \sa class CwiseBinaryOp, min()
*/
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_max_op<Scalar>, const Derived, const OtherDerived>
cwiseMax(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
{
@@ -104,6 +110,7 @@ cwiseMax(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
*
* \sa class CwiseBinaryOp, min()
*/
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_max_op<Scalar>, const Derived, const ConstantReturnType>
cwiseMax(const Scalar &other) const
{
@@ -119,6 +126,7 @@ cwiseMax(const Scalar &other) const
* \sa class CwiseBinaryOp, cwiseProduct(), cwiseInverse()
*/
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const Derived, const OtherDerived>
cwiseQuotient(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
{

View File

@@ -17,6 +17,7 @@
*
* \sa cwiseAbs2()
*/
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const CwiseUnaryOp<internal::scalar_abs_op<Scalar>, const Derived>
cwiseAbs() const { return derived(); }
@@ -27,6 +28,7 @@ cwiseAbs() const { return derived(); }
*
* \sa cwiseAbs()
*/
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, const Derived>
cwiseAbs2() const { return derived(); }
@@ -37,6 +39,7 @@ cwiseAbs2() const { return derived(); }
*
* \sa cwisePow(), cwiseSquare()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_sqrt_op<Scalar>, const Derived>
cwiseSqrt() const { return derived(); }
@@ -47,6 +50,7 @@ cwiseSqrt() const { return derived(); }
*
* \sa cwiseProduct()
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<internal::scalar_inverse_op<Scalar>, const Derived>
cwiseInverse() const { return derived(); }
@@ -59,6 +63,7 @@ cwiseInverse() const { return derived(); }
*
* \sa cwiseEqual(const MatrixBase<OtherDerived> &) const
*/
EIGEN_DEVICE_FUNC
inline const CwiseUnaryOp<std::binder1st<std::equal_to<Scalar> >, const Derived>
cwiseEqual(const Scalar& s) const
{