HaikuDepot: notify work status from main window
[haiku.git] / src / libs / linprog / Summand.cpp
blob66931de6c8c14d3a35ffb383cea797890d87131d
1 /*
2 * Copyright 2007-2008, Christof Lutteroth, lutteroth@cs.auckland.ac.nz
3 * Copyright 2007-2008, James Kim, jkim202@ec.auckland.ac.nz
4 * Distributed under the terms of the MIT License.
5 */
7 #include "LinearSpec.h"
8 #include "Summand.h"
9 #include "Variable.h"
12 Summand::Summand(Summand* summand)
14 fCoeff(summand->Coeff()),
15 fVar(summand->Var())
20 Summand::Summand(double coeff, Variable* var)
22 fCoeff(coeff),
23 fVar(var)
28 Summand::~Summand()
34 /**
35 * Gets the summmand's coefficient.
37 * @return the summand's coefficient
39 double
40 Summand::Coeff()
42 return fCoeff;
46 /**
47 * Sets the summmand's coefficient.
49 * @param coeff coefficient
51 void
52 Summand::SetCoeff(double coeff)
54 fCoeff = coeff;
58 /**
59 * Gets the summand's variable.
61 * @return the summand's variable
63 Variable*
64 Summand::Var()
66 return fVar;
70 /**
71 * Sets the summand's variable.
73 * @param var variable
75 void
76 Summand::SetVar(Variable* var)
78 fVar = var;
82 int32
83 Summand::VariableIndex()
85 return fVar->Index();