ret.solution = new double[numVariables][1];
List<Variable> equationVariable;
Variable variable;
Equation incorporating;
for (int i = 0; i < ret.body.length; i++) {
if (this.equations.containsKey(allVariablesList.get(i))) {
incorporating = this.equations.get(allVariablesList.get(i));
equationVariable = incorporating.getVariables();
ret.body[i][i] = 1;
ret.solution[i][0] = incorporating.getRightHandSide();
for (int j = 0; j < equationVariable.size(); j++) {
variable = equationVariable.get(j);
ret.body[i][allVariablesList.indexOf(variable)] = incorporating.getCoefficient(variable);
}
} else {
ret.body[i][i] = 1;
}