Exemplo n.º 1
0
  /**
   * Initialize function from proxy.
   *
   * @param f
   */
  public FND(FProxy f) {
    proxy = f;
    String name = proxy.getName();
    if (proxy.getType() != 4) {
      ErrorMessage("Error in parsing FND. Wrong type! " + name);
      return;
    }

    setTitle(proxy.getTitle());
    lpp.setType(LinePars.F1D);
    jep = new XJep();
    jep.addStandardConstants();
    jep.addStandardFunctions();
    jep.setAllowUndeclared(true);
    jep.setImplicitMul(true);
    jep.setAllowAssignment(true);

    // get all variables
    String vars = proxy.getVariables();
    avars = vars.split(",");
    for (int i = 0; i < avars.length; i++) {
      jep.addVariable(avars[i].trim(), 0);
    }

    jep.addVariable("x", 0);

    try {
      node = jep.parse(name);
      processed = jep.preprocess(node);
    } catch (ParseException e) {
    } catch (Exception e) {
      ErrorMessage("Error in parsing " + name);
    }
  }
Exemplo n.º 2
0
 /**
  * Get arguments of the function (independent variables).
  *
  * @return arguments
  */
 public String getVarString() {
   return proxy.getVariables();
 }