Exemple #1
0
  /** Treat the function as complex. */
  public void simplify() {

    String name = proxy.getName();

    try {
      simp = jep.simplify(processed);
    } catch (ParseException e) {
    } catch (Exception e) {
      ErrorMessage("Error in simplification of " + name);
    }
  }
  public void simplifyTestString(String expr, String expected) throws ParseException {
    XJep xj = (XJep) j;

    Node node = xj.parse(expr);
    Node processed = xj.preprocess(node);
    Node simp = xj.simplify(processed);
    String res = xj.toString(simp);

    if (!expected.equals(res))
      System.out.println(
          "Error: Value of \"" + expr + "\" is \"" + res + "\" should be \"" + expected + "\"");
    assertEquals("<" + expr + ">", expected, res);
    System.out.println("Success: Value of \"" + expr + "\" is \"" + res + "\"");
  }