From 4a02997484f77f5d3369a8e0b1960aed5679a31d Mon Sep 17 00:00:00 2001 From: Tiago Gomes Date: Mon, 28 May 2012 12:34:39 +0100 Subject: [PATCH] be consistent: s/copy/backup --- packages/CLPBN/horus/Parfactor.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/CLPBN/horus/Parfactor.cpp b/packages/CLPBN/horus/Parfactor.cpp index 36d86b66b..417b7c0ff 100644 --- a/packages/CLPBN/horus/Parfactor.cpp +++ b/packages/CLPBN/horus/Parfactor.cpp @@ -629,7 +629,7 @@ Parfactor::expandPotential ( abort(); } - Params copy = params_; + Params backup = params_; params_.clear(); params_.reserve (newSize); @@ -644,11 +644,8 @@ Parfactor::expandPotential ( ranges_[fIdx] = newRange; vector indices (ranges_.size(), 0); for (size_t k = 0; k < newSize; k++) { - if (index >= copy.size()) { - abort(); - } - assert (index < copy.size()); - params_.push_back (copy[index]); + assert (index < backup.size()); + params_.push_back (backup[index]); for (size_t i = ranges_.size(); i-- > 0; ) { indices[i] ++; if (i == fIdx) { @@ -738,12 +735,12 @@ Parfactor::canMultiply (Parfactor* g1, Parfactor* g2) void Parfactor::simplifyParfactor (size_t fIdx1, size_t fIdx2) { - Params copy = params_; + Params backup = params_; params_.clear(); Indexer indexer (ranges_); while (indexer.valid()) { if (indexer[fIdx1] == indexer[fIdx2]) { - params_.push_back (copy[indexer]); + params_.push_back (backup[indexer]); } ++ indexer; }