Remove unused variable and add copy constructor.
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user