From c4dae2de0452d7b26918b65796a8d592f069bab1 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Thu, 8 Jun 2017 10:56:16 +0100 Subject: Continuing the matrix class --- include/YAGE/Math/matrix.hpp | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/YAGE/Math/matrix.hpp b/include/YAGE/Math/matrix.hpp index 889db336..3b18be0b 100644 --- a/include/YAGE/Math/matrix.hpp +++ b/include/YAGE/Math/matrix.hpp @@ -47,6 +47,16 @@ protected: public: Matrix() : data_(Rows*Cols) {} + int rowSize() + { + return Rows; + } + + int colSize() + { + return Cols; + } + detail::Row operator[](int row) { return detail::Row(this, row); @@ -127,6 +137,10 @@ template class Vector : public Matrix() : Matrix() {} + explicit Vector(const Matrix &other) + { + this->data_=other.data_; + } Type& operator[](int col) { @@ -172,6 +186,21 @@ typedef Vector2 Vector2d; namespace matrix { +template Matrix transpose(const Matrix &m) +{ + static_assert(M!=1, "Called wrong transpose"); +} + +template Vector transpose(const Matrix<1, N, T> &m) +{ + +} + +template T dot(const Vector &v1, const Vector &v2) +{ + +} + template Matrix multiply(const Matrix &m1, const Matrix &m2) { @@ -182,7 +211,14 @@ Matrix multiply(const Matrix &m1, const Matrix &m2) Matrix res; - + for(int i=0; i