1 /******************************************************************************* 2 * tests/common/matrix_test.cpp 3 * 4 * Part of Project Thrill - http://project-thrill.org 5 * 6 * Copyright (C) 2015 Timo Bingmann <tb@panthema.net> 7 * 8 * All rights reserved. Published under the BSD-2 license in the LICENSE file. 9 ******************************************************************************/ 10 11 #include <gtest/gtest.h> 12 #include <thrill/common/logger.hpp> 13 #include <thrill/common/matrix.hpp> 14 15 #include <vector> 16 17 using namespace thrill; 18 TEST(Matrix,Simple)19TEST(Matrix, Simple) { 20 using DMatrix = common::Matrix<double>; 21 DMatrix matrix1(4); 22 23 matrix1(0, 0) = 1; 24 matrix1(1, 1) = 1; 25 matrix1(2, 2) = 1; 26 matrix1(3, 3) = 1; 27 28 DMatrix matrix2 = matrix1; 29 matrix2 = matrix1 + matrix2; 30 31 matrix1 *= 2; 32 33 ASSERT_EQ(matrix2, matrix1); 34 } 35 36 /******************************************************************************/ 37