KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* @author rich
2  * Created on 23-Nov-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.*;
11 import org.lsmp.djep.xjep.*;
12 import java.util.*;
13 /**
14  * A SymbolTable which works with partial derivatives of variables.
15  * Closely linked with
16  * {@link DVariableFactory DVariableFactory}
17  *
18  * @author Rich Morris
19  * Created on 23-Nov-2003
20  */

21 public class DSymbolTable extends XSymbolTable {
22     public DSymbolTable(VariableFactory varFac)
23     {
24         super(varFac);
25     }
26
27     /** Creates a new SymbolTable with the same variable factory as this. */
28     public SymbolTable newInstance()
29     {
30         return new DSymbolTable(vf);
31     }
32
33     public PartialDerivative getPartialDeriv(String JavaDoc name,String JavaDoc dnames[])
34     {
35         DVariable var = (DVariable) getVar(name);
36         return var.getDerivative(dnames);
37     }
38     
39
40     public void clearValues()
41     {
42         for(Enumeration e = this.elements(); e.hasMoreElements(); )
43         {
44             DVariable var = (DVariable) e.nextElement();
45             var.invalidateAll();
46         }
47     }
48 }
49
Popular Tags