mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-02-17 18:09:55 +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")
|
||||
MESSAGE("Enabling SSE3 in tests/examples")
|
||||
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)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maltivec -mabi=altivec")
|
||||
MESSAGE("Enabling AltiVec in tests/examples")
|
||||
|
2
Doxyfile
2
Doxyfile
@ -5,7 +5,7 @@
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = Eigen
|
||||
PROJECT_NUMBER = 2.0-alpha2
|
||||
PROJECT_NUMBER = 2.0-alpha6
|
||||
OUTPUT_DIRECTORY = ./
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
|
@ -17,14 +17,17 @@
|
||||
#include <pmmintrin.h>
|
||||
#endif
|
||||
#ifdef __SSSE3__
|
||||
#include <tmmintrin.h>
|
||||
#include <tmmintrin.h>
|
||||
#endif
|
||||
|
||||
/*** Disable AltiVec code for now as it's out of date
|
||||
#elif (defined __ALTIVEC__)
|
||||
#define EIGEN_VECTORIZE
|
||||
#define EIGEN_VECTORIZE_ALTIVEC
|
||||
#include <altivec.h>
|
||||
// We _need_ to #undef bool as it's defined in <altivec.h> for some reason.
|
||||
#undef bool
|
||||
***/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -9,6 +9,7 @@ namespace Eigen {
|
||||
* This module provides support for:
|
||||
* - fixed-size homogeneous transformations
|
||||
* - 2D and 3D rotations
|
||||
* - quaternions
|
||||
* - \ref MatrixBase::cross() "cross product"
|
||||
* - \ref MatrixBase::someOrthognal() "orthognal vector generation"
|
||||
*
|
||||
|
@ -462,6 +462,9 @@ template<typename Derived> class MatrixBase
|
||||
template<typename NewType>
|
||||
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
|
||||
{
|
||||
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>
|
||||
struct ei_perpendicular_selector
|
||||
struct ei_someOrthogonal_selector
|
||||
{
|
||||
typedef typename ei_eval<Derived>::type VectorType;
|
||||
typedef typename ei_traits<Derived>::Scalar Scalar;
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
inline static VectorType run(const Derived& src)
|
||||
{
|
||||
VectorType perp;
|
||||
@ -64,7 +65,7 @@ struct ei_perpendicular_selector
|
||||
if((!ei_isMuchSmallerThan(src.x(), 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;
|
||||
}
|
||||
/* if both x and y are close to zero, then the vector is close
|
||||
@ -73,7 +74,7 @@ struct ei_perpendicular_selector
|
||||
*/
|
||||
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;
|
||||
}
|
||||
if (Derived::SizeAtCompileTime>3
|
||||
@ -85,7 +86,7 @@ struct ei_perpendicular_selector
|
||||
};
|
||||
|
||||
template<typename Derived>
|
||||
struct ei_perpendicular_selector<Derived,2>
|
||||
struct ei_someOrthogonal_selector<Derived,2>
|
||||
{
|
||||
typedef typename ei_eval<Derived>::type VectorType;
|
||||
inline static VectorType run(const Derived& src)
|
||||
@ -104,7 +105,7 @@ typename MatrixBase<Derived>::EvalType
|
||||
MatrixBase<Derived>::someOrthogonal() const
|
||||
{
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived);
|
||||
return ei_perpendicular_selector<Derived>::run(derived());
|
||||
return ei_someOrthogonal_selector<Derived>::run(derived());
|
||||
}
|
||||
|
||||
#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.
|
||||
|
||||
<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
|
||||
# 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)
|
||||
# base path where the generated documentation will be put.
|
||||
@ -1185,7 +1185,8 @@ INCLUDE_FILE_PATTERNS =
|
||||
|
||||
PREDEFINED = EIGEN_EMPTY_STRUCT \
|
||||
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
|
||||
# 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 n;
|
||||
n = (m*m).lazy(); // if we did "n = m*m;" then m*m would first be evaluated into
|
||||
// a temporary, because the Product expression has the EvalBeforeAssigningBit.
|
||||
// This temporary would then be copied into n. Introducing this temporary is
|
||||
// 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;
|
||||
cout << (m*m).lazy().row(0) << endl;
|
||||
// this computes only one row of the product. By contrast,
|
||||
// if we did "(m*m).row(0);" then m*m would first be evaluated into
|
||||
// a temporary, because the Product expression has the EvalBeforeNestingBit.
|
||||
|
@ -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.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()
|
||||
|
Loading…
Reference in New Issue
Block a user