コード例 #1
0
 /**
  * Create a differention rule for function with 1 argument
  *
  * @param inName name of function
  * @param node a tree represention differation of function wrt "x"
  * @throws ParseException
  */
 public MacroDiffRules(DJep djep, String inName, Node node) throws ParseException {
   name = inName;
   pfmc = djep.getFunctionTable().get(inName);
   if (pfmc != null) {
     int nParam = pfmc.getNumberOfParameters();
     if (nParam != 1) {
       throw new ParseException(
           "Number of rules must match number of parameters for "
               + inName
               + " which is "
               + nParam);
     }
   }
   rules = new Node[1];
   rules[0] = node;
 }
コード例 #2
0
 /**
  * Create a differention rule for function with 1 argument
  *
  * @param inName name of function
  * @param rule a string represention differation of a function wrt "x"
  * @throws ParseException
  */
 public MacroDiffRules(DJep djep, String inName, String rule) throws ParseException {
   this(djep, inName, djep.getFunctionTable().get(inName), rule);
 }