From fe32cd6b48e5d17ccfc60f6ea69d1345ae8dfa58 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Fri, 18 Nov 2022 10:12:04 -0500 Subject: fix colmatrix, rowmatrix, sqmatrix private constructors. explicit inherited constructors --- matrix.hpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/matrix.hpp b/matrix.hpp index ada303b..1e84db0 100644 --- a/matrix.hpp +++ b/matrix.hpp @@ -141,6 +141,18 @@ public: template class sqmatrix final : public matrix { +public: + constexpr sqmatrix(const std::array, S> &vs) : + matrix(vs) + {} + + constexpr sqmatrix(const std::array &vs) : + matrix(vs) + {} + + constexpr sqmatrix(T a) : + matrix(a) {} + static constexpr sqmatrix identity() { sqmatrix ret(0); @@ -176,6 +188,14 @@ class sqmatrix final : public matrix template class rowmatrix final : public matrix { +public: + constexpr rowmatrix(const std::array &vs) : + matrix(vs) + {} + + constexpr rowmatrix(T a) : + matrix(a) {} + constexpr T &operator[](std::size_t i) const { return this->v[i]; @@ -189,6 +209,14 @@ class rowmatrix final : public matrix template class colmatrix final : public matrix { +public: + constexpr colmatrix(const std::array &vs) : + matrix(vs) + {} + + constexpr colmatrix(T a) : + matrix(a) {} + constexpr T &operator[](std::size_t i) const { return this->v[i]; -- cgit v1.2.1