Skip to content
Snippets Groups Projects
Commit 02896fda authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Remove the special case for TinyMatrix<1> output for consistency

It has now the same behavior as TinyVector
parent 206752a2
No related branches found
No related tags found
1 merge request!71Feature/language tiny matrices
This commit is part of merge request !71. Comments created here will be created in the context of that merge request.
......@@ -121,9 +121,6 @@ class [[nodiscard]] TinyMatrix
PUGS_INLINE
constexpr friend std::ostream& operator<<(std::ostream& os, const TinyMatrix& A)
{
if constexpr (N == 1) {
os << A(0, 0);
} else {
os << '[';
for (size_t i = 0; i < N; ++i) {
os << '(' << A(i, 0);
......@@ -133,7 +130,7 @@ class [[nodiscard]] TinyMatrix
os << ')';
}
os << ']';
}
return os;
}
......
......@@ -220,7 +220,7 @@ TEST_CASE("TinyMatrix", "[algebra]")
SECTION("checking for matrices output")
{
REQUIRE(Catch::Detail::stringify(A) == "[(1,2,3)(4,5,6)(7,8,9)]");
REQUIRE(Catch::Detail::stringify(TinyMatrix<1, int>(7)) == "7");
REQUIRE(Catch::Detail::stringify(TinyMatrix<1, int>(7)) == "[(7)]");
}
#ifndef NDEBUG
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment