Package ket

Examples of ket.Edit


  }


  public void recursiveSubstitute(MathCollection mathCollection) { // CLARIFY
    Vector<Branch> branchVector = getBranchVector(false, Function.WITH);
    Edit e = new Edit(tokenList);
    Collections.reverse(branchVector);
    for (Branch branch : branchVector) {
      Argument first = branch.firstChild();
      if (first==null) return;
      for (int i=1; i<branch.size(); i++) {
        e.setCurrent(first);
        e.substitute(branch.getChild(i));
      }
      e.replace(branch, first);
    }
  }
View Full Code Here


   * Parse raw expressions to avoid hard-coding substitutes while allowing references to 'x' to be replaced with the corresponding variable, x.
   */
  public static Argument parseAs(String argumentString, Argument x) { // "sin(x)", token(q) -> sin(q)
    Argument a = ArgumentParser.parseArgument(argumentString, Ket.KNOWN_ARGUMENTS, null, null);
    if (a==null) return null;
    Edit e = new Edit(a);
    e.substitute(new Token(new Word("x")), x);
    return e.getCurrent();
  }
View Full Code Here

TOP

Related Classes of ket.Edit

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.