diff --git a/tests/test_TinyMatrix.cpp b/tests/test_TinyMatrix.cpp index 3a03b47f71e9e5491485053870f93ab45349d942..31ded1e245bc026a0a31405ddccca0413717c402 100644 --- a/tests/test_TinyMatrix.cpp +++ b/tests/test_TinyMatrix.cpp @@ -24,6 +24,7 @@ TEST_CASE("TinyMatrix", "[algebra]") (A(1, 2) == 6) and (A(2, 0) == 7) and (A(2, 1) == 8) and (A(2, 2) == 9))); TinyMatrix<3, int> B(6, 5, 3, 8, 34, 6, 35, 6, 7); + SECTION("checking for opposed matrix") { const TinyMatrix<3, int> minus_A = -A; @@ -31,6 +32,7 @@ TEST_CASE("TinyMatrix", "[algebra]") (minus_A(1, 1) == -5) and (minus_A(1, 2) == -6) and (minus_A(2, 0) == -7) and (minus_A(2, 1) == -8) and (minus_A(2, 2) == -9))); } + SECTION("checking for equality and difference tests") { const TinyMatrix<3, int> copy_A = A; @@ -209,14 +211,24 @@ TEST_CASE("TinyMatrix", "[algebra]") REQUIRE(TinyMatrix<1>{}.numberOfRows() == 1); REQUIRE(TinyMatrix<1>{}.numberOfColumns() == 1); REQUIRE(TinyMatrix<1>{}.dimension() == 1); + REQUIRE(TinyMatrix<1>{}.numberOfValues() == 1); REQUIRE(TinyMatrix<2>{}.numberOfRows() == 2); REQUIRE(TinyMatrix<2>{}.numberOfColumns() == 2); - REQUIRE(TinyMatrix<2>{}.dimension() == 4); + REQUIRE(TinyMatrix<2>{}.numberOfValues() == 4); REQUIRE(TinyMatrix<3>{}.numberOfRows() == 3); REQUIRE(TinyMatrix<3>{}.numberOfColumns() == 3); REQUIRE(TinyMatrix<3>{}.dimension() == 9); + REQUIRE(TinyMatrix<3>{}.numberOfValues() == 9); + } + + SECTION("is square matrix") + { + REQUIRE(TinyMatrix<1>{}.isSquare()); + REQUIRE(TinyMatrix<2>{}.isSquare()); + REQUIRE(TinyMatrix<3>{}.isSquare()); + REQUIRE(TinyMatrix<4>{}.isSquare()); } SECTION("checking for matrices output")