mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-27 07:29:52 +08:00
fix AlignedVector3 inconsisent interface with other Vector classes, default constructor and operator- were missing.
This commit is contained in:
parent
bb7ccac3af
commit
11d6465326
@ -78,6 +78,9 @@ template<typename _Scalar> class AlignedVector3
|
|||||||
{ return m_coeffs.coeffRef(index);}
|
{ return m_coeffs.coeffRef(index);}
|
||||||
|
|
||||||
|
|
||||||
|
inline AlignedVector3()
|
||||||
|
{}
|
||||||
|
|
||||||
inline AlignedVector3(const Scalar& x, const Scalar& y, const Scalar& z)
|
inline AlignedVector3(const Scalar& x, const Scalar& y, const Scalar& z)
|
||||||
: m_coeffs(x, y, z, Scalar(0))
|
: m_coeffs(x, y, z, Scalar(0))
|
||||||
{}
|
{}
|
||||||
@ -131,6 +134,9 @@ template<typename _Scalar> class AlignedVector3
|
|||||||
inline AlignedVector3 operator-(const AlignedVector3& other) const
|
inline AlignedVector3 operator-(const AlignedVector3& other) const
|
||||||
{ return AlignedVector3(m_coeffs - other.m_coeffs); }
|
{ return AlignedVector3(m_coeffs - other.m_coeffs); }
|
||||||
|
|
||||||
|
inline AlignedVector3 operator-() const
|
||||||
|
{ return AlignedVector3(-m_coeffs); }
|
||||||
|
|
||||||
inline AlignedVector3 operator-=(const AlignedVector3& other)
|
inline AlignedVector3 operator-=(const AlignedVector3& other)
|
||||||
{ m_coeffs -= other.m_coeffs; return *this; }
|
{ m_coeffs -= other.m_coeffs; return *this; }
|
||||||
|
|
||||||
|
@ -70,6 +70,9 @@ void alignedvector3()
|
|||||||
VERIFY_IS_APPROX(f6,r1-r4);
|
VERIFY_IS_APPROX(f6,r1-r4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FastType f8, f9(0,0,0);
|
||||||
|
VERIFY_IS_APPROX(f9-f1,-f1);
|
||||||
|
|
||||||
std::stringstream ss1, ss2;
|
std::stringstream ss1, ss2;
|
||||||
ss1 << f1;
|
ss1 << f1;
|
||||||
ss2 << r1;
|
ss2 << r1;
|
||||||
|
Loading…
Reference in New Issue
Block a user