Skip to content

Commit 5bcfa9a

Browse files
author
Alexandre Hoffmann
committed
formater corrected
1 parent def6115 commit 5bcfa9a

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

include/FSLinalg/Matrix/Formater.hpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,40 +21,42 @@ class fmt::formatter< Expr > : public fmt::formatter< typename FSLinalg::MatrixB
2121
Size rowsM1 = Size(A.getRows()-1);
2222
Size colsM1 = Size(A.getCols()-1);
2323

24+
auto out = ctx.out();
25+
2426
if constexpr (Expr::isRowVector or Expr::isColVector)
2527
{
26-
ctx.out() = format_to(ctx.out(), "[");
28+
out = format_to(out, "[");
2729
for (Size i=0; i!=Size(A.getSize()-1); ++i)
2830
{
29-
ctx.out() = format_to(ctx.out(), "{}, ", A[i]);
31+
out = format_to(out, "{}, ", A[i]);
3032
}
3133
if constexpr (Expr::isRowVector)
3234
{
33-
return format_to(ctx.out(), "{}]^T", A[Size(A.getSize()-1)]);
35+
return format_to(out, "{}]^T", A[Size(A.getSize()-1)]);
3436
}
3537
else
3638
{
37-
return format_to(ctx.out(), "{}]", A[Size(A.getSize()-1)]);
39+
return format_to(out, "{}]", A[Size(A.getSize()-1)]);
3840
}
3941
}
4042
else
4143
{
42-
ctx.out() = format_to(ctx.out(), "[");
44+
out = format_to(out, "[");
4345
for (Size i=0; i!=rowsM1; ++i)
4446
{
45-
ctx.out() = format_to(ctx.out(), "[");
47+
out = format_to(out, "[");
4648
for (Size j=0; j!=colsM1; ++j)
4749
{
48-
ctx.out() = format_to(ctx.out(), "{}, ", A(i,j));
50+
out = format_to(out, "{}, ", A(i,j));
4951
}
50-
ctx.out() = format_to(ctx.out(), "{}]\n", A(i, colsM1));
52+
out = format_to(out, "{}]\n", A(i, colsM1));
5153
}
52-
ctx.out() = format_to(ctx.out(), "[");
54+
out = format_to(out, "[");
5355
for (Size j=0; j!=colsM1; ++j)
5456
{
55-
ctx.out() = format_to(ctx.out(), "{}, ", A(rowsM1,j));
57+
out = format_to(out, "{}, ", A(rowsM1,j));
5658
}
57-
return format_to(ctx.out(), "{}]]", A(rowsM1,colsM1));
59+
return format_to(out, "{}]]", A(rowsM1,colsM1));
5860
}
5961
}
6062
};

0 commit comments

Comments
 (0)