From e3784ef489842bbf8f4becc34da16f43eb64d852 Mon Sep 17 00:00:00 2001 From: Mathieu Giraud Date: Tue, 31 Oct 2017 17:19:10 +0100 Subject: [PATCH] core/dynprog.{cpp,h}: output costs in the format expected by -f and -C See #2076. --- algo/core/dynprog.cpp | 8 ++++++++ algo/core/dynprog.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/algo/core/dynprog.cpp b/algo/core/dynprog.cpp index 527c278ef..370f6e319 100644 --- a/algo/core/dynprog.cpp +++ b/algo/core/dynprog.cpp @@ -90,6 +90,7 @@ void Cost::estimate_K_lambda() ostream& operator<<(ostream& out, const Cost& cost) { + if (cost.debug) out << "(" << cost.match << ", " << cost.mismatch << "/" << cost.insertion @@ -100,6 +101,13 @@ ostream& operator<<(ostream& out, const Cost& cost) << ", " << cost.homopolymer << ") " << cost.K << "/" << cost.lambda ; + else + out << "\"" << cost.match + << ", " << cost.mismatch + << ", " << cost.insertion + << ", " << cost.homopolymer + << ", " << cost.deletion_end + << "\"" ; return out; } diff --git a/algo/core/dynprog.h b/algo/core/dynprog.h index 9717ef06b..9cbe2034e 100644 --- a/algo/core/dynprog.h +++ b/algo/core/dynprog.h @@ -26,6 +26,8 @@ typedef struct { class Cost { public: + bool debug = false; + int match; int mismatch; -- GitLab