mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-22 17:49:36 +08:00
last small fixes, this is alpha6, eigen2 is now ready for eigen1 apps to
port to.
This commit is contained in:
parent
f04c1cb774
commit
13ad88736e
@ -28,6 +28,10 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse3")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse3")
|
||||||
MESSAGE("Enabling SSE3 in tests/examples")
|
MESSAGE("Enabling SSE3 in tests/examples")
|
||||||
ENDIF(TEST_SSE3)
|
ENDIF(TEST_SSE3)
|
||||||
|
IF(TEST_SSSE3)
|
||||||
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mssse3")
|
||||||
|
MESSAGE("Enabling SSSE3 in tests/examples")
|
||||||
|
ENDIF(TEST_SSSE3)
|
||||||
IF(TEST_ALTIVEC)
|
IF(TEST_ALTIVEC)
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maltivec -mabi=altivec")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maltivec -mabi=altivec")
|
||||||
MESSAGE("Enabling AltiVec in tests/examples")
|
MESSAGE("Enabling AltiVec in tests/examples")
|
||||||
|
2
Doxyfile
2
Doxyfile
@ -5,7 +5,7 @@
|
|||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
DOXYFILE_ENCODING = UTF-8
|
DOXYFILE_ENCODING = UTF-8
|
||||||
PROJECT_NAME = Eigen
|
PROJECT_NAME = Eigen
|
||||||
PROJECT_NUMBER = 2.0-alpha2
|
PROJECT_NUMBER = 2.0-alpha6
|
||||||
OUTPUT_DIRECTORY = ./
|
OUTPUT_DIRECTORY = ./
|
||||||
CREATE_SUBDIRS = NO
|
CREATE_SUBDIRS = NO
|
||||||
OUTPUT_LANGUAGE = English
|
OUTPUT_LANGUAGE = English
|
||||||
|
@ -17,14 +17,17 @@
|
|||||||
#include <pmmintrin.h>
|
#include <pmmintrin.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef __SSSE3__
|
#ifdef __SSSE3__
|
||||||
#include <tmmintrin.h>
|
#include <tmmintrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*** Disable AltiVec code for now as it's out of date
|
||||||
#elif (defined __ALTIVEC__)
|
#elif (defined __ALTIVEC__)
|
||||||
#define EIGEN_VECTORIZE
|
#define EIGEN_VECTORIZE
|
||||||
#define EIGEN_VECTORIZE_ALTIVEC
|
#define EIGEN_VECTORIZE_ALTIVEC
|
||||||
#include <altivec.h>
|
#include <altivec.h>
|
||||||
// We _need_ to #undef bool as it's defined in <altivec.h> for some reason.
|
// We _need_ to #undef bool as it's defined in <altivec.h> for some reason.
|
||||||
#undef bool
|
#undef bool
|
||||||
|
***/
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ namespace Eigen {
|
|||||||
* This module provides support for:
|
* This module provides support for:
|
||||||
* - fixed-size homogeneous transformations
|
* - fixed-size homogeneous transformations
|
||||||
* - 2D and 3D rotations
|
* - 2D and 3D rotations
|
||||||
|
* - quaternions
|
||||||
* - \ref MatrixBase::cross() "cross product"
|
* - \ref MatrixBase::cross() "cross product"
|
||||||
* - \ref MatrixBase::someOrthognal() "orthognal vector generation"
|
* - \ref MatrixBase::someOrthognal() "orthognal vector generation"
|
||||||
*
|
*
|
||||||
|
@ -462,6 +462,9 @@ template<typename Derived> class MatrixBase
|
|||||||
template<typename NewType>
|
template<typename NewType>
|
||||||
const CwiseUnaryOp<ei_scalar_cast_op<typename ei_traits<Derived>::Scalar, NewType>, Derived> cast() const;
|
const CwiseUnaryOp<ei_scalar_cast_op<typename ei_traits<Derived>::Scalar, NewType>, Derived> cast() const;
|
||||||
|
|
||||||
|
/** \returns the matrix or vector obtained by evaluating this expression.
|
||||||
|
*
|
||||||
|
*/
|
||||||
EIGEN_ALWAYS_INLINE const typename ei_eval<Derived>::type eval() const
|
EIGEN_ALWAYS_INLINE const typename ei_eval<Derived>::type eval() const
|
||||||
{
|
{
|
||||||
return typename ei_eval<Derived>::type(derived());
|
return typename ei_eval<Derived>::type(derived());
|
||||||
|
@ -47,10 +47,11 @@ MatrixBase<Derived>::cross(const MatrixBase<OtherDerived>& other) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename Derived, int Size = Derived::SizeAtCompileTime>
|
template<typename Derived, int Size = Derived::SizeAtCompileTime>
|
||||||
struct ei_perpendicular_selector
|
struct ei_someOrthogonal_selector
|
||||||
{
|
{
|
||||||
typedef typename ei_eval<Derived>::type VectorType;
|
typedef typename ei_eval<Derived>::type VectorType;
|
||||||
typedef typename ei_traits<Derived>::Scalar Scalar;
|
typedef typename ei_traits<Derived>::Scalar Scalar;
|
||||||
|
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||||
inline static VectorType run(const Derived& src)
|
inline static VectorType run(const Derived& src)
|
||||||
{
|
{
|
||||||
VectorType perp;
|
VectorType perp;
|
||||||
@ -64,7 +65,7 @@ struct ei_perpendicular_selector
|
|||||||
if((!ei_isMuchSmallerThan(src.x(), src.z()))
|
if((!ei_isMuchSmallerThan(src.x(), src.z()))
|
||||||
|| (!ei_isMuchSmallerThan(src.y(), src.z())))
|
|| (!ei_isMuchSmallerThan(src.y(), src.z())))
|
||||||
{
|
{
|
||||||
Scalar invnm = Scalar(1)/src.template start<2>().norm();
|
RealScalar invnm = Scalar(1)/src.template start<2>().norm();
|
||||||
perp.template start<3>() << -ei_conj(src.y())*invnm, ei_conj(src.x())*invnm, 0;
|
perp.template start<3>() << -ei_conj(src.y())*invnm, ei_conj(src.x())*invnm, 0;
|
||||||
}
|
}
|
||||||
/* if both x and y are close to zero, then the vector is close
|
/* if both x and y are close to zero, then the vector is close
|
||||||
@ -73,7 +74,7 @@ struct ei_perpendicular_selector
|
|||||||
*/
|
*/
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Scalar invnm = Scalar(1)/src.template end<2>().norm();
|
RealScalar invnm = Scalar(1)/src.template end<2>().norm();
|
||||||
perp.template start<3>() << 0, -ei_conj(src.z())*invnm, ei_conj(src.y())*invnm;
|
perp.template start<3>() << 0, -ei_conj(src.z())*invnm, ei_conj(src.y())*invnm;
|
||||||
}
|
}
|
||||||
if (Derived::SizeAtCompileTime>3
|
if (Derived::SizeAtCompileTime>3
|
||||||
@ -85,7 +86,7 @@ struct ei_perpendicular_selector
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
struct ei_perpendicular_selector<Derived,2>
|
struct ei_someOrthogonal_selector<Derived,2>
|
||||||
{
|
{
|
||||||
typedef typename ei_eval<Derived>::type VectorType;
|
typedef typename ei_eval<Derived>::type VectorType;
|
||||||
inline static VectorType run(const Derived& src)
|
inline static VectorType run(const Derived& src)
|
||||||
@ -104,7 +105,7 @@ typename MatrixBase<Derived>::EvalType
|
|||||||
MatrixBase<Derived>::someOrthogonal() const
|
MatrixBase<Derived>::someOrthogonal() const
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived);
|
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived);
|
||||||
return ei_perpendicular_selector<Derived>::run(derived());
|
return ei_someOrthogonal_selector<Derived>::run(derived());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // EIGEN_ORTHOMETHODS_H
|
#endif // EIGEN_ORTHOMETHODS_H
|
||||||
|
@ -14,6 +14,6 @@ In order to generate the documentation of Eigen, please follow these steps:
|
|||||||
After doing that, you will find the HTML documentation in the doc/html/ subdirectory of the build directory.
|
After doing that, you will find the HTML documentation in the doc/html/ subdirectory of the build directory.
|
||||||
|
|
||||||
<h2>Note however that the documentation is available online here:
|
<h2>Note however that the documentation is available online here:
|
||||||
<a href="http://eigen.tuxfamily.org/wiki">http://eigen.tuxfamily.org/wiki</a>
|
<a href="http://eigen.tuxfamily.org/api/">http://eigen.tuxfamily.org/api</a>
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -31,7 +31,7 @@ PROJECT_NAME = Eigen
|
|||||||
# This could be handy for archiving the generated documentation or
|
# This could be handy for archiving the generated documentation or
|
||||||
# if some version control system is used.
|
# if some version control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = 2.0-alpha5
|
PROJECT_NUMBER = 2.0-alpha6
|
||||||
|
|
||||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||||
# base path where the generated documentation will be put.
|
# base path where the generated documentation will be put.
|
||||||
@ -1185,7 +1185,8 @@ INCLUDE_FILE_PATTERNS =
|
|||||||
|
|
||||||
PREDEFINED = EIGEN_EMPTY_STRUCT \
|
PREDEFINED = EIGEN_EMPTY_STRUCT \
|
||||||
EIGEN_PARSED_BY_DOXYGEN \
|
EIGEN_PARSED_BY_DOXYGEN \
|
||||||
EIGEN_VECTORIZE
|
EIGEN_VECTORIZE \
|
||||||
|
EIGEN_QT_SUPPORT
|
||||||
|
|
||||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
||||||
# this tag can be used to specify a list of macro names that should be expanded.
|
# this tag can be used to specify a list of macro names that should be expanded.
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
Matrix2d m; m << 1,2,3,4;
|
Matrix2d m; m << 1,2,3,4;
|
||||||
Matrix2d n;
|
cout << (m*m).lazy().row(0) << endl;
|
||||||
n = (m*m).lazy(); // if we did "n = m*m;" then m*m would first be evaluated into
|
// this computes only one row of the product. By contrast,
|
||||||
// a temporary, because the Product expression has the EvalBeforeAssigningBit.
|
// if we did "(m*m).row(0);" then m*m would first be evaluated into
|
||||||
// This temporary would then be copied into n. Introducing this temporary is
|
// a temporary, because the Product expression has the EvalBeforeNestingBit.
|
||||||
// useless here and wastes time. Doing "n = (m*m).lazy();" evaluates m*m directly
|
|
||||||
// into n, which is faster. But, beware! This is only correct because m and n
|
|
||||||
// are two distinct matrices. Doing "m = (m*m).lazy();" would not produce the
|
|
||||||
// expected result.
|
|
||||||
cout << n << endl;
|
|
||||||
|
@ -80,6 +80,12 @@ template<typename MatrixType> void adjoint(const MatrixType& m)
|
|||||||
VERIFY_IS_APPROX(m1.conjugate()(r,c), ei_conj(m1(r,c)));
|
VERIFY_IS_APPROX(m1.conjugate()(r,c), ei_conj(m1(r,c)));
|
||||||
VERIFY_IS_APPROX(m1.adjoint()(c,r), ei_conj(m1(r,c)));
|
VERIFY_IS_APPROX(m1.adjoint()(c,r), ei_conj(m1(r,c)));
|
||||||
|
|
||||||
|
if(NumTraits<Scalar>::HasFloatingPoint)
|
||||||
|
{
|
||||||
|
// check that Random().normalized() works: tricky as the random xpr must be evaluated by
|
||||||
|
// normalized() in order to produce a consistent result.
|
||||||
|
VERIFY_IS_APPROX(VectorType::Random(rows).normalized().norm(), RealScalar(1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_adjoint()
|
void test_adjoint()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user