Package edu.cmu.relativelayout.equation

Examples of edu.cmu.relativelayout.equation.Equation


   * Returns a set containing all variables that have been added to this matrix.
   */
  private Set<Variable> getAllVariables() {
    Iterator<Equation> equationsList = this.equations.values().iterator();
    HashSet<Variable> variables = new HashSet<Variable>();
    Equation incorporating;

    while (equationsList.hasNext()) {
      incorporating = equationsList.next();
      variables.addAll(incorporating.getVariables());
    }
    return variables;
  }
View Full Code Here


    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;
      }
View Full Code Here

TOP

Related Classes of edu.cmu.relativelayout.equation.Equation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.