Commits

committed 8b48fed

Minor changes to code layout.

• Participants
• Parent commits 70cebbf

Matrix/Matrix/Matrix.h

`     return result;`
` }`
` `
`+template<class T, int Rows, int Cols>`
`+Matrix<T, Rows, Cols> zero_matrix()`
`+{`
`+    Matrix<T, Rows, Cols> result = {};`
`+    return result;`
`+}`
`+`
` #include "MatrixOps.h"`
` `
` template<class T, int Rows, int Cols>`

Matrix/Matrix/MatrixOps.h

`         return m * -1;`
`     }`
` `
`-`
`     template<class T, int Rows, int Cols>`
`     Matrix<T, Rows, Cols> subtract(const Matrix<T, Rows, Cols> &l, const Matrix<T, Rows, Cols> &r)`
`     {`
`     template<class T>`
`     Matrix<T, 3, 1> cross_product(const Matrix<T, 3, 1> &l, const Matrix<T, 3, 1> &r)`
`     {`
`-        Matrix<T, 3, 1> result;`
`-`
`-        result(0) = l(1) * r(2) - l(2) * r(1);`
`-        result(1) = l(2) * r(0) - l(0) * r(2);`
`-        result(2) = l(0) * r(1) - l(1) * r(0);`
`-`
`+        Matrix<T, 3, 1> result = {`
`+            l(1) * r(2) - l(2) * r(1),`
`+            l(2) * r(0) - l(0) * r(2),`
`+            l(0) * r(1) - l(1) * r(0)`
`+        };`
`         return result;`
`     }`
` `
`     template<class T>`
`     Matrix<T, 1, 3> cross_product(const Matrix<T, 1, 3> &l, const Matrix<T, 1, 3> &r)`
`     {`
`-        Matrix<T, 1, 3> result;`
`-`
`-        result(0) = l(1) * r(2) - l(2) * r(1);`
`-        result(1) = l(2) * r(0) - l(0) * r(2);`
`-        result(2) = l(0) * r(1) - l(1) * r(0);`
`-`
`+        Matrix<T, 1, 3> result = {`
`+            l(1) * r(2) - l(2) * r(1),`
`+            l(2) * r(0) - l(0) * r(2),`
`+            l(0) * r(1) - l(1) * r(0)`
`+        };`
`         return result;`
`     }`
` `

Matrix/MatrixTests/MatrixTests.cpp

` `
` BOOST_AUTO_TEST_CASE( test_subtract )`
` {`
`-    Matrix<int, 3, 3> zero = {};`
`+    Matrix<int, 3, 3> zero = zero_matrix<int, 3, 3>();`
` `
`     Matrix<int, 3, 3> a = {0, 1, 2, `
`                            3, 4, 5, `
` `
` BOOST_AUTO_TEST_CASE( test_add )`
` {`
`-    Matrix<int, 3, 3> zero = {};`
`+    Matrix<int, 3, 3> zero = zero_matrix<int, 3, 3>();`
` `
`     Matrix<int, 3, 3> a = {0, 1, 2, `
`                            3, 4, 5, `