diff options
author | Nao Pross <naopross@thearcway.org> | 2019-03-01 17:00:55 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2019-03-01 17:11:40 +0100 |
commit | 2dd7c3bc4a6a49539e9847ec56a69cbf023e7e9b (patch) | |
tree | 18c5abf82f63080c80b6f6533e91f16244872087 /test/matrix_example.cpp | |
parent | Change storage for matrix to std::array, update matrix_example (diff) | |
download | libmm-2dd7c3bc4a6a49539e9847ec56a69cbf023e7e9b.tar.gz libmm-2dd7c3bc4a6a49539e9847ec56a69cbf023e7e9b.zip |
Fix matrix operator[] to allow M[j][k] and operator<< formatting
Diffstat (limited to 'test/matrix_example.cpp')
-rw-r--r-- | test/matrix_example.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/matrix_example.cpp b/test/matrix_example.cpp index 4cf1863..26aeede 100644 --- a/test/matrix_example.cpp +++ b/test/matrix_example.cpp @@ -12,6 +12,10 @@ int main(int argc, char *argv[]) { std::cout << "a = \n" << a; std::cout << "b = \n" << b; std::cout << "c = \n" << c; + + // access elements + std::cout << "a.at(2,0) = " << a.at(2, 0) << std::endl; + std::cout << "a[2][0] = " << a[2][0] << std::endl;; // basic operations std::cout << "a + b = \n" << a + b; |