mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a965155af | ||
|
|
5ce83aeb6b | ||
|
|
41070aad7b | ||
|
|
27f6fd3a50 | ||
|
|
45ae9a069c | ||
|
|
bdd80ebe1c | ||
|
|
06773276cd | ||
|
|
c8271df0ec | ||
|
|
9e84d135db | ||
|
|
8d2f7ae94b | ||
|
|
a1a0cccd4e | ||
|
|
45e1bb5ea5 | ||
|
|
d0c374f1ed | ||
|
|
f231560ec2 | ||
|
|
cea814b90d | ||
|
|
15b1558483 | ||
|
|
bfe9b35152 | ||
|
|
6d4f7f76ce | ||
|
|
b4c4490587 | ||
|
|
6af80a23a5 | ||
|
|
f1f70ceb84 | ||
|
|
ea1ac035ce | ||
|
|
360a79d6f8 | ||
|
|
057254381d | ||
|
|
cafd34fa91 | ||
|
|
deeffdb245 | ||
|
|
10295de37b | ||
|
|
c31b70fcfd | ||
|
|
b55585a93d | ||
|
|
ae32b89b12 |
@@ -8,6 +8,6 @@ set(CTEST_PROJECT_NAME "Eigen")
|
|||||||
set(CTEST_NIGHTLY_START_TIME "00:00:00 UTC")
|
set(CTEST_NIGHTLY_START_TIME "00:00:00 UTC")
|
||||||
|
|
||||||
set(CTEST_DROP_METHOD "http")
|
set(CTEST_DROP_METHOD "http")
|
||||||
set(CTEST_DROP_SITE "eigen.tuxfamily.org")
|
set(CTEST_DROP_SITE "manao.inria.fr")
|
||||||
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Eigen")
|
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Eigen")
|
||||||
set(CTEST_DROP_SITE_CDASH TRUE)
|
set(CTEST_DROP_SITE_CDASH TRUE)
|
||||||
|
|||||||
@@ -136,7 +136,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// MSVC for windows mobile does not have the errno.h file
|
// MSVC for windows mobile does not have the errno.h file
|
||||||
#if !(defined(_MSC_VER) && defined(_WIN32_WCE))
|
#if !(defined(_MSC_VER) && defined(_WIN32_WCE)) && !defined(__ARMCC_VERSION)
|
||||||
#define EIGEN_HAS_ERRNO
|
#define EIGEN_HAS_ERRNO
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -331,16 +331,16 @@ template<> struct ldlt_inplace<Upper>
|
|||||||
|
|
||||||
template<typename MatrixType> struct LDLT_Traits<MatrixType,Lower>
|
template<typename MatrixType> struct LDLT_Traits<MatrixType,Lower>
|
||||||
{
|
{
|
||||||
typedef TriangularView<MatrixType, UnitLower> MatrixL;
|
typedef const TriangularView<const MatrixType, UnitLower> MatrixL;
|
||||||
typedef TriangularView<typename MatrixType::AdjointReturnType, UnitUpper> MatrixU;
|
typedef const TriangularView<const typename MatrixType::AdjointReturnType, UnitUpper> MatrixU;
|
||||||
inline static MatrixL getL(const MatrixType& m) { return m; }
|
inline static MatrixL getL(const MatrixType& m) { return m; }
|
||||||
inline static MatrixU getU(const MatrixType& m) { return m.adjoint(); }
|
inline static MatrixU getU(const MatrixType& m) { return m.adjoint(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename MatrixType> struct LDLT_Traits<MatrixType,Upper>
|
template<typename MatrixType> struct LDLT_Traits<MatrixType,Upper>
|
||||||
{
|
{
|
||||||
typedef TriangularView<typename MatrixType::AdjointReturnType, UnitLower> MatrixL;
|
typedef const TriangularView<const typename MatrixType::AdjointReturnType, UnitLower> MatrixL;
|
||||||
typedef TriangularView<MatrixType, UnitUpper> MatrixU;
|
typedef const TriangularView<const MatrixType, UnitUpper> MatrixU;
|
||||||
inline static MatrixL getL(const MatrixType& m) { return m.adjoint(); }
|
inline static MatrixL getL(const MatrixType& m) { return m.adjoint(); }
|
||||||
inline static MatrixU getU(const MatrixType& m) { return m; }
|
inline static MatrixU getU(const MatrixType& m) { return m; }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -274,8 +274,8 @@ template<> struct llt_inplace<Upper>
|
|||||||
|
|
||||||
template<typename MatrixType> struct LLT_Traits<MatrixType,Lower>
|
template<typename MatrixType> struct LLT_Traits<MatrixType,Lower>
|
||||||
{
|
{
|
||||||
typedef TriangularView<MatrixType, Lower> MatrixL;
|
typedef const TriangularView<const MatrixType, Lower> MatrixL;
|
||||||
typedef TriangularView<typename MatrixType::AdjointReturnType, Upper> MatrixU;
|
typedef const TriangularView<const typename MatrixType::AdjointReturnType, Upper> MatrixU;
|
||||||
inline static MatrixL getL(const MatrixType& m) { return m; }
|
inline static MatrixL getL(const MatrixType& m) { return m; }
|
||||||
inline static MatrixU getU(const MatrixType& m) { return m.adjoint(); }
|
inline static MatrixU getU(const MatrixType& m) { return m.adjoint(); }
|
||||||
static bool inplace_decomposition(MatrixType& m)
|
static bool inplace_decomposition(MatrixType& m)
|
||||||
@@ -284,8 +284,8 @@ template<typename MatrixType> struct LLT_Traits<MatrixType,Lower>
|
|||||||
|
|
||||||
template<typename MatrixType> struct LLT_Traits<MatrixType,Upper>
|
template<typename MatrixType> struct LLT_Traits<MatrixType,Upper>
|
||||||
{
|
{
|
||||||
typedef TriangularView<typename MatrixType::AdjointReturnType, Lower> MatrixL;
|
typedef const TriangularView<const typename MatrixType::AdjointReturnType, Lower> MatrixL;
|
||||||
typedef TriangularView<MatrixType, Upper> MatrixU;
|
typedef const TriangularView<const MatrixType, Upper> MatrixU;
|
||||||
inline static MatrixL getL(const MatrixType& m) { return m.adjoint(); }
|
inline static MatrixL getL(const MatrixType& m) { return m.adjoint(); }
|
||||||
inline static MatrixU getU(const MatrixType& m) { return m; }
|
inline static MatrixU getU(const MatrixType& m) { return m; }
|
||||||
static bool inplace_decomposition(MatrixType& m)
|
static bool inplace_decomposition(MatrixType& m)
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ class Block<XprType,BlockRows,BlockCols, InnerPanel,true>
|
|||||||
}
|
}
|
||||||
|
|
||||||
const typename XprType::Nested m_xpr;
|
const typename XprType::Nested m_xpr;
|
||||||
int m_outerStride;
|
Index m_outerStride;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -169,8 +169,8 @@ template<typename Derived> class DenseBase
|
|||||||
|
|
||||||
IsRowMajor = int(Flags) & RowMajorBit, /**< True if this expression has row-major storage order. */
|
IsRowMajor = int(Flags) & RowMajorBit, /**< True if this expression has row-major storage order. */
|
||||||
|
|
||||||
InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? SizeAtCompileTime
|
InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime)
|
||||||
: int(IsRowMajor) ? ColsAtCompileTime : RowsAtCompileTime,
|
: int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime),
|
||||||
|
|
||||||
CoeffReadCost = internal::traits<Derived>::CoeffReadCost,
|
CoeffReadCost = internal::traits<Derived>::CoeffReadCost,
|
||||||
/**< This is a rough measure of how expensive it is to read one coefficient from
|
/**< This is a rough measure of how expensive it is to read one coefficient from
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ struct functor_traits<scalar_opposite_op<Scalar> >
|
|||||||
template<typename Scalar> struct scalar_abs_op {
|
template<typename Scalar> struct scalar_abs_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_abs_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_abs_op)
|
||||||
typedef typename NumTraits<Scalar>::Real result_type;
|
typedef typename NumTraits<Scalar>::Real result_type;
|
||||||
EIGEN_STRONG_INLINE const result_type operator() (const Scalar& a) const { return abs(a); }
|
EIGEN_STRONG_INLINE const result_type operator() (const Scalar& a) const { return internal::abs(a); }
|
||||||
template<typename Packet>
|
template<typename Packet>
|
||||||
EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const
|
EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const
|
||||||
{ return internal::pabs(a); }
|
{ return internal::pabs(a); }
|
||||||
@@ -271,7 +271,7 @@ struct functor_traits<scalar_abs_op<Scalar> >
|
|||||||
template<typename Scalar> struct scalar_abs2_op {
|
template<typename Scalar> struct scalar_abs2_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_abs2_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_abs2_op)
|
||||||
typedef typename NumTraits<Scalar>::Real result_type;
|
typedef typename NumTraits<Scalar>::Real result_type;
|
||||||
EIGEN_STRONG_INLINE const result_type operator() (const Scalar& a) const { return abs2(a); }
|
EIGEN_STRONG_INLINE const result_type operator() (const Scalar& a) const { return internal::abs2(a); }
|
||||||
template<typename Packet>
|
template<typename Packet>
|
||||||
EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const
|
EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const
|
||||||
{ return internal::pmul(a,a); }
|
{ return internal::pmul(a,a); }
|
||||||
@@ -287,7 +287,7 @@ struct functor_traits<scalar_abs2_op<Scalar> >
|
|||||||
*/
|
*/
|
||||||
template<typename Scalar> struct scalar_conjugate_op {
|
template<typename Scalar> struct scalar_conjugate_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_conjugate_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_conjugate_op)
|
||||||
EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const { return conj(a); }
|
EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const { return internal::conj(a); }
|
||||||
template<typename Packet>
|
template<typename Packet>
|
||||||
EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const { return internal::pconj(a); }
|
EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const { return internal::pconj(a); }
|
||||||
};
|
};
|
||||||
@@ -324,7 +324,7 @@ template<typename Scalar>
|
|||||||
struct scalar_real_op {
|
struct scalar_real_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_real_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_real_op)
|
||||||
typedef typename NumTraits<Scalar>::Real result_type;
|
typedef typename NumTraits<Scalar>::Real result_type;
|
||||||
EIGEN_STRONG_INLINE result_type operator() (const Scalar& a) const { return real(a); }
|
EIGEN_STRONG_INLINE result_type operator() (const Scalar& a) const { return internal::real(a); }
|
||||||
};
|
};
|
||||||
template<typename Scalar>
|
template<typename Scalar>
|
||||||
struct functor_traits<scalar_real_op<Scalar> >
|
struct functor_traits<scalar_real_op<Scalar> >
|
||||||
@@ -339,7 +339,7 @@ template<typename Scalar>
|
|||||||
struct scalar_imag_op {
|
struct scalar_imag_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_imag_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_imag_op)
|
||||||
typedef typename NumTraits<Scalar>::Real result_type;
|
typedef typename NumTraits<Scalar>::Real result_type;
|
||||||
EIGEN_STRONG_INLINE result_type operator() (const Scalar& a) const { return imag(a); }
|
EIGEN_STRONG_INLINE result_type operator() (const Scalar& a) const { return internal::imag(a); }
|
||||||
};
|
};
|
||||||
template<typename Scalar>
|
template<typename Scalar>
|
||||||
struct functor_traits<scalar_imag_op<Scalar> >
|
struct functor_traits<scalar_imag_op<Scalar> >
|
||||||
@@ -354,7 +354,7 @@ template<typename Scalar>
|
|||||||
struct scalar_real_ref_op {
|
struct scalar_real_ref_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_real_ref_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_real_ref_op)
|
||||||
typedef typename NumTraits<Scalar>::Real result_type;
|
typedef typename NumTraits<Scalar>::Real result_type;
|
||||||
EIGEN_STRONG_INLINE result_type& operator() (const Scalar& a) const { return real_ref(*const_cast<Scalar*>(&a)); }
|
EIGEN_STRONG_INLINE result_type& operator() (const Scalar& a) const { return internal::real_ref(*const_cast<Scalar*>(&a)); }
|
||||||
};
|
};
|
||||||
template<typename Scalar>
|
template<typename Scalar>
|
||||||
struct functor_traits<scalar_real_ref_op<Scalar> >
|
struct functor_traits<scalar_real_ref_op<Scalar> >
|
||||||
@@ -369,7 +369,7 @@ template<typename Scalar>
|
|||||||
struct scalar_imag_ref_op {
|
struct scalar_imag_ref_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_imag_ref_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_imag_ref_op)
|
||||||
typedef typename NumTraits<Scalar>::Real result_type;
|
typedef typename NumTraits<Scalar>::Real result_type;
|
||||||
EIGEN_STRONG_INLINE result_type& operator() (const Scalar& a) const { return imag_ref(*const_cast<Scalar*>(&a)); }
|
EIGEN_STRONG_INLINE result_type& operator() (const Scalar& a) const { return internal::imag_ref(*const_cast<Scalar*>(&a)); }
|
||||||
};
|
};
|
||||||
template<typename Scalar>
|
template<typename Scalar>
|
||||||
struct functor_traits<scalar_imag_ref_op<Scalar> >
|
struct functor_traits<scalar_imag_ref_op<Scalar> >
|
||||||
@@ -383,7 +383,7 @@ struct functor_traits<scalar_imag_ref_op<Scalar> >
|
|||||||
*/
|
*/
|
||||||
template<typename Scalar> struct scalar_exp_op {
|
template<typename Scalar> struct scalar_exp_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_exp_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_exp_op)
|
||||||
inline const Scalar operator() (const Scalar& a) const { return exp(a); }
|
inline const Scalar operator() (const Scalar& a) const { return internal::exp(a); }
|
||||||
typedef typename packet_traits<Scalar>::type Packet;
|
typedef typename packet_traits<Scalar>::type Packet;
|
||||||
inline Packet packetOp(const Packet& a) const { return internal::pexp(a); }
|
inline Packet packetOp(const Packet& a) const { return internal::pexp(a); }
|
||||||
};
|
};
|
||||||
@@ -399,7 +399,7 @@ struct functor_traits<scalar_exp_op<Scalar> >
|
|||||||
*/
|
*/
|
||||||
template<typename Scalar> struct scalar_log_op {
|
template<typename Scalar> struct scalar_log_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_log_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_log_op)
|
||||||
inline const Scalar operator() (const Scalar& a) const { return log(a); }
|
inline const Scalar operator() (const Scalar& a) const { return internal::log(a); }
|
||||||
typedef typename packet_traits<Scalar>::type Packet;
|
typedef typename packet_traits<Scalar>::type Packet;
|
||||||
inline Packet packetOp(const Packet& a) const { return internal::plog(a); }
|
inline Packet packetOp(const Packet& a) const { return internal::plog(a); }
|
||||||
};
|
};
|
||||||
@@ -657,7 +657,7 @@ struct functor_traits<scalar_add_op<Scalar> >
|
|||||||
*/
|
*/
|
||||||
template<typename Scalar> struct scalar_sqrt_op {
|
template<typename Scalar> struct scalar_sqrt_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_sqrt_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_sqrt_op)
|
||||||
inline const Scalar operator() (const Scalar& a) const { return sqrt(a); }
|
inline const Scalar operator() (const Scalar& a) const { return internal::sqrt(a); }
|
||||||
typedef typename packet_traits<Scalar>::type Packet;
|
typedef typename packet_traits<Scalar>::type Packet;
|
||||||
inline Packet packetOp(const Packet& a) const { return internal::psqrt(a); }
|
inline Packet packetOp(const Packet& a) const { return internal::psqrt(a); }
|
||||||
};
|
};
|
||||||
@@ -675,7 +675,7 @@ struct functor_traits<scalar_sqrt_op<Scalar> >
|
|||||||
*/
|
*/
|
||||||
template<typename Scalar> struct scalar_cos_op {
|
template<typename Scalar> struct scalar_cos_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_cos_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_cos_op)
|
||||||
inline Scalar operator() (const Scalar& a) const { return cos(a); }
|
inline Scalar operator() (const Scalar& a) const { return internal::cos(a); }
|
||||||
typedef typename packet_traits<Scalar>::type Packet;
|
typedef typename packet_traits<Scalar>::type Packet;
|
||||||
inline Packet packetOp(const Packet& a) const { return internal::pcos(a); }
|
inline Packet packetOp(const Packet& a) const { return internal::pcos(a); }
|
||||||
};
|
};
|
||||||
@@ -694,7 +694,7 @@ struct functor_traits<scalar_cos_op<Scalar> >
|
|||||||
*/
|
*/
|
||||||
template<typename Scalar> struct scalar_sin_op {
|
template<typename Scalar> struct scalar_sin_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_sin_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_sin_op)
|
||||||
inline const Scalar operator() (const Scalar& a) const { return sin(a); }
|
inline const Scalar operator() (const Scalar& a) const { return internal::sin(a); }
|
||||||
typedef typename packet_traits<Scalar>::type Packet;
|
typedef typename packet_traits<Scalar>::type Packet;
|
||||||
inline Packet packetOp(const Packet& a) const { return internal::psin(a); }
|
inline Packet packetOp(const Packet& a) const { return internal::psin(a); }
|
||||||
};
|
};
|
||||||
@@ -714,7 +714,7 @@ struct functor_traits<scalar_sin_op<Scalar> >
|
|||||||
*/
|
*/
|
||||||
template<typename Scalar> struct scalar_tan_op {
|
template<typename Scalar> struct scalar_tan_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_tan_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_tan_op)
|
||||||
inline const Scalar operator() (const Scalar& a) const { return tan(a); }
|
inline const Scalar operator() (const Scalar& a) const { return internal::tan(a); }
|
||||||
typedef typename packet_traits<Scalar>::type Packet;
|
typedef typename packet_traits<Scalar>::type Packet;
|
||||||
inline Packet packetOp(const Packet& a) const { return internal::ptan(a); }
|
inline Packet packetOp(const Packet& a) const { return internal::ptan(a); }
|
||||||
};
|
};
|
||||||
@@ -733,7 +733,7 @@ struct functor_traits<scalar_tan_op<Scalar> >
|
|||||||
*/
|
*/
|
||||||
template<typename Scalar> struct scalar_acos_op {
|
template<typename Scalar> struct scalar_acos_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_acos_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_acos_op)
|
||||||
inline const Scalar operator() (const Scalar& a) const { return acos(a); }
|
inline const Scalar operator() (const Scalar& a) const { return internal::acos(a); }
|
||||||
typedef typename packet_traits<Scalar>::type Packet;
|
typedef typename packet_traits<Scalar>::type Packet;
|
||||||
inline Packet packetOp(const Packet& a) const { return internal::pacos(a); }
|
inline Packet packetOp(const Packet& a) const { return internal::pacos(a); }
|
||||||
};
|
};
|
||||||
@@ -752,7 +752,7 @@ struct functor_traits<scalar_acos_op<Scalar> >
|
|||||||
*/
|
*/
|
||||||
template<typename Scalar> struct scalar_asin_op {
|
template<typename Scalar> struct scalar_asin_op {
|
||||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_asin_op)
|
EIGEN_EMPTY_STRUCT_CTOR(scalar_asin_op)
|
||||||
inline const Scalar operator() (const Scalar& a) const { return asin(a); }
|
inline const Scalar operator() (const Scalar& a) const { return internal::asin(a); }
|
||||||
typedef typename packet_traits<Scalar>::type Packet;
|
typedef typename packet_traits<Scalar>::type Packet;
|
||||||
inline Packet packetOp(const Packet& a) const { return internal::pasin(a); }
|
inline Packet packetOp(const Packet& a) const { return internal::pasin(a); }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ EIGEN_ALWAYS_INLINE void check_rows_cols_for_overflow(Index rows, Index cols)
|
|||||||
throw_std_bad_alloc();
|
throw_std_bad_alloc();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Derived, typename OtherDerived = Derived, bool IsVector = static_cast<bool>(Derived::IsVectorAtCompileTime)> struct conservative_resize_like_impl;
|
template <typename Derived, typename OtherDerived = Derived, bool IsVector = bool(Derived::IsVectorAtCompileTime)> struct conservative_resize_like_impl;
|
||||||
|
|
||||||
template<typename MatrixTypeA, typename MatrixTypeB, bool SwapPointers> struct matrix_swap_impl;
|
template<typename MatrixTypeA, typename MatrixTypeB, bool SwapPointers> struct matrix_swap_impl;
|
||||||
|
|
||||||
@@ -543,6 +543,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
|
|||||||
eigen_assert((this->size()==0 || (IsVectorAtCompileTime ? (this->size() == other.size())
|
eigen_assert((this->size()==0 || (IsVectorAtCompileTime ? (this->size() == other.size())
|
||||||
: (rows() == other.rows() && cols() == other.cols())))
|
: (rows() == other.rows() && cols() == other.cols())))
|
||||||
&& "Size mismatch. Automatic resizing is disabled because EIGEN_NO_AUTOMATIC_RESIZING is defined");
|
&& "Size mismatch. Automatic resizing is disabled because EIGEN_NO_AUTOMATIC_RESIZING is defined");
|
||||||
|
EIGEN_ONLY_USED_FOR_DEBUG(other);
|
||||||
#else
|
#else
|
||||||
resizeLike(other);
|
resizeLike(other);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -152,7 +152,8 @@ class ProductBase : public MatrixBase<Derived>
|
|||||||
#else
|
#else
|
||||||
EIGEN_STATIC_ASSERT_SIZE_1x1(Derived)
|
EIGEN_STATIC_ASSERT_SIZE_1x1(Derived)
|
||||||
eigen_assert(this->rows() == 1 && this->cols() == 1);
|
eigen_assert(this->rows() == 1 && this->cols() == 1);
|
||||||
return derived().coeff(row,col);
|
Matrix<Scalar,1,1> result = *this;
|
||||||
|
return result.coeff(row,col);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +161,8 @@ class ProductBase : public MatrixBase<Derived>
|
|||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT_SIZE_1x1(Derived)
|
EIGEN_STATIC_ASSERT_SIZE_1x1(Derived)
|
||||||
eigen_assert(this->rows() == 1 && this->cols() == 1);
|
eigen_assert(this->rows() == 1 && this->cols() == 1);
|
||||||
return derived().coeff(i);
|
Matrix<Scalar,1,1> result = *this;
|
||||||
|
return result.coeff(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Scalar& coeffRef(Index row, Index col) const
|
const Scalar& coeffRef(Index row, Index col) const
|
||||||
|
|||||||
@@ -48,7 +48,10 @@ struct traits<Replicate<MatrixType,RowFactor,ColFactor> >
|
|||||||
typedef typename MatrixType::Scalar Scalar;
|
typedef typename MatrixType::Scalar Scalar;
|
||||||
typedef typename traits<MatrixType>::StorageKind StorageKind;
|
typedef typename traits<MatrixType>::StorageKind StorageKind;
|
||||||
typedef typename traits<MatrixType>::XprKind XprKind;
|
typedef typename traits<MatrixType>::XprKind XprKind;
|
||||||
typedef typename nested<MatrixType>::type MatrixTypeNested;
|
enum {
|
||||||
|
Factor = (RowFactor==Dynamic || ColFactor==Dynamic) ? Dynamic : RowFactor*ColFactor
|
||||||
|
};
|
||||||
|
typedef typename nested<MatrixType,Factor>::type MatrixTypeNested;
|
||||||
typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested;
|
typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested;
|
||||||
enum {
|
enum {
|
||||||
RowsAtCompileTime = RowFactor==Dynamic || int(MatrixType::RowsAtCompileTime)==Dynamic
|
RowsAtCompileTime = RowFactor==Dynamic || int(MatrixType::RowsAtCompileTime)==Dynamic
|
||||||
@@ -72,6 +75,8 @@ struct traits<Replicate<MatrixType,RowFactor,ColFactor> >
|
|||||||
template<typename MatrixType,int RowFactor,int ColFactor> class Replicate
|
template<typename MatrixType,int RowFactor,int ColFactor> class Replicate
|
||||||
: public internal::dense_xpr_base< Replicate<MatrixType,RowFactor,ColFactor> >::type
|
: public internal::dense_xpr_base< Replicate<MatrixType,RowFactor,ColFactor> >::type
|
||||||
{
|
{
|
||||||
|
typedef typename internal::traits<Replicate>::MatrixTypeNested MatrixTypeNested;
|
||||||
|
typedef typename internal::traits<Replicate>::_MatrixTypeNested _MatrixTypeNested;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef typename internal::dense_xpr_base<Replicate>::type Base;
|
typedef typename internal::dense_xpr_base<Replicate>::type Base;
|
||||||
@@ -124,7 +129,7 @@ template<typename MatrixType,int RowFactor,int ColFactor> class Replicate
|
|||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const typename MatrixType::Nested m_matrix;
|
const MatrixTypeNested m_matrix;
|
||||||
const internal::variable_if_dynamic<Index, RowFactor> m_rowFactor;
|
const internal::variable_if_dynamic<Index, RowFactor> m_rowFactor;
|
||||||
const internal::variable_if_dynamic<Index, ColFactor> m_colFactor;
|
const internal::variable_if_dynamic<Index, ColFactor> m_colFactor;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ Packet4f pexp<Packet4f>(const Packet4f& _x)
|
|||||||
_EIGEN_DECLARE_CONST_Packet4i(0x7f, 0x7f);
|
_EIGEN_DECLARE_CONST_Packet4i(0x7f, 0x7f);
|
||||||
|
|
||||||
|
|
||||||
_EIGEN_DECLARE_CONST_Packet4f(exp_hi, 88.3762626647949f);
|
_EIGEN_DECLARE_CONST_Packet4f(exp_hi, 88.3762626647950f);
|
||||||
_EIGEN_DECLARE_CONST_Packet4f(exp_lo, -88.3762626647949f);
|
_EIGEN_DECLARE_CONST_Packet4f(exp_lo, -88.3762626647949f);
|
||||||
|
|
||||||
_EIGEN_DECLARE_CONST_Packet4f(cephes_LOG2EF, 1.44269504088896341f);
|
_EIGEN_DECLARE_CONST_Packet4f(cephes_LOG2EF, 1.44269504088896341f);
|
||||||
@@ -168,7 +168,7 @@ Packet4f pexp<Packet4f>(const Packet4f& _x)
|
|||||||
y = pmadd(y, z, x);
|
y = pmadd(y, z, x);
|
||||||
y = padd(y, p4f_1);
|
y = padd(y, p4f_1);
|
||||||
|
|
||||||
/* build 2^n */
|
// build 2^n
|
||||||
emm0 = _mm_cvttps_epi32(fx);
|
emm0 = _mm_cvttps_epi32(fx);
|
||||||
emm0 = _mm_add_epi32(emm0, p4i_0x7f);
|
emm0 = _mm_add_epi32(emm0, p4i_0x7f);
|
||||||
emm0 = _mm_slli_epi32(emm0, 23);
|
emm0 = _mm_slli_epi32(emm0, 23);
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ namespace internal {
|
|||||||
template<typename _LhsScalar, typename _RhsScalar, bool _ConjLhs=false, bool _ConjRhs=false>
|
template<typename _LhsScalar, typename _RhsScalar, bool _ConjLhs=false, bool _ConjRhs=false>
|
||||||
class gebp_traits;
|
class gebp_traits;
|
||||||
|
|
||||||
inline std::ptrdiff_t manage_caching_sizes_second_if_negative(std::ptrdiff_t a, std::ptrdiff_t b)
|
/** \internal \returns b if a<=0, and returns a otherwise. */
|
||||||
|
inline std::ptrdiff_t manage_caching_sizes_helper(std::ptrdiff_t a, std::ptrdiff_t b)
|
||||||
{
|
{
|
||||||
return a<=0 ? b : a;
|
return a<=0 ? b : a;
|
||||||
}
|
}
|
||||||
@@ -38,8 +39,16 @@ inline std::ptrdiff_t manage_caching_sizes_second_if_negative(std::ptrdiff_t a,
|
|||||||
/** \internal */
|
/** \internal */
|
||||||
inline void manage_caching_sizes(Action action, std::ptrdiff_t* l1=0, std::ptrdiff_t* l2=0)
|
inline void manage_caching_sizes(Action action, std::ptrdiff_t* l1=0, std::ptrdiff_t* l2=0)
|
||||||
{
|
{
|
||||||
static std::ptrdiff_t m_l1CacheSize = manage_caching_sizes_second_if_negative(queryL1CacheSize(),8 * 1024);
|
static std::ptrdiff_t m_l1CacheSize = 0;
|
||||||
static std::ptrdiff_t m_l2CacheSize = manage_caching_sizes_second_if_negative(queryTopLevelCacheSize(),1*1024*1024);
|
static std::ptrdiff_t m_l2CacheSize = 0;
|
||||||
|
#ifdef _OPENMP
|
||||||
|
#pragma omp threadprivate(m_l1CacheSize,m_l2CacheSize)
|
||||||
|
#endif
|
||||||
|
if(m_l1CacheSize==0)
|
||||||
|
{
|
||||||
|
m_l1CacheSize = manage_caching_sizes_helper(queryL1CacheSize(),8 * 1024);
|
||||||
|
m_l2CacheSize = manage_caching_sizes_helper(queryTopLevelCacheSize(),1*1024*1024);
|
||||||
|
}
|
||||||
|
|
||||||
if(action==SetAction)
|
if(action==SetAction)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#define EIGEN_WORLD_VERSION 3
|
#define EIGEN_WORLD_VERSION 3
|
||||||
#define EIGEN_MAJOR_VERSION 0
|
#define EIGEN_MAJOR_VERSION 0
|
||||||
#define EIGEN_MINOR_VERSION 5
|
#define EIGEN_MINOR_VERSION 7
|
||||||
|
|
||||||
#define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \
|
#define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \
|
||||||
(EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \
|
(EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \
|
||||||
@@ -265,7 +265,7 @@
|
|||||||
* If we made alignment depend on whether or not EIGEN_VECTORIZE is defined, it would be impossible to link
|
* If we made alignment depend on whether or not EIGEN_VECTORIZE is defined, it would be impossible to link
|
||||||
* vectorized and non-vectorized code.
|
* vectorized and non-vectorized code.
|
||||||
*/
|
*/
|
||||||
#if (defined __GNUC__) || (defined __PGI) || (defined __IBMCPP__)
|
#if (defined __GNUC__) || (defined __PGI) || (defined __IBMCPP__) || (defined __ARMCC_VERSION)
|
||||||
#define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n)))
|
#define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n)))
|
||||||
#elif (defined _MSC_VER)
|
#elif (defined _MSC_VER)
|
||||||
#define EIGEN_ALIGN_TO_BOUNDARY(n) __declspec(align(n))
|
#define EIGEN_ALIGN_TO_BOUNDARY(n) __declspec(align(n))
|
||||||
|
|||||||
@@ -238,38 +238,41 @@ RealSchur<MatrixType>& RealSchur<MatrixType>::compute(const MatrixType& matrix,
|
|||||||
Scalar exshift = 0.0; // sum of exceptional shifts
|
Scalar exshift = 0.0; // sum of exceptional shifts
|
||||||
Scalar norm = computeNormOfT();
|
Scalar norm = computeNormOfT();
|
||||||
|
|
||||||
while (iu >= 0)
|
if(norm!=0)
|
||||||
{
|
{
|
||||||
Index il = findSmallSubdiagEntry(iu, norm);
|
while (iu >= 0)
|
||||||
|
{
|
||||||
// Check for convergence
|
Index il = findSmallSubdiagEntry(iu, norm);
|
||||||
if (il == iu) // One root found
|
|
||||||
{
|
|
||||||
m_matT.coeffRef(iu,iu) = m_matT.coeff(iu,iu) + exshift;
|
|
||||||
if (iu > 0)
|
|
||||||
m_matT.coeffRef(iu, iu-1) = Scalar(0);
|
|
||||||
iu--;
|
|
||||||
iter = 0;
|
|
||||||
}
|
|
||||||
else if (il == iu-1) // Two roots found
|
|
||||||
{
|
|
||||||
splitOffTwoRows(iu, computeU, exshift);
|
|
||||||
iu -= 2;
|
|
||||||
iter = 0;
|
|
||||||
}
|
|
||||||
else // No convergence yet
|
|
||||||
{
|
|
||||||
// The firstHouseholderVector vector has to be initialized to something to get rid of a silly GCC warning (-O1 -Wall -DNDEBUG )
|
|
||||||
Vector3s firstHouseholderVector(0,0,0), shiftInfo;
|
|
||||||
computeShift(iu, iter, exshift, shiftInfo);
|
|
||||||
iter = iter + 1;
|
|
||||||
if (iter > m_maxIterations) break;
|
|
||||||
Index im;
|
|
||||||
initFrancisQRStep(il, iu, shiftInfo, im, firstHouseholderVector);
|
|
||||||
performFrancisQRStep(il, im, iu, computeU, firstHouseholderVector, workspace);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Check for convergence
|
||||||
|
if (il == iu) // One root found
|
||||||
|
{
|
||||||
|
m_matT.coeffRef(iu,iu) = m_matT.coeff(iu,iu) + exshift;
|
||||||
|
if (iu > 0)
|
||||||
|
m_matT.coeffRef(iu, iu-1) = Scalar(0);
|
||||||
|
iu--;
|
||||||
|
iter = 0;
|
||||||
|
}
|
||||||
|
else if (il == iu-1) // Two roots found
|
||||||
|
{
|
||||||
|
splitOffTwoRows(iu, computeU, exshift);
|
||||||
|
iu -= 2;
|
||||||
|
iter = 0;
|
||||||
|
}
|
||||||
|
else // No convergence yet
|
||||||
|
{
|
||||||
|
// The firstHouseholderVector vector has to be initialized to something to get rid of a silly GCC warning (-O1 -Wall -DNDEBUG )
|
||||||
|
Vector3s firstHouseholderVector(0,0,0), shiftInfo;
|
||||||
|
computeShift(iu, iter, exshift, shiftInfo);
|
||||||
|
iter = iter + 1;
|
||||||
|
if (iter > m_maxIterations) break;
|
||||||
|
Index im;
|
||||||
|
initFrancisQRStep(il, iu, shiftInfo, im, firstHouseholderVector);
|
||||||
|
performFrancisQRStep(il, im, iu, computeU, firstHouseholderVector, workspace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(iter <= m_maxIterations)
|
if(iter <= m_maxIterations)
|
||||||
m_info = Success;
|
m_info = Success;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -200,7 +200,8 @@ public:
|
|||||||
*
|
*
|
||||||
* \brief The quaternion class used to represent 3D orientations and rotations
|
* \brief The quaternion class used to represent 3D orientations and rotations
|
||||||
*
|
*
|
||||||
* \param _Scalar the scalar type, i.e., the type of the coefficients
|
* \tparam _Scalar the scalar type, i.e., the type of the coefficients
|
||||||
|
* \tparam _Options controls the memory alignement of the coeffecients. Can be \# AutoAlign or \# DontAlign. Default is AutoAlign.
|
||||||
*
|
*
|
||||||
* This class represents a quaternion \f$ w+xi+yj+zk \f$ that is a convenient representation of
|
* This class represents a quaternion \f$ w+xi+yj+zk \f$ that is a convenient representation of
|
||||||
* orientations and rotations of objects in three dimensions. Compared to other representations
|
* orientations and rotations of objects in three dimensions. Compared to other representations
|
||||||
@@ -308,41 +309,29 @@ typedef Quaternion<double> Quaterniond;
|
|||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
template<typename _Scalar, int _Options>
|
template<typename _Scalar, int _Options>
|
||||||
struct traits<Map<Quaternion<_Scalar>, _Options> >:
|
struct traits<Map<Quaternion<_Scalar>, _Options> > : traits<Quaternion<_Scalar, (int(_Options)&Aligned)==Aligned ? AutoAlign : DontAlign> >
|
||||||
traits<Quaternion<_Scalar, _Options> >
|
|
||||||
{
|
{
|
||||||
typedef _Scalar Scalar;
|
|
||||||
typedef Map<Matrix<_Scalar,4,1>, _Options> Coefficients;
|
typedef Map<Matrix<_Scalar,4,1>, _Options> Coefficients;
|
||||||
|
|
||||||
typedef traits<Quaternion<_Scalar, _Options> > TraitsBase;
|
|
||||||
enum {
|
|
||||||
IsAligned = TraitsBase::IsAligned,
|
|
||||||
|
|
||||||
Flags = TraitsBase::Flags
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
template<typename _Scalar, int _Options>
|
template<typename _Scalar, int _Options>
|
||||||
struct traits<Map<const Quaternion<_Scalar>, _Options> >:
|
struct traits<Map<const Quaternion<_Scalar>, _Options> > : traits<Quaternion<_Scalar, (int(_Options)&Aligned)==Aligned ? AutoAlign : DontAlign> >
|
||||||
traits<Quaternion<_Scalar> >
|
|
||||||
{
|
{
|
||||||
typedef _Scalar Scalar;
|
|
||||||
typedef Map<const Matrix<_Scalar,4,1>, _Options> Coefficients;
|
typedef Map<const Matrix<_Scalar,4,1>, _Options> Coefficients;
|
||||||
|
typedef traits<Quaternion<_Scalar, (int(_Options)&Aligned)==Aligned ? AutoAlign : DontAlign> > TraitsBase;
|
||||||
typedef traits<Quaternion<_Scalar, _Options> > TraitsBase;
|
|
||||||
enum {
|
enum {
|
||||||
IsAligned = TraitsBase::IsAligned,
|
|
||||||
Flags = TraitsBase::Flags & ~LvalueBit
|
Flags = TraitsBase::Flags & ~LvalueBit
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief Quaternion expression mapping a constant memory buffer
|
/** \ingroup Geometry_Module
|
||||||
|
* \brief Quaternion expression mapping a constant memory buffer
|
||||||
*
|
*
|
||||||
* \param _Scalar the type of the Quaternion coefficients
|
* \tparam _Scalar the type of the Quaternion coefficients
|
||||||
* \param _Options see class Map
|
* \tparam _Options see class Map
|
||||||
*
|
*
|
||||||
* This is a specialization of class Map for Quaternion. This class allows to view
|
* This is a specialization of class Map for Quaternion. This class allows to view
|
||||||
* a 4 scalar memory buffer as an Eigen's Quaternion object.
|
* a 4 scalar memory buffer as an Eigen's Quaternion object.
|
||||||
@@ -375,10 +364,11 @@ class Map<const Quaternion<_Scalar>, _Options >
|
|||||||
const Coefficients m_coeffs;
|
const Coefficients m_coeffs;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** \brief Expression of a quaternion from a memory buffer
|
/** \ingroup Geometry_Module
|
||||||
|
* \brief Expression of a quaternion from a memory buffer
|
||||||
*
|
*
|
||||||
* \param _Scalar the type of the Quaternion coefficients
|
* \tparam _Scalar the type of the Quaternion coefficients
|
||||||
* \param _Options see class Map
|
* \tparam _Options see class Map
|
||||||
*
|
*
|
||||||
* This is a specialization of class Map for Quaternion. This class allows to view
|
* This is a specialization of class Map for Quaternion. This class allows to view
|
||||||
* a 4 scalar memory buffer as an Eigen's Quaternion object.
|
* a 4 scalar memory buffer as an Eigen's Quaternion object.
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ struct transform_traits
|
|||||||
Dim = Transform::Dim,
|
Dim = Transform::Dim,
|
||||||
HDim = Transform::HDim,
|
HDim = Transform::HDim,
|
||||||
Mode = Transform::Mode,
|
Mode = Transform::Mode,
|
||||||
IsProjective = (Mode==Projective)
|
IsProjective = (int(Mode)==int(Projective))
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ template< typename Lhs,
|
|||||||
typename Rhs,
|
typename Rhs,
|
||||||
bool AnyProjective =
|
bool AnyProjective =
|
||||||
transform_traits<Lhs>::IsProjective ||
|
transform_traits<Lhs>::IsProjective ||
|
||||||
transform_traits<Lhs>::IsProjective>
|
transform_traits<Rhs>::IsProjective>
|
||||||
struct transform_transform_product_impl;
|
struct transform_transform_product_impl;
|
||||||
|
|
||||||
template< typename Other,
|
template< typename Other,
|
||||||
@@ -571,7 +571,7 @@ public:
|
|||||||
if(int(Mode)!=int(AffineCompact))
|
if(int(Mode)!=int(AffineCompact))
|
||||||
{
|
{
|
||||||
matrix().template block<1,Dim>(Dim,0).setZero();
|
matrix().template block<1,Dim>(Dim,0).setZero();
|
||||||
matrix().coeffRef(Dim,Dim) = 1;
|
matrix().coeffRef(Dim,Dim) = Scalar(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1391,6 +1391,35 @@ struct transform_transform_product_impl<Transform<Scalar,Dim,LhsMode,LhsOptions>
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename Scalar, int Dim, int LhsOptions, int RhsOptions>
|
||||||
|
struct transform_transform_product_impl<Transform<Scalar,Dim,AffineCompact,LhsOptions>,Transform<Scalar,Dim,Projective,RhsOptions>,true >
|
||||||
|
{
|
||||||
|
typedef Transform<Scalar,Dim,AffineCompact,LhsOptions> Lhs;
|
||||||
|
typedef Transform<Scalar,Dim,Projective,RhsOptions> Rhs;
|
||||||
|
typedef Transform<Scalar,Dim,Projective> ResultType;
|
||||||
|
static ResultType run(const Lhs& lhs, const Rhs& rhs)
|
||||||
|
{
|
||||||
|
ResultType res;
|
||||||
|
res.matrix().template topRows<Dim>() = lhs.matrix() * rhs.matrix();
|
||||||
|
res.matrix().row(Dim) = rhs.matrix().row(Dim);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename Scalar, int Dim, int LhsOptions, int RhsOptions>
|
||||||
|
struct transform_transform_product_impl<Transform<Scalar,Dim,Projective,LhsOptions>,Transform<Scalar,Dim,AffineCompact,RhsOptions>,true >
|
||||||
|
{
|
||||||
|
typedef Transform<Scalar,Dim,Projective,LhsOptions> Lhs;
|
||||||
|
typedef Transform<Scalar,Dim,AffineCompact,RhsOptions> Rhs;
|
||||||
|
typedef Transform<Scalar,Dim,Projective> ResultType;
|
||||||
|
static ResultType run(const Lhs& lhs, const Rhs& rhs)
|
||||||
|
{
|
||||||
|
ResultType res(lhs.matrix().template leftCols<Dim>() * rhs.matrix());
|
||||||
|
res.matrix().col(Dim) += lhs.matrix().col(Dim);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} // end namespace internal
|
} // end namespace internal
|
||||||
|
|
||||||
#endif // EIGEN_TRANSFORM_H
|
#endif // EIGEN_TRANSFORM_H
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ struct quat_product<Architecture::SSE, Derived, OtherDerived, double, Aligned>
|
|||||||
*/
|
*/
|
||||||
t1 = padd(pmul(a_ww, b_xy), pmul(a_yy, b_zw));
|
t1 = padd(pmul(a_ww, b_xy), pmul(a_yy, b_zw));
|
||||||
t2 = psub(pmul(a_zz, b_xy), pmul(a_xx, b_zw));
|
t2 = psub(pmul(a_zz, b_xy), pmul(a_xx, b_zw));
|
||||||
#ifdef __SSE3__
|
#ifdef EIGEN_VECTORIZE_SSE3
|
||||||
EIGEN_UNUSED_VARIABLE(mask)
|
EIGEN_UNUSED_VARIABLE(mask)
|
||||||
pstore(&res.x(), _mm_addsub_pd(t1, preverse(t2)));
|
pstore(&res.x(), _mm_addsub_pd(t1, preverse(t2)));
|
||||||
#else
|
#else
|
||||||
@@ -110,7 +110,7 @@ struct quat_product<Architecture::SSE, Derived, OtherDerived, double, Aligned>
|
|||||||
*/
|
*/
|
||||||
t1 = psub(pmul(a_ww, b_zw), pmul(a_yy, b_xy));
|
t1 = psub(pmul(a_ww, b_zw), pmul(a_yy, b_xy));
|
||||||
t2 = padd(pmul(a_zz, b_zw), pmul(a_xx, b_xy));
|
t2 = padd(pmul(a_zz, b_zw), pmul(a_xx, b_xy));
|
||||||
#ifdef __SSE3__
|
#ifdef EIGEN_VECTORIZE_SSE3
|
||||||
EIGEN_UNUSED_VARIABLE(mask)
|
EIGEN_UNUSED_VARIABLE(mask)
|
||||||
pstore(&res.z(), preverse(_mm_addsub_pd(preverse(t1), t2)));
|
pstore(&res.z(), preverse(_mm_addsub_pd(preverse(t1), t2)));
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -51,10 +51,10 @@ AngleAxis<float> aa(angle_in_radian, Vector3f(ax,ay,az));\endcode</td></tr>
|
|||||||
Quaternion<float> q; q = AngleAxis<float>(angle_in_radian, axis);\endcode</td></tr>
|
Quaternion<float> q; q = AngleAxis<float>(angle_in_radian, axis);\endcode</td></tr>
|
||||||
<tr class="alt"><td>
|
<tr class="alt"><td>
|
||||||
N-D Scaling</td><td>\code
|
N-D Scaling</td><td>\code
|
||||||
Scaling<float,2>(sx, sy)
|
Scaling(sx, sy)
|
||||||
Scaling<float,3>(sx, sy, sz)
|
Scaling(sx, sy, sz)
|
||||||
Scaling<float,N>(s)
|
Scaling(s)
|
||||||
Scaling<float,N>(vecN)\endcode</td></tr>
|
Scaling(vecN)\endcode</td></tr>
|
||||||
<tr><td>
|
<tr><td>
|
||||||
N-D Translation</td><td>\code
|
N-D Translation</td><td>\code
|
||||||
Translation<float,2>(tx, ty)
|
Translation<float,2>(tx, ty)
|
||||||
@@ -64,13 +64,13 @@ Translation<float,N>(vecN)\endcode</td></tr>
|
|||||||
<tr class="alt"><td>
|
<tr class="alt"><td>
|
||||||
N-D \ref TutorialGeoTransform "Affine transformation"</td><td>\code
|
N-D \ref TutorialGeoTransform "Affine transformation"</td><td>\code
|
||||||
Transform<float,N,Affine> t = concatenation_of_any_transformations;
|
Transform<float,N,Affine> t = concatenation_of_any_transformations;
|
||||||
Transform<float,3,Affine> t = Translation3f(p) * AngleAxisf(a,axis) * Scaling3f(s);\endcode</td></tr>
|
Transform<float,3,Affine> t = Translation3f(p) * AngleAxisf(a,axis) * Scaling(s);\endcode</td></tr>
|
||||||
<tr><td>
|
<tr><td>
|
||||||
N-D Linear transformations \n
|
N-D Linear transformations \n
|
||||||
<em class=note>(pure rotations, \n scaling, etc.)</em></td><td>\code
|
<em class=note>(pure rotations, \n scaling, etc.)</em></td><td>\code
|
||||||
Matrix<float,N> t = concatenation_of_rotations_and_scalings;
|
Matrix<float,N> t = concatenation_of_rotations_and_scalings;
|
||||||
Matrix<float,2> t = Rotation2Df(a) * Scaling2f(s);
|
Matrix<float,2> t = Rotation2Df(a) * Scaling(s);
|
||||||
Matrix<float,3> t = AngleAxisf(a,axis) * Scaling3f(s);\endcode</td></tr>
|
Matrix<float,3> t = AngleAxisf(a,axis) * Scaling(s);\endcode</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<strong>Notes on rotations</strong>\n To transform more than a single vector the preferred
|
<strong>Notes on rotations</strong>\n To transform more than a single vector the preferred
|
||||||
@@ -92,8 +92,8 @@ Rotation2Df r; r = Matrix2f(..); // assumes a pure rotation matrix
|
|||||||
AngleAxisf aa; aa = Quaternionf(..);
|
AngleAxisf aa; aa = Quaternionf(..);
|
||||||
AngleAxisf aa; aa = Matrix3f(..); // assumes a pure rotation matrix
|
AngleAxisf aa; aa = Matrix3f(..); // assumes a pure rotation matrix
|
||||||
Matrix2f m; m = Rotation2Df(..);
|
Matrix2f m; m = Rotation2Df(..);
|
||||||
Matrix3f m; m = Quaternionf(..); Matrix3f m; m = Scaling3f(..);
|
Matrix3f m; m = Quaternionf(..); Matrix3f m; m = Scaling(..);
|
||||||
Affine3f m; m = AngleAxis3f(..); Affine3f m; m = Scaling3f(..);
|
Affine3f m; m = AngleAxis3f(..); Affine3f m; m = Scaling(..);
|
||||||
Affine3f m; m = Translation3f(..); Affine3f m; m = Matrix3f(..);
|
Affine3f m; m = Translation3f(..); Affine3f m; m = Matrix3f(..);
|
||||||
\endcode</td></tr>
|
\endcode</td></tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -207,10 +207,10 @@ t.scale(s);
|
|||||||
t.prescale(Vector_(sx,sy,..));
|
t.prescale(Vector_(sx,sy,..));
|
||||||
t.prescale(s);
|
t.prescale(s);
|
||||||
\endcode</td><td>\code
|
\endcode</td><td>\code
|
||||||
t *= Scaling_(sx,sy,..);
|
t *= Scaling(sx,sy,..);
|
||||||
t *= Scaling_(s);
|
t *= Scaling(s);
|
||||||
t = Scaling_(sx,sy,..) * t;
|
t = Scaling(sx,sy,..) * t;
|
||||||
t = Scaling_(s) * t;
|
t = Scaling(s) * t;
|
||||||
\endcode</td></tr>
|
\endcode</td></tr>
|
||||||
<tr class="alt"><td>Shear transformation \n ( \b 2D \b only ! )</td><td>\code
|
<tr class="alt"><td>Shear transformation \n ( \b 2D \b only ! )</td><td>\code
|
||||||
t.shear(sx,sy);
|
t.shear(sx,sy);
|
||||||
@@ -224,7 +224,7 @@ Note that in both API, any many transformations can be concatenated in a single
|
|||||||
t.pretranslate(..).rotate(..).translate(..).scale(..);
|
t.pretranslate(..).rotate(..).translate(..).scale(..);
|
||||||
\endcode</td></tr>
|
\endcode</td></tr>
|
||||||
<tr><td>\code
|
<tr><td>\code
|
||||||
t = Translation_(..) * t * RotationType(..) * Translation_(..) * Scaling_(..);
|
t = Translation_(..) * t * RotationType(..) * Translation_(..) * Scaling(..);
|
||||||
\endcode</td></tr>
|
\endcode</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ namespace Eigen {
|
|||||||
\section TopicLinAlgBigTable Catalogue of decompositions offered by Eigen
|
\section TopicLinAlgBigTable Catalogue of decompositions offered by Eigen
|
||||||
|
|
||||||
<table class="manual-vl">
|
<table class="manual-vl">
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th class="meta"></th>
|
<th class="meta"></th>
|
||||||
<th class="meta" colspan="5">Generic information, not Eigen-specific</th>
|
<th class="meta" colspan="5">Generic information, not Eigen-specific</th>
|
||||||
|
|||||||
@@ -8,14 +8,12 @@ USER=${USER:-'orzel'}
|
|||||||
#ulimit -v 1024000
|
#ulimit -v 1024000
|
||||||
|
|
||||||
# step 1 : build
|
# step 1 : build
|
||||||
# todo if 'build is not there, create one:
|
|
||||||
mkdir build -p
|
mkdir build -p
|
||||||
(cd build && cmake .. && make doc) || { echo "make failed"; exit 1; }
|
(cd build && cmake .. && make doc) || { echo "make failed"; exit 1; }
|
||||||
#todo: n+1 where n = number of cpus
|
|
||||||
|
|
||||||
#step 2 : upload
|
#step 2 : upload
|
||||||
# (the '/' at the end of path are very important, see rsync documentation)
|
# (the '/' at the end of path is very important, see rsync documentation)
|
||||||
rsync -az --no-p build/doc/html/ $USER@ssh.tuxfamily.org:eigen/eigen.tuxfamily.org-web/htdocs/dox-3.0/ || { echo "upload failed"; exit 1; }
|
rsync -az --no-p --delete build/doc/html/ $USER@ssh.tuxfamily.org:eigen/eigen.tuxfamily.org-web/htdocs/dox-3.0/ || { echo "upload failed"; exit 1; }
|
||||||
|
|
||||||
echo "Uploaded successfully"
|
echo "Uploaded successfully"
|
||||||
|
|
||||||
|
|||||||
@@ -124,6 +124,11 @@ template<typename MatrixType> void cholesky(const MatrixType& m)
|
|||||||
MatrixType neg = -symmLo;
|
MatrixType neg = -symmLo;
|
||||||
chollo.compute(neg);
|
chollo.compute(neg);
|
||||||
VERIFY(chollo.info()==NumericalIssue);
|
VERIFY(chollo.info()==NumericalIssue);
|
||||||
|
|
||||||
|
VERIFY_IS_APPROX(MatrixType(chollo.matrixL().transpose().conjugate()), MatrixType(chollo.matrixU()));
|
||||||
|
VERIFY_IS_APPROX(MatrixType(chollo.matrixU().transpose().conjugate()), MatrixType(chollo.matrixL()));
|
||||||
|
VERIFY_IS_APPROX(MatrixType(cholup.matrixL().transpose().conjugate()), MatrixType(cholup.matrixU()));
|
||||||
|
VERIFY_IS_APPROX(MatrixType(cholup.matrixU().transpose().conjugate()), MatrixType(cholup.matrixL()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// LDLT
|
// LDLT
|
||||||
@@ -152,6 +157,11 @@ template<typename MatrixType> void cholesky(const MatrixType& m)
|
|||||||
matX = ldltup.solve(matB);
|
matX = ldltup.solve(matB);
|
||||||
VERIFY_IS_APPROX(symm * matX, matB);
|
VERIFY_IS_APPROX(symm * matX, matB);
|
||||||
|
|
||||||
|
VERIFY_IS_APPROX(MatrixType(ldltlo.matrixL().transpose().conjugate()), MatrixType(ldltlo.matrixU()));
|
||||||
|
VERIFY_IS_APPROX(MatrixType(ldltlo.matrixU().transpose().conjugate()), MatrixType(ldltlo.matrixL()));
|
||||||
|
VERIFY_IS_APPROX(MatrixType(ldltup.matrixL().transpose().conjugate()), MatrixType(ldltup.matrixU()));
|
||||||
|
VERIFY_IS_APPROX(MatrixType(ldltup.matrixU().transpose().conjugate()), MatrixType(ldltup.matrixL()));
|
||||||
|
|
||||||
if(MatrixType::RowsAtCompileTime==Dynamic)
|
if(MatrixType::RowsAtCompileTime==Dynamic)
|
||||||
{
|
{
|
||||||
// note : each inplace permutation requires a small temporary vector (mask)
|
// note : each inplace permutation requires a small temporary vector (mask)
|
||||||
|
|||||||
@@ -175,23 +175,36 @@ template<typename Scalar, int Options> void quaternion(void)
|
|||||||
|
|
||||||
template<typename Scalar> void mapQuaternion(void){
|
template<typename Scalar> void mapQuaternion(void){
|
||||||
typedef Map<Quaternion<Scalar>, Aligned> MQuaternionA;
|
typedef Map<Quaternion<Scalar>, Aligned> MQuaternionA;
|
||||||
|
typedef Map<const Quaternion<Scalar>, Aligned> MCQuaternionA;
|
||||||
typedef Map<Quaternion<Scalar> > MQuaternionUA;
|
typedef Map<Quaternion<Scalar> > MQuaternionUA;
|
||||||
typedef Map<const Quaternion<Scalar> > MCQuaternionUA;
|
typedef Map<const Quaternion<Scalar> > MCQuaternionUA;
|
||||||
typedef Quaternion<Scalar> Quaternionx;
|
typedef Quaternion<Scalar> Quaternionx;
|
||||||
|
typedef Matrix<Scalar,3,1> Vector3;
|
||||||
|
typedef AngleAxis<Scalar> AngleAxisx;
|
||||||
|
|
||||||
|
Vector3 v0 = Vector3::Random(),
|
||||||
|
v1 = Vector3::Random();
|
||||||
|
Scalar a = internal::random<Scalar>(-Scalar(M_PI), Scalar(M_PI));
|
||||||
|
|
||||||
EIGEN_ALIGN16 Scalar array1[4];
|
EIGEN_ALIGN16 Scalar array1[4];
|
||||||
EIGEN_ALIGN16 Scalar array2[4];
|
EIGEN_ALIGN16 Scalar array2[4];
|
||||||
EIGEN_ALIGN16 Scalar array3[4+1];
|
EIGEN_ALIGN16 Scalar array3[4+1];
|
||||||
Scalar* array3unaligned = array3+1;
|
Scalar* array3unaligned = array3+1;
|
||||||
|
|
||||||
|
MQuaternionA mq1(array1);
|
||||||
|
MCQuaternionA mcq1(array1);
|
||||||
|
MQuaternionA mq2(array2);
|
||||||
|
MQuaternionUA mq3(array3unaligned);
|
||||||
|
MCQuaternionUA mcq3(array3unaligned);
|
||||||
|
|
||||||
// std::cerr << array1 << " " << array2 << " " << array3 << "\n";
|
// std::cerr << array1 << " " << array2 << " " << array3 << "\n";
|
||||||
MQuaternionA(array1).coeffs().setRandom();
|
mq1 = AngleAxisx(a, v0.normalized());
|
||||||
(MQuaternionA(array2)) = MQuaternionA(array1);
|
mq2 = mq1;
|
||||||
(MQuaternionUA(array3unaligned)) = MQuaternionA(array1);
|
mq3 = mq1;
|
||||||
|
|
||||||
Quaternionx q1 = MQuaternionA(array1);
|
Quaternionx q1 = mq1;
|
||||||
Quaternionx q2 = MQuaternionA(array2);
|
Quaternionx q2 = mq2;
|
||||||
Quaternionx q3 = MQuaternionUA(array3unaligned);
|
Quaternionx q3 = mq3;
|
||||||
Quaternionx q4 = MCQuaternionUA(array3unaligned);
|
Quaternionx q4 = MCQuaternionUA(array3unaligned);
|
||||||
|
|
||||||
VERIFY_IS_APPROX(q1.coeffs(), q2.coeffs());
|
VERIFY_IS_APPROX(q1.coeffs(), q2.coeffs());
|
||||||
@@ -201,6 +214,23 @@ template<typename Scalar> void mapQuaternion(void){
|
|||||||
if(internal::packet_traits<Scalar>::Vectorizable)
|
if(internal::packet_traits<Scalar>::Vectorizable)
|
||||||
VERIFY_RAISES_ASSERT((MQuaternionA(array3unaligned)));
|
VERIFY_RAISES_ASSERT((MQuaternionA(array3unaligned)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
VERIFY_IS_APPROX(mq1 * (mq1.inverse() * v1), v1);
|
||||||
|
VERIFY_IS_APPROX(mq1 * (mq1.conjugate() * v1), v1);
|
||||||
|
|
||||||
|
VERIFY_IS_APPROX(mcq1 * (mcq1.inverse() * v1), v1);
|
||||||
|
VERIFY_IS_APPROX(mcq1 * (mcq1.conjugate() * v1), v1);
|
||||||
|
|
||||||
|
VERIFY_IS_APPROX(mq3 * (mq3.inverse() * v1), v1);
|
||||||
|
VERIFY_IS_APPROX(mq3 * (mq3.conjugate() * v1), v1);
|
||||||
|
|
||||||
|
VERIFY_IS_APPROX(mcq3 * (mcq3.inverse() * v1), v1);
|
||||||
|
VERIFY_IS_APPROX(mcq3 * (mcq3.conjugate() * v1), v1);
|
||||||
|
|
||||||
|
VERIFY_IS_APPROX(mq1*mq2, q1*q2);
|
||||||
|
VERIFY_IS_APPROX(mq3*mq2, q3*q2);
|
||||||
|
VERIFY_IS_APPROX(mcq1*mq2, q1*q2);
|
||||||
|
VERIFY_IS_APPROX(mcq3*mq2, q3*q2);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Scalar> void quaternionAlignment(void){
|
template<typename Scalar> void quaternionAlignment(void){
|
||||||
|
|||||||
@@ -448,6 +448,29 @@ template<typename Scalar> void transform_alignment()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename Scalar, int Dim, int Options> void transform_products()
|
||||||
|
{
|
||||||
|
typedef Matrix<Scalar,Dim+1,Dim+1> Mat;
|
||||||
|
typedef Transform<Scalar,Dim,Projective,Options> Proj;
|
||||||
|
typedef Transform<Scalar,Dim,Affine,Options> Aff;
|
||||||
|
typedef Transform<Scalar,Dim,AffineCompact,Options> AffC;
|
||||||
|
|
||||||
|
Proj p; p.matrix().setRandom();
|
||||||
|
Aff a; a.linear().setRandom(); a.translation().setRandom();
|
||||||
|
AffC ac = a;
|
||||||
|
|
||||||
|
Mat p_m(p.matrix()), a_m(a.matrix());
|
||||||
|
|
||||||
|
VERIFY_IS_APPROX((p*p).matrix(), p_m*p_m);
|
||||||
|
VERIFY_IS_APPROX((a*a).matrix(), a_m*a_m);
|
||||||
|
VERIFY_IS_APPROX((p*a).matrix(), p_m*a_m);
|
||||||
|
VERIFY_IS_APPROX((a*p).matrix(), a_m*p_m);
|
||||||
|
VERIFY_IS_APPROX((ac*a).matrix(), a_m*a_m);
|
||||||
|
VERIFY_IS_APPROX((a*ac).matrix(), a_m*a_m);
|
||||||
|
VERIFY_IS_APPROX((p*ac).matrix(), p_m*a_m);
|
||||||
|
VERIFY_IS_APPROX((ac*p).matrix(), a_m*p_m);
|
||||||
|
}
|
||||||
|
|
||||||
void test_geo_transformations()
|
void test_geo_transformations()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < g_repeat; i++) {
|
for(int i = 0; i < g_repeat; i++) {
|
||||||
@@ -470,5 +493,9 @@ void test_geo_transformations()
|
|||||||
|
|
||||||
CALL_SUBTEST_6(( transformations<double,Projective,RowMajor|AutoAlign>() ));
|
CALL_SUBTEST_6(( transformations<double,Projective,RowMajor|AutoAlign>() ));
|
||||||
CALL_SUBTEST_6(( transformations<double,Projective,RowMajor|DontAlign>() ));
|
CALL_SUBTEST_6(( transformations<double,Projective,RowMajor|DontAlign>() ));
|
||||||
|
|
||||||
|
|
||||||
|
CALL_SUBTEST_7(( transform_products<double,3,RowMajor|AutoAlign>() ));
|
||||||
|
CALL_SUBTEST_7(( transform_products<float,2,AutoAlign>() ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,25 @@
|
|||||||
#define EIGEN_NO_STATIC_ASSERT
|
#define EIGEN_NO_STATIC_ASSERT
|
||||||
#include "product.h"
|
#include "product.h"
|
||||||
|
|
||||||
|
// regression test for bug 447
|
||||||
|
void product1x1()
|
||||||
|
{
|
||||||
|
Matrix<float,1,3> matAstatic;
|
||||||
|
Matrix<float,3,1> matBstatic;
|
||||||
|
matAstatic.setRandom();
|
||||||
|
matBstatic.setRandom();
|
||||||
|
VERIFY_IS_APPROX( (matAstatic * matBstatic).coeff(0,0),
|
||||||
|
matAstatic.cwiseProduct(matBstatic.transpose()).sum() );
|
||||||
|
|
||||||
|
MatrixXf matAdynamic(1,3);
|
||||||
|
MatrixXf matBdynamic(3,1);
|
||||||
|
matAdynamic.setRandom();
|
||||||
|
matBdynamic.setRandom();
|
||||||
|
VERIFY_IS_APPROX( (matAdynamic * matBdynamic).coeff(0,0),
|
||||||
|
matAdynamic.cwiseProduct(matBdynamic.transpose()).sum() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void test_product_small()
|
void test_product_small()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < g_repeat; i++) {
|
for(int i = 0; i < g_repeat; i++) {
|
||||||
@@ -33,6 +52,7 @@ void test_product_small()
|
|||||||
CALL_SUBTEST_3( product(Matrix3d()) );
|
CALL_SUBTEST_3( product(Matrix3d()) );
|
||||||
CALL_SUBTEST_4( product(Matrix4d()) );
|
CALL_SUBTEST_4( product(Matrix4d()) );
|
||||||
CALL_SUBTEST_5( product(Matrix4f()) );
|
CALL_SUBTEST_5( product(Matrix4f()) );
|
||||||
|
CALL_SUBTEST_6( product1x1() );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EIGEN_TEST_PART_6
|
#ifdef EIGEN_TEST_PART_6
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ struct get_boxes_helper<ObjectList, VolumeList, int> {
|
|||||||
*
|
*
|
||||||
* \param _Scalar The underlying scalar type of the bounding boxes
|
* \param _Scalar The underlying scalar type of the bounding boxes
|
||||||
* \param _Dim The dimension of the space in which the hierarchy lives
|
* \param _Dim The dimension of the space in which the hierarchy lives
|
||||||
* \param _Object The object type that lives in the hierarchy. It must have value semantics. Either internal::bounding_box(_Object) must
|
* \param _Object The object type that lives in the hierarchy. It must have value semantics. Either bounding_box(_Object) must
|
||||||
* be defined and return an AlignedBox<_Scalar, _Dim> or bounding boxes must be provided to the tree initializer.
|
* be defined and return an AlignedBox<_Scalar, _Dim> or bounding boxes must be provided to the tree initializer.
|
||||||
*
|
*
|
||||||
* This class provides a simple (as opposed to optimized) implementation of a bounding volume hierarchy analogous to a Kd-tree.
|
* This class provides a simple (as opposed to optimized) implementation of a bounding volume hierarchy analogous to a Kd-tree.
|
||||||
@@ -92,14 +92,14 @@ public:
|
|||||||
|
|
||||||
KdBVH() {}
|
KdBVH() {}
|
||||||
|
|
||||||
/** Given an iterator range over \a Object references, constructs the BVH. Requires that internal::bounding_box(Object) return a Volume. */
|
/** Given an iterator range over \a Object references, constructs the BVH. Requires that bounding_box(Object) return a Volume. */
|
||||||
template<typename Iter> KdBVH(Iter begin, Iter end) { init(begin, end, 0, 0); } //int is recognized by init as not being an iterator type
|
template<typename Iter> KdBVH(Iter begin, Iter end) { init(begin, end, 0, 0); } //int is recognized by init as not being an iterator type
|
||||||
|
|
||||||
/** Given an iterator range over \a Object references and an iterator range over their bounding boxes, constructs the BVH */
|
/** Given an iterator range over \a Object references and an iterator range over their bounding boxes, constructs the BVH */
|
||||||
template<typename OIter, typename BIter> KdBVH(OIter begin, OIter end, BIter boxBegin, BIter boxEnd) { init(begin, end, boxBegin, boxEnd); }
|
template<typename OIter, typename BIter> KdBVH(OIter begin, OIter end, BIter boxBegin, BIter boxEnd) { init(begin, end, boxBegin, boxEnd); }
|
||||||
|
|
||||||
/** Given an iterator range over \a Object references, constructs the BVH, overwriting whatever is in there currently.
|
/** Given an iterator range over \a Object references, constructs the BVH, overwriting whatever is in there currently.
|
||||||
* Requires that internal::bounding_box(Object) return a Volume. */
|
* Requires that bounding_box(Object) return a Volume. */
|
||||||
template<typename Iter> void init(Iter begin, Iter end) { init(begin, end, 0, 0); }
|
template<typename Iter> void init(Iter begin, Iter end) { init(begin, end, 0, 0); }
|
||||||
|
|
||||||
/** Given an iterator range over \a Object references and an iterator range over their bounding boxes,
|
/** Given an iterator range over \a Object references and an iterator range over their bounding boxes,
|
||||||
|
|||||||
@@ -640,7 +640,7 @@ LevenbergMarquardt<FunctorType,Scalar>::lmdif1(
|
|||||||
|
|
||||||
NumericalDiff<FunctorType> numDiff(functor);
|
NumericalDiff<FunctorType> numDiff(functor);
|
||||||
// embedded LevenbergMarquardt
|
// embedded LevenbergMarquardt
|
||||||
LevenbergMarquardt<NumericalDiff<FunctorType> > lm(numDiff);
|
LevenbergMarquardt<NumericalDiff<FunctorType>, Scalar > lm(numDiff);
|
||||||
lm.parameters.ftol = tol;
|
lm.parameters.ftol = tol;
|
||||||
lm.parameters.xtol = tol;
|
lm.parameters.xtol = tol;
|
||||||
lm.parameters.maxfev = 200*(n+1);
|
lm.parameters.maxfev = 200*(n+1);
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public:
|
|||||||
template<typename T0, typename T1>
|
template<typename T0, typename T1>
|
||||||
NumericalDiff(const T0& a0, const T1& a1) : Functor(a0, a1), epsfcn(0) {}
|
NumericalDiff(const T0& a0, const T1& a1) : Functor(a0, a1), epsfcn(0) {}
|
||||||
template<typename T0, typename T1, typename T2>
|
template<typename T0, typename T1, typename T2>
|
||||||
NumericalDiff(const T0& a0, const T1& a1, const T1& a2) : Functor(a0, a1, a2), epsfcn(0) {}
|
NumericalDiff(const T0& a0, const T1& a1, const T2& a2) : Functor(a0, a1, a2), epsfcn(0) {}
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
InputsAtCompileTime = Functor::InputsAtCompileTime,
|
InputsAtCompileTime = Functor::InputsAtCompileTime,
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ class SparseLU
|
|||||||
void setOrderingMethod(int m)
|
void setOrderingMethod(int m)
|
||||||
{
|
{
|
||||||
eigen_assert( (m&~OrderingMask) == 0 && m!=0 && "invalid ordering method");
|
eigen_assert( (m&~OrderingMask) == 0 && m!=0 && "invalid ordering method");
|
||||||
m_flags = m_flags&~OrderingMask | m&OrderingMask;
|
m_flags = (m_flags & ~OrderingMask) | (m & OrderingMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
int orderingMethod() const
|
int orderingMethod() const
|
||||||
|
|||||||
@@ -24,9 +24,15 @@
|
|||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <Eigen/StdVector>
|
#include <Eigen/StdVector>
|
||||||
|
#include <Eigen/Geometry>
|
||||||
#include <unsupported/Eigen/BVH>
|
#include <unsupported/Eigen/BVH>
|
||||||
|
|
||||||
inline double SQR(double x) { return x * x; }
|
namespace Eigen {
|
||||||
|
|
||||||
|
template<typename Scalar, int Dim> AlignedBox<Scalar, Dim> bounding_box(const Matrix<Scalar, Dim, 1> &v) { return AlignedBox<Scalar, Dim>(v); }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int Dim>
|
template<int Dim>
|
||||||
struct Ball
|
struct Ball
|
||||||
@@ -41,16 +47,10 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(double, Dim)
|
|||||||
VectorType center;
|
VectorType center;
|
||||||
double radius;
|
double radius;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Eigen {
|
|
||||||
namespace internal {
|
|
||||||
|
|
||||||
template<typename Scalar, int Dim> AlignedBox<Scalar, Dim> bounding_box(const Matrix<Scalar, Dim, 1> &v) { return AlignedBox<Scalar, Dim>(v); }
|
|
||||||
template<int Dim> AlignedBox<double, Dim> bounding_box(const Ball<Dim> &b)
|
template<int Dim> AlignedBox<double, Dim> bounding_box(const Ball<Dim> &b)
|
||||||
{ return AlignedBox<double, Dim>(b.center.array() - b.radius, b.center.array() + b.radius); }
|
{ return AlignedBox<double, Dim>(b.center.array() - b.radius, b.center.array() + b.radius); }
|
||||||
|
|
||||||
} // end namespace internal
|
inline double SQR(double x) { return x * x; }
|
||||||
}
|
|
||||||
|
|
||||||
template<int Dim>
|
template<int Dim>
|
||||||
struct BallPointStuff //this class provides functions to be both an intersector and a minimizer, both for a ball and a point and for two trees
|
struct BallPointStuff //this class provides functions to be both an intersector and a minimizer, both for a ball and a point and for two trees
|
||||||
|
|||||||
Reference in New Issue
Block a user