Remove unused variable and add copy constructor.

This commit is contained in:
czeidler
2012-09-01 16:31:14 +12:00
parent cf5eb5dda1
commit 18e5da6297
2 changed files with 23 additions and 21 deletions
+1 -1
View File
@@ -19,6 +19,7 @@ class Variable;
*/ */
class Summand { class Summand {
public: public:
Summand(Summand* summand);
Summand(double coeff, Variable* var); Summand(double coeff, Variable* var);
~Summand(); ~Summand();
@@ -31,7 +32,6 @@ public:
private: private:
double fCoeff; double fCoeff;
Variable* fVar; Variable* fVar;
bool fUsedInPenaltyFunction; //not set yet
}; };
typedef BObjectList<Summand> SummandList; typedef BObjectList<Summand> SummandList;
+22 -20
View File
@@ -9,6 +9,28 @@
#include "Variable.h" #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. * Gets the summmand's coefficient.
* *
@@ -62,23 +84,3 @@ Summand::VariableIndex()
{ {
return fVar->Index(); return fVar->Index();
} }
/**
* Destructor.
*/
Summand::~Summand()
{
}
/**
* Constructor.
*/
Summand::Summand(double coeff, Variable* var)
{
fCoeff = coeff;
fVar = var;
fUsedInPenaltyFunction = false;
}