KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lsmp > djep > djep > DiffRulesI


1 /* @author rich
2  * Created on 04-Jul-2003
3  *
4  * This code is covered by a Creative Commons
5  * Attribution, Non Commercial, Share Alike license
6  * <a HREF="http://creativecommons.org/licenses/by-nc-sa/1.0">License</a>
7  */

8 package org.lsmp.djep.djep;
9
10 import org.nfunk.jep.ASTFunNode;
11 import org.nfunk.jep.Node;
12 import org.nfunk.jep.ParseException;
13
14
15 /****** Classes to implement the differentation rules **********/
16
17 /**
18  * Holds a set of rules describing how to differentiate a function.
19  * Each function to be differentiated should have a object which implements
20  * this interface.
21  * @author R Morris
22  * Created on 18-Jun-2003
23  */

24 public interface DiffRulesI {
25
26     /**
27      * Returns the top node of of the derivative of this function
28      * wrt to variable var.
29      * @param var The name of variable to differentiate wrt to.
30      * @param children[] the arguments of the function
31      * @param dchildren[] the derivatives of each argument of the function.
32      * @return top node of and expression tree for the derivative.
33      * @throws ParseException if there is some problem in compiling the derivative.
34      */

35     public Node differentiate(ASTFunNode node,String JavaDoc var,Node [] children,Node [] dchildren,DJep djep) throws ParseException;
36
37     /**
38      * Returns a string representation of the rule.
39      */

40     public String JavaDoc toString();
41
42     /**
43      * Returns the name of the function.
44      * Used as index in hashtable and as way of linking with standard JEP functions.
45      * You probably want to specify the in the constructors.
46      */

47     public String JavaDoc getName();
48
49 }
50
Popular Tags