]> git.tdb.fi Git - libs/math.git/blobdiff - source/linal/matrix.h
Add missing return statements
[libs/math.git] / source / linal / matrix.h
index 6c04454296e51ae2162e0534f1def87fa379afac..f18eb2f4cfb52504214b84015688e46d0d7be121 100644 (file)
@@ -8,7 +8,7 @@ namespace Msp {
 namespace LinAl {
 
 /**
-A general mathematical matrix.
+A general mathematical matrix with M rows and N columns.
 */
 template<typename T, unsigned M, unsigned N>
 class Matrix
@@ -68,6 +68,7 @@ inline Matrix<T, M, N> Matrix<T, M, N>::from_columns(const Vector<T, M> *v)
        for(unsigned i=0; i<M; ++i)
                for(unsigned j=0; j<N; ++j)
                        m(i, j) = v[j][i];
+       return m;
 }
 
 template<typename T, unsigned M, unsigned N>
@@ -77,6 +78,7 @@ inline Matrix<T, M, N> Matrix<T, M, N>::from_rows(const Vector<T, N> *v)
        for(unsigned i=0; i<M; ++i)
                for(unsigned j=0; j<N; ++j)
                        m(i, j) = v[i][j];
+       return m;
 }
 
 template<typename T, unsigned M, unsigned N>