From 18e5da6297639dd15fea0b021d22d394a4ab1852 Mon Sep 17 00:00:00 2001 From: czeidler Date: Sat, 1 Sep 2012 15:41:21 +1200 Subject: [PATCH] Remove unused variable and add copy constructor. --- headers/libs/linprog/Summand.h | 2 +- src/libs/linprog/Summand.cpp | 42 ++++++++++++++++++---------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/headers/libs/linprog/Summand.h b/headers/libs/linprog/Summand.h index 92efe1cb06..8c8ff2c0a6 100644 --- a/headers/libs/linprog/Summand.h +++ b/headers/libs/linprog/Summand.h @@ -19,6 +19,7 @@ class Variable; */ class Summand { public: + Summand(Summand* summand); Summand(double coeff, Variable* var); ~Summand(); @@ -31,7 +32,6 @@ public: private: double fCoeff; Variable* fVar; - bool fUsedInPenaltyFunction; //not set yet }; typedef BObjectList SummandList; diff --git a/src/libs/linprog/Summand.cpp b/src/libs/linprog/Summand.cpp index 1e98e10219..66931de6c8 100644 --- a/src/libs/linprog/Summand.cpp +++ b/src/libs/linprog/Summand.cpp @@ -9,6 +9,28 @@ #include "Variable.h" +Summand::Summand(Summand* summand) + : + fCoeff(summand->Coeff()), + fVar(summand->Var()) +{ +} + + +Summand::Summand(double coeff, Variable* var) + : + fCoeff(coeff), + fVar(var) +{ +} + + +Summand::~Summand() +{ + +} + + /** * Gets the summmand's coefficient. * @@ -62,23 +84,3 @@ Summand::VariableIndex() { return fVar->Index(); } - - -/** - * Destructor. - */ -Summand::~Summand() -{ - -} - - -/** - * Constructor. - */ -Summand::Summand(double coeff, Variable* var) -{ - fCoeff = coeff; - fVar = var; - fUsedInPenaltyFunction = false; -}