Add .perpendicular() function in Geometry module (adapted from Eigen1)

Documentation:
 * add an overview for each module.
 * add an example for .all() and Cwise::operator<
This commit is contained in:
Gael Guennebaud
2008-07-22 10:54:42 +00:00
parent 516db2c3b9
commit 172000aaeb
22 changed files with 189 additions and 36 deletions

View File

@@ -81,7 +81,12 @@ struct ei_any_unroller<Derived, Dynamic>
*
* \returns true if all coefficients are true
*
* \sa MatrixBase::any()
* \addexample CwiseAll \label How to check whether a point is inside a box (using operator< and all())
*
* Example: \include MatrixBase_all.cpp
* Output: \verbinclude MatrixBase_all.out
*
* \sa MatrixBase::any(), Cwise::operator<()
*/
template<typename Derived>
bool MatrixBase<Derived>::all(void) const
@@ -105,7 +110,7 @@ bool MatrixBase<Derived>::all(void) const
*
* \returns true if at least one coefficient is true
*
* \sa MatrixBase::any()
* \sa MatrixBase::all()
*/
template<typename Derived>
bool MatrixBase<Derived>::any(void) const

View File

@@ -127,6 +127,8 @@ Cwise<ExpressionType>::cube() const
*
* \returns an expression of the coefficient-wise \< operator of *this and \a other
*
* See MatrixBase::all() for an example.
*
* \sa class CwiseBinaryOp
*/
template<typename ExpressionType>
@@ -155,6 +157,8 @@ Cwise<ExpressionType>::operator<=(const MatrixBase<OtherDerived> &other) const
*
* \returns an expression of the coefficient-wise \> operator of *this and \a other
*
* See MatrixBase::all() for an example.
*
* \sa class CwiseBinaryOp
*/
template<typename ExpressionType>
@@ -208,7 +212,8 @@ Cwise<ExpressionType>::operator!=(const MatrixBase<OtherDerived> &other) const
}
/** \returns an expression of \c *this with each coeff incremented by the constant \a scalar */
/** \array_module
* \returns an expression of \c *this with each coeff incremented by the constant \a scalar */
template<typename ExpressionType>
inline const typename Cwise<ExpressionType>::ScalarAddReturnType
Cwise<ExpressionType>::operator+(const Scalar& scalar) const
@@ -216,14 +221,16 @@ Cwise<ExpressionType>::operator+(const Scalar& scalar) const
return typename Cwise<ExpressionType>::ScalarAddReturnType(m_matrix, ei_scalar_add_op<Scalar>(scalar));
}
/** \see operator+ */
/** \array_module
* \see operator+() */
template<typename ExpressionType>
inline ExpressionType& Cwise<ExpressionType>::operator+=(const Scalar& scalar)
{
return m_matrix.const_cast_derived() = *this + scalar;
}
/** \returns an expression of \c *this with each coeff decremented by the constant \a scalar */
/** \array_module
* \returns an expression of \c *this with each coeff decremented by the constant \a scalar */
template<typename ExpressionType>
inline const typename Cwise<ExpressionType>::ScalarAddReturnType
Cwise<ExpressionType>::operator-(const Scalar& scalar) const
@@ -231,7 +238,8 @@ Cwise<ExpressionType>::operator-(const Scalar& scalar) const
return *this + (-scalar);
}
/** \see operator- */
/** \array_module
* \see operator- */
template<typename ExpressionType>
inline ExpressionType& Cwise<ExpressionType>::operator-=(const Scalar& scalar)
{

View File

@@ -26,7 +26,7 @@
#ifndef EIGEN_PARTIAL_REDUX_H
#define EIGEN_PARTIAL_REDUX_H
/** \array_module
/** \array_module \ingroup Array
*
* \class PartialReduxExpr
*
@@ -128,7 +128,7 @@ struct ei_member_redux {
const BinaryOp m_functor;
};
/** \array_module
/** \array_module \ingroup Array
*
* \class PartialRedux
*
@@ -141,7 +141,7 @@ struct ei_member_redux {
* It is the return type of MatrixBase::colwise() and MatrixBase::rowwise()
* and most of the time this is the only way it is used.
*
* \sa MatrixBase::colwise(), MatrixBase::rowwise()
* \sa MatrixBase::colwise(), MatrixBase::rowwise(), class PartialReduxExpr
*/
template<typename ExpressionType, int Direction> class PartialRedux
{
@@ -236,9 +236,7 @@ MatrixBase<Derived>::rowwise() const
return derived();
}
/** \array_module
*
* \returns a row or column vector expression of \c *this reduxed by \a func
/** \returns a row or column vector expression of \c *this reduxed by \a func
*
* The template parameter \a BinaryOp is the type of the functor
* of the custom redux operator. Note that func must be an associative operator.

View File

@@ -49,7 +49,7 @@ struct ei_functor_traits<ei_scalar_random_op<Scalar> >
* Example: \include MatrixBase_random_int_int.cpp
* Output: \verbinclude MatrixBase_random_int_int.out
*
* \sa ei_random(), ei_random(int)
* \sa MatrixBase::setRandom(), MatrixBase::Random(int), MatrixBase::Random()
*/
template<typename Derived>
inline const CwiseNullaryOp<ei_scalar_random_op<typename ei_traits<Derived>::Scalar>, Derived>
@@ -74,7 +74,7 @@ MatrixBase<Derived>::Random(int rows, int cols)
* Example: \include MatrixBase_random_int.cpp
* Output: \verbinclude MatrixBase_random_int.out
*
* \sa ei_random(), ei_random(int,int)
* \sa MatrixBase::setRandom(), MatrixBase::Random(int,int), MatrixBase::Random()
*/
template<typename Derived>
inline const CwiseNullaryOp<ei_scalar_random_op<typename ei_traits<Derived>::Scalar>, Derived>
@@ -94,7 +94,7 @@ MatrixBase<Derived>::Random(int size)
* Example: \include MatrixBase_random.cpp
* Output: \verbinclude MatrixBase_random.out
*
* \sa ei_random(int), ei_random(int,int)
* \sa MatrixBase::setRandom(), MatrixBase::Random(int,int), MatrixBase::Random(int)
*/
template<typename Derived>
inline const CwiseNullaryOp<ei_scalar_random_op<typename ei_traits<Derived>::Scalar>, Derived>
@@ -110,7 +110,7 @@ MatrixBase<Derived>::Random()
* Example: \include MatrixBase_setRandom.cpp
* Output: \verbinclude MatrixBase_setRandom.out
*
* \sa class CwiseNullaryOp, ei_random()
* \sa class CwiseNullaryOp, MatrixBase::setRandom(int,int)
*/
template<typename Derived>
inline Derived& MatrixBase<Derived>::setRandom()