KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lsmp > djep > matrixJep > MatrixPartialDerivative


1 /* @author rich
2  * Created on 29-Oct-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.matrixJep;
9 import org.nfunk.jep.*;
10 import org.lsmp.djep.djep.*;
11 import org.lsmp.djep.vectorJep.*;
12 import org.lsmp.djep.vectorJep.values.*;
13 /**
14  * Contains infomation about a PartialDerivative of a variable.
15  *
16  * @author Rich Morris
17  * Created on 29-Oct-2003
18  * TODO Should setValue be overwritten?
19  */

20 public class MatrixPartialDerivative extends PartialDerivative implements MatrixVariableI {
21
22     private MatrixValueI mvalue = null;
23
24     /**
25      * Protected constructor, should only be constructed
26      * through the findDerivative method in {@link MatrixVariable}.
27     **/

28     protected MatrixPartialDerivative(MatrixVariable var, String JavaDoc derivnames[],Node deriv)
29     {
30         super(var,derivnames,deriv);
31         setValidValue(false);
32         mvalue=Tensor.getInstance(var.getDimensions());
33     }
34     
35     public Dimensions getDimensions()
36     {
37         MatrixVariableI root = (MatrixVariableI) getRoot();
38         return root.getDimensions();
39     }
40     public void setDimensions(Dimensions dims) {}
41     public MatrixValueI getMValue() { return mvalue; }
42
43     public void setMValue(MatrixValueI val) {
44         if(this.isConstant()) return;
45         mvalue.setEles(val);
46         setValidValue(true);
47         setChanged();
48         notifyObservers();
49     }
50 // public void setMValue(VectorMatrixTensorI value)
51
// { this.mvalue = value; setValidValue(true); }
52
}
53
Popular Tags