From 79451fe868d3d11c0294383a2ddab95b40a0a4ce Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Sun, 24 Jun 2007 18:07:10 +0000 Subject: [PATCH] renamed a function and removed some debug output --- src/genesorter.cpp | 6 ++---- src/genesorter.h | 5 ++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/genesorter.cpp b/src/genesorter.cpp index 03f19db..d73f176 100644 --- a/src/genesorter.cpp +++ b/src/genesorter.cpp @@ -35,7 +35,6 @@ GeneSorter::ActionList GeneSorter::sort(const GeneOrder& go){ ActionList al; GeneOrder temp(go); while(inversionDistance(temp) > 0){ - cout << "AL: " << al.size() << " : "; cout << "Distance: " << inversionDistance(temp) << " : "; copy(temp.begin(), temp.end(), ostream_iterator(cout, " ")); cout << endl; @@ -43,7 +42,6 @@ GeneSorter::ActionList GeneSorter::sort(const GeneOrder& go){ if (safe.size() > 0){ safe[0](temp); al.push_back(safe[0]); - cout << "AL: " << al.size() << " : "; }else return ActionList(); //TODO: Need to handle hurdles. } @@ -69,7 +67,7 @@ GeneSorter::ActionList GeneSorter::safeActions(const GeneOrder& go){ for (size_t i = 0; i < intervals.size(); ++i){ if (intervals[i].oriented && intervals[i].first != intervals[i].second){ SortAction sa(new ReverseAction(intervals[i])); - size_t score = scoreActions(go,sa); + size_t score = scoreAction(go,sa); cout << "Inversion: " << min(intervals[i].first,intervals[i].second) << ":" << max(intervals[i].first,intervals[i].second)-1 << " Score: " << score << endl; pq.push(pair(score,sa)); } @@ -81,7 +79,7 @@ GeneSorter::ActionList GeneSorter::safeActions(const GeneOrder& go){ return al; } -size_t GeneSorter::scoreActions(const GeneOrder& go, SortAction& sa){ +size_t GeneSorter::scoreAction(const GeneOrder& go, SortAction& sa){ GeneOrder temp(go); sa(temp); vector intervals = findIntervals(temp); diff --git a/src/genesorter.h b/src/genesorter.h index 4380e99..e06bedf 100644 --- a/src/genesorter.h +++ b/src/genesorter.h @@ -46,7 +46,10 @@ class GeneSorter{ */ ActionList safeActions(const GeneOrder& go1); - size_t scoreActions(const GeneOrder& go, SortAction& sa); + /** + * Calculates the score for an action given a gene order + */ + size_t scoreAction(const GeneOrder& go, SortAction& sa); ~GeneSorter(){}; }; -- 2.39.2