diff options
author | Gael Guennebaud <g.gael@free.fr> | 2008-08-23 19:32:13 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2008-08-23 19:32:13 +0000 |
commit | c3f46cf55b7fab237edb379f501aecc619dc0038 (patch) | |
tree | d9d59929e9a4cf88cfd976ea2435baaa45495680 | |
parent | 2f6815df8e2a9e87cb81876d3eb3484fe5f5af15 (diff) |
need to commit this file before changing its name
-rw-r--r-- | doc/snippets/PrintWithFormat.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/snippets/PrintWithFormat.h b/doc/snippets/PrintWithFormat.h new file mode 100644 index 000000000..d052cf875 --- /dev/null +++ b/doc/snippets/PrintWithFormat.h @@ -0,0 +1,14 @@ +std::string sep = "\n----------------------------------------\n"; +Matrix3f m1; +m1 << 0, 1.111111, 2, 3.33333, 4, 5, 6, 7, 8.888888, 9; + +IOFormat CommaInitFmt(4, Raw, ", ", ", ", "", "", " << ", ";"); +IOFormat CleanFmt(4, AlignCols, ", ", "\n", "[", "]"); +IOFormat OctaveFmt(4, AlignCols, ", ", ";\n", "", "", "[", "]"); +IOFormat HeavyFmt(4, AlignCols, ", ", ";\n", "[", "]", "[", "]"); + +std::cout << m1 << sep; +std::cout << m1.format(CommaInitFmt) << sep; +std::cout << m1.format(CleanFmt) << sep; +std::cout << m1.format(OctaveFmt) << sep; +std::cout << m1.format(HeavyFmt) << sep; |