From e2ca97c8de82669b71e3a0b36cd758d7ad131c66 Mon Sep 17 00:00:00 2001 From: Tiago Gomes Date: Thu, 21 Mar 2013 21:20:28 +0000 Subject: [PATCH] Factor: use the default copy constructor --- packages/CLPBN/horus/Factor.cpp | 20 +------------------- packages/CLPBN/horus/Factor.h | 6 ------ 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/packages/CLPBN/horus/Factor.cpp b/packages/CLPBN/horus/Factor.cpp index 66061e4dd..b72d78536 100644 --- a/packages/CLPBN/horus/Factor.cpp +++ b/packages/CLPBN/horus/Factor.cpp @@ -11,13 +11,6 @@ namespace Horus { -Factor::Factor (const Factor& g) -{ - clone (g); -} - - - Factor::Factor ( const VarIds& vids, const Ranges& ranges, @@ -102,7 +95,7 @@ void Factor::multiply (Factor& g) { if (args_.empty()) { - clone (g); + *this = g; } else { GenericFactor::multiply (g); } @@ -228,16 +221,5 @@ Factor::sumOutArgs (const std::vector& mask) params_ = newps; } - - -void -Factor::clone (const Factor& g) -{ - args_ = g.arguments(); - ranges_ = g.ranges(); - params_ = g.params(); - distId_ = g.distId(); -} - } // namespace Horus diff --git a/packages/CLPBN/horus/Factor.h b/packages/CLPBN/horus/Factor.h index 7f95e3292..a1feaf989 100644 --- a/packages/CLPBN/horus/Factor.h +++ b/packages/CLPBN/horus/Factor.h @@ -16,8 +16,6 @@ class Factor : public GenericFactor { public: Factor() { } - Factor (const Factor&); - Factor (const VarIds&, const Ranges&, const Params&, unsigned = Util::maxUnsigned()); @@ -44,10 +42,6 @@ class Factor : public GenericFactor { void sumOutLastVariable(); void sumOutArgs (const std::vector& mask); - - void clone (const Factor& f); - - DISALLOW_ASSIGN (Factor); }; } // namespace Horus