mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6952a51ba | ||
|
|
0039cd9cf9 | ||
|
|
f074d43f4b | ||
|
|
699c80e404 | ||
|
|
5023afc0af | ||
|
|
8638dbb809 | ||
|
|
8efa5bb439 | ||
|
|
a5a3a994c8 | ||
|
|
ba44761435 | ||
|
|
1a96594607 | ||
|
|
61db9a0e89 |
@@ -168,6 +168,7 @@ template<typename Derived> class MapBase<Derived, ReadOnlyAccessors>
|
||||
template<typename Derived> class MapBase<Derived, WriteAccessors>
|
||||
: public MapBase<Derived, ReadOnlyAccessors>
|
||||
{
|
||||
typedef MapBase<Derived, ReadOnlyAccessors> ReadOnlyMapBase;
|
||||
public:
|
||||
|
||||
typedef MapBase<Derived, ReadOnlyAccessors> Base;
|
||||
@@ -230,15 +231,13 @@ template<typename Derived> class MapBase<Derived, WriteAccessors>
|
||||
|
||||
Derived& operator=(const MapBase& other)
|
||||
{
|
||||
Base::Base::operator=(other);
|
||||
ReadOnlyMapBase::Base::operator=(other);
|
||||
return derived();
|
||||
}
|
||||
|
||||
// In theory MapBase<Derived, ReadOnlyAccessors> should not make a using Base::operator=,
|
||||
// and thus we should directly do: using Base::Base::operator=;
|
||||
// However, this would confuse recent MSVC 2013 (bug 821), and since MapBase<Derived, ReadOnlyAccessors>
|
||||
// has operator= to make ICC 11 happy, we can also make MSVC 2013 happy as follow:
|
||||
using Base::operator=;
|
||||
// In theory we could simply refer to Base:Base::operator=, but MSVC does not like Base::Base,
|
||||
// see bugs 821 and 920.
|
||||
using ReadOnlyMapBase::Base::operator=;
|
||||
};
|
||||
|
||||
#undef EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS
|
||||
|
||||
@@ -110,7 +110,7 @@ template<> EIGEN_STRONG_INLINE Packet2cf ploaddup<Packet2cf>(const std::complex<
|
||||
template<> EIGEN_STRONG_INLINE void pstore <std::complex<float> >(std::complex<float> * to, const Packet2cf& from) { EIGEN_DEBUG_ALIGNED_STORE pstore((float*)to, from.v); }
|
||||
template<> EIGEN_STRONG_INLINE void pstoreu<std::complex<float> >(std::complex<float> * to, const Packet2cf& from) { EIGEN_DEBUG_UNALIGNED_STORE pstoreu((float*)to, from.v); }
|
||||
|
||||
template<> EIGEN_STRONG_INLINE void prefetch<std::complex<float> >(const std::complex<float> * addr) { __pld((float *)addr); }
|
||||
template<> EIGEN_STRONG_INLINE void prefetch<std::complex<float> >(const std::complex<float> * addr) { EIGEN_ARM_PREFETCH((float *)addr); }
|
||||
|
||||
template<> EIGEN_STRONG_INLINE std::complex<float> pfirst<Packet2cf>(const Packet2cf& a)
|
||||
{
|
||||
|
||||
@@ -218,8 +218,8 @@ template<> EIGEN_STRONG_INLINE void pstore<int>(int* to, const Packet4i& f
|
||||
template<> EIGEN_STRONG_INLINE void pstoreu<float>(float* to, const Packet4f& from) { EIGEN_DEBUG_UNALIGNED_STORE vst1q_f32(to, from); }
|
||||
template<> EIGEN_STRONG_INLINE void pstoreu<int>(int* to, const Packet4i& from) { EIGEN_DEBUG_UNALIGNED_STORE vst1q_s32(to, from); }
|
||||
|
||||
template<> EIGEN_STRONG_INLINE void prefetch<float>(const float* addr) { __pld(addr); }
|
||||
template<> EIGEN_STRONG_INLINE void prefetch<int>(const int* addr) { __pld(addr); }
|
||||
template<> EIGEN_STRONG_INLINE void prefetch<float>(const float* addr) { EIGEN_ARM_PREFETCH(addr); }
|
||||
template<> EIGEN_STRONG_INLINE void prefetch<int>(const int* addr) { EIGEN_ARM_PREFETCH(addr); }
|
||||
|
||||
// FIXME only store the 2 first elements ?
|
||||
template<> EIGEN_STRONG_INLINE float pfirst<Packet4f>(const Packet4f& a) { float EIGEN_ALIGN16 x[4]; vst1q_f32(x, a); return x[0]; }
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#define EIGEN_WORLD_VERSION 3
|
||||
#define EIGEN_MAJOR_VERSION 2
|
||||
#define EIGEN_MINOR_VERSION 3
|
||||
#define EIGEN_MINOR_VERSION 4
|
||||
|
||||
#define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \
|
||||
(EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \
|
||||
@@ -313,7 +313,7 @@ namespace Eigen {
|
||||
// just an empty macro !
|
||||
#define EIGEN_EMPTY
|
||||
|
||||
#if defined(_MSC_VER) && (!defined(__INTEL_COMPILER))
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1900) && (!defined(__INTEL_COMPILER))
|
||||
#define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
|
||||
using Base::operator =;
|
||||
#elif defined(__clang__) // workaround clang bug (see http://forum.kde.org/viewtopic.php?f=74&t=102653)
|
||||
|
||||
@@ -466,9 +466,8 @@ template<typename T, bool Align> inline void conditional_aligned_delete_auto(T *
|
||||
template<typename Scalar, typename Index>
|
||||
static inline Index first_aligned(const Scalar* array, Index size)
|
||||
{
|
||||
enum { PacketSize = packet_traits<Scalar>::size,
|
||||
PacketAlignedMask = PacketSize-1
|
||||
};
|
||||
static const Index PacketSize = packet_traits<Scalar>::size;
|
||||
static const Index PacketAlignedMask = PacketSize-1;
|
||||
|
||||
if(PacketSize==1)
|
||||
{
|
||||
|
||||
@@ -313,7 +313,7 @@ namespace Eigen {
|
||||
using std::abs;
|
||||
using std::sqrt;
|
||||
const Index dim=m_S.cols();
|
||||
if (abs(m_S.coeff(i+1,i)==Scalar(0)))
|
||||
if (abs(m_S.coeff(i+1,i))==Scalar(0))
|
||||
return;
|
||||
Index z = findSmallDiagEntry(i,i+1);
|
||||
if (z==i-1)
|
||||
|
||||
@@ -59,7 +59,7 @@ protected:
|
||||
public:
|
||||
|
||||
/** Construct a 2D counter clock wise rotation from the angle \a a in radian. */
|
||||
explicit inline Rotation2D(const Scalar& a) : m_angle(a) {}
|
||||
inline Rotation2D(const Scalar& a) : m_angle(a) {}
|
||||
|
||||
/** Default constructor wihtout initialization. The represented rotation is undefined. */
|
||||
Rotation2D() {}
|
||||
|
||||
@@ -67,10 +67,10 @@ P.rightCols<cols>() // P(:, end-cols+1:end)
|
||||
P.rightCols(cols) // P(:, end-cols+1:end)
|
||||
P.topRows<rows>() // P(1:rows, :)
|
||||
P.topRows(rows) // P(1:rows, :)
|
||||
P.middleRows<rows>(i) // P(:, i+1:i+rows)
|
||||
P.middleRows(i, rows) // P(:, i+1:i+rows)
|
||||
P.bottomRows<rows>() // P(:, end-rows+1:end)
|
||||
P.bottomRows(rows) // P(:, end-rows+1:end)
|
||||
P.middleRows<rows>(i) // P(i+1:i+rows, :)
|
||||
P.middleRows(i, rows) // P(i+1:i+rows, :)
|
||||
P.bottomRows<rows>() // P(end-rows+1:end, :)
|
||||
P.bottomRows(rows) // P(end-rows+1:end, :)
|
||||
P.topLeftCorner(rows, cols) // P(1:rows, 1:cols)
|
||||
P.topRightCorner(rows, cols) // P(1:rows, end-cols+1:end)
|
||||
P.bottomLeftCorner(rows, cols) // P(end-rows+1:end, 1:cols)
|
||||
|
||||
@@ -71,11 +71,10 @@ i.e either row major or column major. The default is column major. Most arithmet
|
||||
<td> Constant or Random Insertion</td>
|
||||
<td>
|
||||
\code
|
||||
sm1.setZero(); // Set the matrix with zero elements
|
||||
sm1.setConstant(val); //Replace all the nonzero values with val
|
||||
sm1.setZero();
|
||||
\endcode
|
||||
</td>
|
||||
<td> The matrix sm1 should have been created before ???</td>
|
||||
<td>Remove all non-zero coefficients</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -98,7 +98,8 @@ template<typename Scalar, int Mode, int Options> void transformations()
|
||||
Matrix3 matrot1, m;
|
||||
|
||||
Scalar a = internal::random<Scalar>(-Scalar(M_PI), Scalar(M_PI));
|
||||
Scalar s0 = internal::random<Scalar>();
|
||||
Scalar s0 = internal::random<Scalar>(),
|
||||
s1 = internal::random<Scalar>();
|
||||
|
||||
while(v0.norm() < test_precision<Scalar>()) v0 = Vector3::Random();
|
||||
while(v1.norm() < test_precision<Scalar>()) v1 = Vector3::Random();
|
||||
@@ -414,6 +415,20 @@ template<typename Scalar, int Mode, int Options> void transformations()
|
||||
t21 = Translation2(v20) * Rotation2D<Scalar>(s0) * Eigen::Scaling(s0);
|
||||
VERIFY_IS_APPROX(t20,t21);
|
||||
|
||||
Rotation2D<Scalar> R0(s0), R1(s1);
|
||||
t20 = Translation2(v20) * (R0 * Eigen::Scaling(s0));
|
||||
t21 = Translation2(v20) * R0 * Eigen::Scaling(s0);
|
||||
VERIFY_IS_APPROX(t20,t21);
|
||||
|
||||
t20 = Translation2(v20) * (R0 * R0.inverse() * Eigen::Scaling(s0));
|
||||
t21 = Translation2(v20) * Eigen::Scaling(s0);
|
||||
VERIFY_IS_APPROX(t20,t21);
|
||||
|
||||
VERIFY_IS_APPROX(s0, (R0.slerp(0, R1)).angle());
|
||||
VERIFY_IS_APPROX(s1, (R0.slerp(1, R1)).angle());
|
||||
VERIFY_IS_APPROX(s0, (R0.slerp(0.5, R0)).angle());
|
||||
VERIFY_IS_APPROX(Scalar(0), (R0.slerp(0.5, R0.inverse())).angle());
|
||||
|
||||
// check basic features
|
||||
{
|
||||
Rotation2D<Scalar> r1; // default ctor
|
||||
|
||||
Reference in New Issue
Block a user