From 3679f7fd5160c7d2a8271b1134ca1e601f1a4254 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Thu, 11 Feb 2021 10:33:00 -0500 Subject: [PATCH] add double precision alias declarations and remove typedefs --- matrix/AxisAngle.hpp | 5 +++-- matrix/Dcm.hpp | 5 +++-- matrix/Euler.hpp | 3 ++- matrix/Quaternion.hpp | 11 +++++++---- matrix/Scalar.hpp | 3 ++- matrix/SquareMatrix.hpp | 6 ++++-- matrix/Vector.hpp | 2 +- matrix/Vector2.hpp | 8 +++++--- matrix/Vector3.hpp | 5 +++-- 9 files changed, 30 insertions(+), 18 deletions(-) diff --git a/matrix/AxisAngle.hpp b/matrix/AxisAngle.hpp index d72de6269a..41a9711541 100644 --- a/matrix/AxisAngle.hpp +++ b/matrix/AxisAngle.hpp @@ -30,7 +30,7 @@ template class AxisAngle : public Vector { public: - typedef Matrix Matrix31; + using Matrix31 = Matrix; /** * Constructor from array @@ -152,7 +152,8 @@ public: } }; -typedef AxisAngle AxisAnglef; +using AxisAnglef = AxisAngle; +using AxisAngled = AxisAngle; } // namespace matrix diff --git a/matrix/Dcm.hpp b/matrix/Dcm.hpp index f4a4c3ca68..62bac589f7 100644 --- a/matrix/Dcm.hpp +++ b/matrix/Dcm.hpp @@ -39,7 +39,7 @@ template class Dcm : public SquareMatrix { public: - typedef Matrix Vector3; + using Vector3 = Matrix; /** * Standard constructor @@ -182,7 +182,8 @@ public: } }; -typedef Dcm Dcmf; +using Dcmf = Dcm; +using Dcmd = Dcm; } // namespace matrix diff --git a/matrix/Euler.hpp b/matrix/Euler.hpp index a0b8226cbd..bcaa85753c 100644 --- a/matrix/Euler.hpp +++ b/matrix/Euler.hpp @@ -153,7 +153,8 @@ public: }; -typedef Euler Eulerf; +using Eulerf = Euler; +using Eulerd = Euler; } // namespace matrix diff --git a/matrix/Quaternion.hpp b/matrix/Quaternion.hpp index 5bd23457e5..309cd53952 100644 --- a/matrix/Quaternion.hpp +++ b/matrix/Quaternion.hpp @@ -53,8 +53,8 @@ template class Quaternion : public Vector { public: - typedef Matrix Matrix41; - typedef Matrix Matrix31; + using Matrix41 = Matrix; + using Matrix31 = Matrix; /** * Constructor from array @@ -449,8 +449,11 @@ public: } }; -typedef Quaternion Quatf; -typedef Quaternion Quaternionf; +using Quatf = Quaternion; +using Quaternionf = Quaternion; + +using Quatd = Quaternion; +using Quaterniond = Quaternion; } // namespace matrix diff --git a/matrix/Scalar.hpp b/matrix/Scalar.hpp index c9765028c3..182e0f7786 100644 --- a/matrix/Scalar.hpp +++ b/matrix/Scalar.hpp @@ -50,7 +50,8 @@ private: }; -typedef Scalar Scalarf; +using Scalarf = Scalar; +using Scalard = Scalar; } // namespace matrix diff --git a/matrix/SquareMatrix.hpp b/matrix/SquareMatrix.hpp index 9cb02cddfb..127e89b2f1 100644 --- a/matrix/SquareMatrix.hpp +++ b/matrix/SquareMatrix.hpp @@ -266,7 +266,8 @@ public: }; -typedef SquareMatrix SquareMatrix3f; +using SquareMatrix3f = SquareMatrix; +using SquareMatrix3d = SquareMatrix; template SquareMatrix eye() { @@ -535,7 +536,8 @@ SquareMatrix choleskyInv(const SquareMatrix & A) return L_inv.T()*L_inv; } -typedef SquareMatrix Matrix3f; +using Matrix3f = SquareMatrix; +using Matrix3d = SquareMatrix; } // namespace matrix diff --git a/matrix/Vector.hpp b/matrix/Vector.hpp index 64a9fe54db..09e79d1bbb 100644 --- a/matrix/Vector.hpp +++ b/matrix/Vector.hpp @@ -20,7 +20,7 @@ template class Vector : public Matrix { public: - typedef Matrix MatrixM1; + using MatrixM1 = Matrix; Vector() = default; diff --git a/matrix/Vector2.hpp b/matrix/Vector2.hpp index c12e413d2b..33d0cda467 100644 --- a/matrix/Vector2.hpp +++ b/matrix/Vector2.hpp @@ -21,8 +21,8 @@ class Vector2 : public Vector { public: - typedef Matrix Matrix21; - typedef Vector Vector3; + using Matrix21 = Matrix; + using Vector3 = Vector; Vector2() = default; @@ -71,7 +71,9 @@ public: }; -typedef Vector2 Vector2f; + +using Vector2f = Vector2; +using Vector2d = Vector2; } // namespace matrix diff --git a/matrix/Vector3.hpp b/matrix/Vector3.hpp index 6e8cc601a1..f67ade4618 100644 --- a/matrix/Vector3.hpp +++ b/matrix/Vector3.hpp @@ -30,7 +30,7 @@ class Vector3 : public Vector { public: - typedef Matrix Matrix31; + using Matrix31 = Matrix; Vector3() = default; @@ -148,7 +148,8 @@ public: }; -typedef Vector3 Vector3f; +using Vector3f = Vector3; +using Vector3d = Vector3; } // namespace matrix