diff options
author | 2009-02-17 09:53:05 +0000 | |
---|---|---|
committer | 2009-02-17 09:53:05 +0000 | |
commit | e6f1104b57f19dff773b4f22d26d6aacabd1bdb2 (patch) | |
tree | 5de1c7a6d6eb47d894f119b5bda0107bd531000d /Eigen/src/Array/PartialRedux.h | |
parent | 67b4fab4e30a59d9a7e001ef25938d1767371569 (diff) |
* fix Quaternion::setFromTwoVectors (thanks to "benv" from the forum)
* extend PartialRedux::cross() to any matrix sizes with automatic
vectorization when possible
* unit tests: add "geo_" prefix to all unit tests related to the
geometry module and start splitting the big "geometry.cpp" tests to
multiple smaller ones (also include new tests)
Diffstat (limited to 'Eigen/src/Array/PartialRedux.h')
-rw-r--r-- | Eigen/src/Array/PartialRedux.h | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/Eigen/src/Array/PartialRedux.h b/Eigen/src/Array/PartialRedux.h index 2ae67663a..d1ed33c38 100644 --- a/Eigen/src/Array/PartialRedux.h +++ b/Eigen/src/Array/PartialRedux.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. Eigen itself is part of the KDE project. // -// Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr> +// Copyright (C) 2008-2009 Gael Guennebaud <g.gael@free.fr> // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com> // // Eigen is free software; you can redistribute it and/or @@ -176,7 +176,7 @@ template<typename ExpressionType, int Direction> class PartialRedux }; typedef typename ExpressionType::PlainMatrixType CrossReturnType; - + inline PartialRedux(const ExpressionType& matrix) : m_matrix(matrix) {} /** \internal */ @@ -249,7 +249,7 @@ template<typename ExpressionType, int Direction> class PartialRedux * \sa MatrixBase::any() */ const typename ReturnType<ei_member_any>::Type any() const { return _expression(); } - + /** \returns a row (or column) vector expression representing * the number of \c true coefficients of each respective column (or row). * @@ -269,8 +269,8 @@ template<typename ExpressionType, int Direction> class PartialRedux * \sa MatrixBase::prod() */ const typename ReturnType<ei_member_prod>::Type prod() const { return _expression(); } - - + + /** \returns a matrix expression * where each column (or row) are reversed. * @@ -282,33 +282,9 @@ template<typename ExpressionType, int Direction> class PartialRedux { return Reverse<ExpressionType, Direction>( _expression() ); } - - - /** \returns a 3x3 matrix expression of the cross product - * of each column or row of the referenced expression with the \a other vector. - * - * \geometry_module - * - * \sa MatrixBase::cross() */ + template<typename OtherDerived> - const CrossReturnType cross(const MatrixBase<OtherDerived>& other) const - { - EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(CrossReturnType,3,3) - EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,3) - EIGEN_STATIC_ASSERT((ei_is_same_type<Scalar, typename OtherDerived::Scalar>::ret), - YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) - - if(Direction==Vertical) - return (CrossReturnType() - << _expression().col(0).cross(other), - _expression().col(1).cross(other), - _expression().col(2).cross(other)).finished(); - else - return (CrossReturnType() - << _expression().row(0).cross(other), - _expression().row(1).cross(other), - _expression().row(2).cross(other)).finished(); - } + const CrossReturnType cross(const MatrixBase<OtherDerived>& other) const; protected: ExpressionTypeNested m_matrix; |