From 2dd7c3bc4a6a49539e9847ec56a69cbf023e7e9b Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Fri, 1 Mar 2019 17:00:55 +0100 Subject: Fix matrix operator[] to allow M[j][k] and operator<< formatting --- test/matrix_example.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/matrix_example.cpp') 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; -- cgit v1.2.1