text stringlengths 3 1.18M |
|---|
/* @author rich
* Created on 26-Nov-2003
*/
package org.lsmp.djep.matrixJep;
import org.nfunk.jep.*;
import org.lsmp.djep.matrixJep.nodeTypes.*;
import org.lsmp.djep.vectorJep.values.*;
/**
* If a function requires a special form of evaluation it should
* implement this interface.
*
* @author Rich M... |
/* @author rich
* Created on 16-Nov-2003
*/
package org.lsmp.djep.matrixJep;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
import org.lsmp.djep.matrixJep.nodeTypes.*;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.function.*;
import org.lsmp.djep.xjep.*;
/**
* This class is ... |
/* @author rich
* Created on 30-Oct-2003
*/
package org.lsmp.djep.matrixJep;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
import org.lsmp.djep.djep.*;
import org.lsmp.djep.xjep.*;
import org.lsmp.djep.matrixJep.nodeTypes.*;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.functio... |
/* @author rich
* Created on 18-Jun-2003
*/
package org.lsmp.djep.djep;
import org.lsmp.djep.djep.diffRules.*;
import org.lsmp.djep.xjep.*;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
import java.util.Hashtable;
import java.util.Enumeration;
import java.io.PrintStream;
/**
* A class f... |
/* @author rich
* Created on 16-Nov-2003
*/
package org.lsmp.djep.djep;
import org.lsmp.djep.djep.diffRules.DivideDiffRule;
import org.lsmp.djep.djep.diffRules.MacroDiffRules;
import org.lsmp.djep.djep.diffRules.MacroFunctionDiffRules;
import org.lsmp.djep.djep.diffRules.MultiplyDiffRule;
import org.lsmp.djep... |
/* @author rich
* Created on 04-Jul-2003
*/
package org.lsmp.djep.djep;
import java.util.Stack;
import org.lsmp.djep.xjep.*;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
/**
* The diff(f,x) operator.
*/
public class Diff extends PostfixMathCommand implements CommandVisitorI
{... |
/* @author rich
* Created on 19-Dec-2003
*/
package org.lsmp.djep.djep;
import org.nfunk.jep.Variable;
import org.nfunk.jep.*;
import org.lsmp.djep.xjep.*;
/**
* A VariableFactory which can work with PartialDerivatives.
* @author Rich Morris
* Created on 19-Dec-2003
*/
public class DVariableFactory ... |
/* @author rich
* Created on 29-Oct-2003
*/
package org.lsmp.djep.djep;
import org.nfunk.jep.*;
import org.lsmp.djep.xjep.*;
import java.util.Observable;
import java.util.Observer;
/**
* Contains infomation about a PartialDerivative of a variable.
* Should
* @author Rich Morris
* Created on 29-Oct... |
/* @author rich
* Created on 26-Oct-2003
*/
package org.lsmp.djep.djep;
import java.util.*;
import org.nfunk.jep.*;
import org.lsmp.djep.xjep.*;
/**
* Holds all info about a variable.
* Has a name, an equation, a dimension (or sent of dimensions if matrix or tensor)
* and also a set of {@link PartialDe... |
/* @author rich
* Created on 26-Feb-2004
*/
package org.lsmp.djep.djep;
import org.nfunk.jep.*;
import org.lsmp.djep.xjep.PrintVisitor;
/**
* An extension of PrintVisitor which will print the equations of a variable if required.
* The behaviours of this class is determined by two modes
* PRINT_PARTIAL_E... |
/* @author rich
* Created on 23-Nov-2003
*/
package org.lsmp.djep.djep;
import org.nfunk.jep.*;
import org.lsmp.djep.xjep.*;
import java.util.*;
/**
* A SymbolTable which works with partial derivatives of variables.
* Closely linked with
* {@link DVariableFactory DVariableFactory}
*
* @author R... |
/* @author rich
* Created on 04-Jul-2003
*/
package org.lsmp.djep.djep;
import org.nfunk.jep.ASTFunNode;
import org.nfunk.jep.Node;
import org.nfunk.jep.ParseException;
/****** Classes to implement the differentation rules **********/
/**
* Holds a set of rules describing how to differentiate a func... |
/* @author rich
* Created on 04-Jul-2003
*/
package org.lsmp.djep.djep.diffRules;
import org.lsmp.djep.djep.DJep;
import org.lsmp.djep.djep.DiffRulesI;
import org.lsmp.djep.xjep.*;
import org.nfunk.jep.*;
/**
* Diffrentiates a power with respect to var.
* If m is a a number
* diff(y^m,x) -> m * y... |
/* @author rich
* Created on 04-Jul-2003
*/
package org.lsmp.djep.djep.diffRules;
import org.nfunk.jep.ASTFunNode;
import org.nfunk.jep.Node;
import org.nfunk.jep.ParseException;
import org.lsmp.djep.djep.DJep;
import org.lsmp.djep.djep.DiffRulesI;
import org.lsmp.djep.xjep.*;
/**
* Differentiates a... |
/* @author rich
* Created on 04-Jul-2003
*/
package org.lsmp.djep.djep.diffRules;
import org.lsmp.djep.djep.DJep;
import org.lsmp.djep.djep.DiffRulesI;
import org.lsmp.djep.xjep.*;
import org.nfunk.jep.ASTFunNode;
import org.nfunk.jep.*;
import org.nfunk.jep.function.PostfixMathCommandI;
/**
* Commo... |
/* @author rich
* Created on 04-Jul-2003
*/
package org.lsmp.djep.djep.diffRules;
import org.lsmp.djep.djep.DJep;
import org.lsmp.djep.djep.DiffRulesI;
import org.nfunk.jep.ASTFunNode;
import org.nfunk.jep.Node;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.function.PostfixMathCommandI;
/*... |
/* @author rich
* Created on 04-Jul-2003
*/
package org.lsmp.djep.djep.diffRules;
import org.nfunk.jep.*;
import org.lsmp.djep.djep.DJep;
import org.lsmp.djep.xjep.*;
import org.nfunk.jep.function.PostfixMathCommandI;
/**
* Rules are specfied by a set of strings or trees of nodes.
* The standard... |
/* @author rich
* Created on 04-Jul-2003
*/
package org.lsmp.djep.djep.diffRules;
import org.lsmp.djep.djep.DJep;
import org.lsmp.djep.xjep.*;
import org.nfunk.jep.*;
/**
* If your really lazy, you don't even need to workout the derivatives
* of a function defined by a macro yourself.
* This cl... |
/* @author rich
* Created on 04-Jul-2003
*/
package org.lsmp.djep.djep.diffRules;
import org.nfunk.jep.*;
import org.lsmp.djep.djep.DJep;
import org.lsmp.djep.djep.DiffRulesI;
import org.lsmp.djep.xjep.*;
/**
* Diffrentiates a product with respect to var.
* diff(y*z,x) -> diff(y,x)*z+y*diff(z,x)
... |
/* @author rich
* Created on 04-Jul-2003
*/
package org.lsmp.djep.djep.diffRules;
import org.lsmp.djep.djep.DJep;
import org.lsmp.djep.djep.DiffRulesI;
import org.nfunk.jep.ASTFunNode;
import org.nfunk.jep.Node;
import org.nfunk.jep.ParseException;
/**
* Diffrentiates a subtaction with respect to va... |
/* @author rich
* Created on 04-Jul-2003
*/
package org.lsmp.djep.djep.diffRules;
import org.lsmp.djep.djep.DJep;
import org.lsmp.djep.djep.DiffRulesI;
import org.nfunk.jep.ASTFunNode;
import org.nfunk.jep.Node;
import org.nfunk.jep.ParseException;
/**
* Differentiates a addition with respect to var.... |
/* @author rich
* Created on 06-Oct-2004
*/
package org.lsmp.djep.rewrite;
import org.lsmp.djep.xjep.*;
import org.nfunk.jep.ASTFunNode;
import org.nfunk.jep.Node;
import org.nfunk.jep.ParseException;
/**
* Collect powers together so that x*x -> x^2 and x^n*x -> x^(n+1).
* @author Rich Morris
* Crea... |
/* @author rich
* Created on 01-Oct-2004
*/
package org.lsmp.djep.rewrite;
import org.nfunk.jep.*;
/**
* @author Rich Morris
* Created on 01-Oct-2004
*/
public interface RewriteRuleI {
/** Returns true if node needs to be rewritten, according to this rule. */
public boolean test(ASTFunNode node,Nod... |
/* @author rich
* Created on 01-Oct-2004
*/
package org.lsmp.djep.rewrite;
import org.nfunk.jep.*;
import org.lsmp.djep.xjep.*;
/**
* Basic implementation for a RewriteRule.
* Subclasses can have access to NodeFactory,OperatorSet,TreeUtilsand XJep objects.
* @author Rich Morris
* Created on 01-Oct-2... |
/* @author rich
* Created on 01-Oct-2004
*/
package org.lsmp.djep.rewrite;
import org.nfunk.jep.*;
import org.lsmp.djep.xjep.*;
/**
* @author Rich Morris
* Created on 01-Oct-2004
*/
public class ExpandPower implements RewriteRuleI {
private NodeFactory nf;
private OperatorSet opSet;
private T... |
package org.lsmp.djep.rewrite;
//import org.lsmp.djep.matrixParser.*;
import org.lsmp.djep.xjep.DoNothingVisitor;
import org.lsmp.djep.xjep.TreeUtils;
import org.lsmp.djep.xjep.XJep;
import org.nfunk.jep.*;
/**
* Simplifies an expression.
* To use
* <pre>
* JEP j = ...; Node in = ...;
* Simplific... |
/* @author rich
* Created on 01-Oct-2004
*/
package org.lsmp.djep.rewrite;
//import org.lsmp.djep.xjep.RewriteRuleI;
import org.nfunk.jep.*;
import org.lsmp.djep.xjep.*;
/**
* @author Rich Morris
* Created on 01-Oct-2004
*/
public class ExpandBrackets extends AbstractRewrite {
/**
* TODO cope... |
/* @author rich
* Created on 02-Nov-2003
*/
package org.lsmp.djep.vectorJep.values;
import org.lsmp.djep.vectorJep.*;
/**
* Interface defining methods needed to work with vectors and matricies.
* @author Rich Morris
* Created on 02-Nov-2003
*/
public interface MatrixValueI {
/** Returns the dimens... |
/* @author rich
* Created on 04-Nov-2003
*/
package org.lsmp.djep.vectorJep.values;
import org.lsmp.djep.vectorJep.*;
import org.nfunk.jep.type.Complex;
/**
* Degenerate i.e. rank 0 Tensor. Just has a single element.
* @author Rich Morris
* Created on 04-Nov-2003
* @version 1.3.0.2 now extends numbe... |
/* @author rich
* Created on 07-Jul-2003
*/
package org.lsmp.djep.vectorJep.values;
import org.lsmp.djep.vectorJep.*;
//import JSci.maths.DoubleMatrix;
//import JSci.physics.relativity.Rank1Tensor;
/**
* Represents a matrix.
*
* @author Rich Morris
* Created on 07-Jul-2003
* @version 2.3.0.2 now... |
/* @author rich
* Created on 07-Jul-2003
*/
package org.lsmp.djep.vectorJep.values;
import org.lsmp.djep.vectorJep.*;
/**
* Represents tensor (generalisation of Matrix/Vector).
* @author Rich Morris
* Created on 07-Jul-2003
* @version 1.3.0.2 now extends number
*/
public class Tensor implements Matr... |
/* @author rich
* Created on 07-Jul-2003
*/
package org.lsmp.djep.vectorJep.values;
import org.lsmp.djep.vectorJep.*;
/**
* A Vector of elements.
* @author Rich Morris
* Created on 07-Jul-2003
* @version 1.3.0.2 now extends number
*/
public class MVector implements MatrixValueI
{
private Obje... |
/* @author rich
* Created on 19-Dec-2003
*/
package org.lsmp.djep.vectorJep;
import org.nfunk.jep.*;
import org.lsmp.djep.vectorJep.function.*;
import org.lsmp.djep.vectorJep.values.*;
/**
* An extension of JEP with support for basic vectors and matrices.
* Use this class instead of JEP if you wish to ... |
/* @author rich
* Created on 10-Dec-2004
*/
package org.lsmp.djep.vectorJep;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
import org.lsmp.djep.vectorJep.function.*;
import org.lsmp.djep.vectorJep.values.*;
/**
* @author Rich Morris
* Created on 10-Dec-2004
*/
public class VectorEvaluator ... |
/* @author rich
* Created on 25-Oct-2003
*/
package org.lsmp.djep.vectorJep;
/**
* A class to represent a set of dimensions.
* Might be 1 for 0-dimensional numbers.
* [3] for a 3D vector
* [3,3] for a matrix
* @author rich
* Created on 25-Oct-2003
*/
public class Dimensions
{
private int dim... |
/* @author rich
* Created on 10-Dec-2004
*/
package org.lsmp.djep.vectorJep.function;
import java.util.Stack;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
/**
* Multiplies any number of Vectors or Matrices element by... |
/* @author rich
* Created on 10-Dec-2004
*/
package org.lsmp.djep.vectorJep.function;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
/**
* Multiplies any number of Vectors or Matrices element by element.
* TODO could be... |
/* @author rich
* Created on 02-Nov-2003
*/
package org.lsmp.djep.vectorJep.function;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.function.PostfixMathCommandI;
/**
* A matrix enabled operator with N arguments.
* Thi... |
/* @author rich
* Created on 13-Feb-2005
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.vectorJep.function;
import java.util.Stack;
import org.lsmp.djep.vectorJep.Dimensions;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.funct... |
/* @author rich
* Created on 13-Feb-2005
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.vectorJep.function;
import java.util.Stack;
import org.lsmp.djep.vectorJep.Dimensions;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.funct... |
/*****************************************************************************
JEP - Java Math Expression Parser 2.24
December 30 2002
(c) Copyright 2002, Nathan Funk
See LICENSE.txt for license information.
*****************************************************************************/
package org.ls... |
/*****************************************************************************
JEP 2.4.1, Extensions 1.1.1
April 30 2007
(c) Copyright 2007, Nathan Funk and Richard Morris
See LICENSE-*.txt for license information.
*****************************************************************************... |
/* @author rich
* Created on 13-Feb-2005
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.vectorJep.function;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
import java.util.Stack;
import org.lsmp.djep.vectorJep.Dimensions;
import org.lsmp.djep.vectorJep.values.*;
/**... |
/* @author rich
* Created on 26-Nov-2003
*/
package org.lsmp.djep.vectorJep.function;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.function.*;
import java.util.*;
/**
* An overloaded power function, if both arguments ... |
/* @author rich
* Created on 27-Jul-2003
*/
package org.lsmp.djep.vectorJep.function;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.*;
import org.nfunk.jep.function.Subtract;
/**
* An extension of the Add command to allow it to add MVector's and Matrix's.
... |
/* @author rich
* Created on 10-Dec-2004
*/
package org.lsmp.djep.vectorJep.function;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
/**
* Multiplies any number of Vectors or Matricies element by element.
* TODO could b... |
/* @author rich
* Created on 27-Jul-2003
*/
package org.lsmp.djep.vectorJep.function;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
import java.util.*;
/**
* An extension of the Divide class with vectors and matricies.
... |
/* @author rich
* Created on 02-Nov-2003
*/
package org.lsmp.djep.vectorJep.function;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.function.PostfixMathCommandI;
/**
* A matrix enabled binary operator.
* This interfac... |
/* @author rich
* Created on 27-Jul-2003
*/
package org.lsmp.djep.vectorJep.function;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
import java.util.*;
/**
* An extension of the Multiply to with vectors and matricies.
... |
/* @author rich
* Created on 13-Feb-2005
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.vectorJep.function;
import java.util.Stack;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.function.PostfixMathCommand;
/**
* Creates a... |
/* @author rich
* Created on 27-Jul-2003
*/
package org.lsmp.djep.vectorJep.function;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.*;
import org.nfunk.jep.function.UMinus;
/**
* Unitary minus for matrices.
* @author Rich Morris
* Created on 27-Jul-2003
... |
/* @author rich
* Created on 14-Feb-2005
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.vectorJep.function;
import org.lsmp.djep.vectorJep.Dimensions;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.*;
import org.nfunk.jep.function.CallbackEvaluationI;
import org.nfu... |
/* @author rich
* Created on 13-Feb-2005
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.vectorJep.function;
import java.util.Stack;
import org.lsmp.djep.vectorJep.Dimensions;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.funct... |
/* @author rich
* Created on 15-Nov-2003
*/
package org.lsmp.djep.vectorJep.function;
import java.util.*;
import org.lsmp.djep.vectorJep.Dimensions;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.function.PostfixMathCommand;
/**
* ele(x,i) returns the... |
/*****************************************************************************
JEP 2.4.1, Extensions 1.1.1
April 30 2007
(c) Copyright 2007, Nathan Funk and Richard Morris
See LICENSE-*.txt for license information.
*****************************************************************************... |
/* @author rich
* Created on 27-Jul-2003
*/
package org.lsmp.djep.vectorJep.function;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.*;
import org.nfunk.jep.function.Add;
/**
* An extension of the Add command to allow it to add MVector's and Matrix's.
* @au... |
/* @author rich
* Created on 13-Feb-2005
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.vectorJep.function;
import java.util.Stack;
import org.lsmp.djep.vectorJep.Dimensions;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.funct... |
/* @author rich
* Created on 15-Nov-2003
*/
package org.lsmp.djep.vectorJep.function;
import java.util.*;
import org.lsmp.djep.vectorJep.Dimensions;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.function.PostfixMathCommand;
/**
* ele(x,i) returns the... |
/*****************************************************************************
JEP - Java Math Expression Parser 2.24
December 30 2002
(c) Copyright 2002, Nathan Funk
See LICENSE.txt for license information.
*****************************************************************************/
package org.ls... |
/* @author rich
* Created on 13-Feb-2005
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.vectorJep.function;
import java.util.Stack;
import org.lsmp.djep.vectorJep.Dimensions;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.funct... |
/*
Created 16-May-2006 - Richard Morris
*/
package org.lsmp.djep.vectorJep.function;
import org.lsmp.djep.vectorJep.Dimensions;
import org.lsmp.djep.vectorJep.values.MVector;
import org.lsmp.djep.vectorJep.values.Matrix;
import org.lsmp.djep.vectorJep.values.MatrixValueI;
import org.lsmp.djep.vectorJep.values... |
/* @author rich
* Created on 14-Feb-2005
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.vectorJep.function;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.*;
import org.nfunk.jep.function.CallbackEvaluationI;
import org.nfunk.jep.fu... |
/* @author rich
* Created on 02-Nov-2003
*/
package org.lsmp.djep.vectorJep.function;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.function.PostfixMathCommandI;
/**
* A matrix enabled unary operator.
* This interface i... |
/* @author rich
* Created on 13-Feb-2005
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.vectorJep.function;
import java.util.Stack;
import org.lsmp.djep.vectorJep.Dimensions;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.funct... |
/* @author rich
* Created on 13-Feb-2005
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.vectorJep.function;
import java.util.Stack;
import org.lsmp.djep.vectorJep.Dimensions;
import org.lsmp.djep.vectorJep.values.*;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.funct... |
/* @author rich
* Created on 07-Mar-2004
*/
package org.lsmp.djep.vectorJep;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
import org.lsmp.djep.vectorJep.function.*;
/**
* @author Rich Morris
* Created on 07-Mar-2004
*/
public class VOperatorSet extends OperatorSet {
/**
*
*/
pub... |
/* @author rich
* Created on 04-May-2004
*/
package org.lsmp.djep.mrpe;
/** A list of commands evaluated in sequence by the evaluator. */
public final class MRpCommandList {
/** Data type for the command string */
static final class MRpCommand {
short command;
short aux1;
short aux2;
... |
/* @author rich
* Created on 14-Apr-2004
*/
package org.lsmp.djep.mrpe;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
import org.lsmp.djep.matrixJep.nodeTypes.*;
import org.lsmp.djep.matrixJep.*;
import org.lsmp.djep.vectorJep.*;
import org.lsmp.djep.vectorJep.values.*;
import org.lsmp.djep.xjep.... |
/* @author rich
* Created on 04-May-2004
*/
package org.lsmp.djep.mrpe;
import org.lsmp.djep.vectorJep.Dimensions;
import org.lsmp.djep.vectorJep.values.MatrixValueI;
import org.lsmp.djep.vectorJep.values.Tensor;
import org.nfunk.jep.ParseException;
/**
* The base type for values returned by evaluate.
... |
/* @author rich
* Created on 04-May-2004
*/
package org.lsmp.djep.rpe;
/** A list of commands */
public final class RpCommandList {
/** Incremental size for list of commands **/
private static final int STACK_INC=10;
/** List of commands **/
RpCommand commands[] = new RpCommand[STACK_INC];
/** Cur... |
package org.lsmp.djep.rpe;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.Variable;
/** Data type for the command string */
public final class RpCommand {
short command;
short aux1;
RpEval rpe;
private RpCommand() {};
RpCommand(RpEval rpe,short command){
this.command = command; this.aux... |
/* @author rich
* Created on 14-Apr-2004
*/
package org.lsmp.djep.rpe;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
import java.util.*;
/**
* A fast evaluation algorithm for equations over Doubles, does not work with vectors or matricies.
* This is based around reverse polish notation
* and i... |
/* @author rich
* Created on 23-Dec-2004
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.sjep;
import org.nfunk.jep.*;
/**
* A mutable monomial representing a * x^i * y^j * ... * z^k.
* There are no requirements that this is in a reduced form
* so some powers can be zero.
*
*... |
/* @author rich
* Created on 14-Dec-2004
*/
package org.lsmp.djep.sjep;
import org.lsmp.djep.xjep.*;
import org.nfunk.jep.*;
/**
* Represents a variable.
*
* @author Rich Morris
* Created on 14-Dec-2004
*/
public class PVariable extends AbstractPNode {
XVariable variable;
/**
*
*/
pub... |
/* @author rich
* Created on 14-Dec-2004
*/
package org.lsmp.djep.sjep;
import org.nfunk.jep.*;
import org.nfunk.jep.type.*;
/**
* Represents a constant.
*
* @author Rich Morris
* Created on 14-Dec-2004
*/
public class PConstant extends AbstractPNode {
Object value;
/**
*
*/
public... |
/* @author rich
* Created on 14-Dec-2004
*/
package org.lsmp.djep.sjep;
import org.nfunk.jep.*;
/**
* Represents a polynomial.
* i.e. a sum of terms which are typically
* {@link Monomial}s, but can be any {@link AbstractPNode}. The order of the terms is specified by the total ordering.
*
* @author Ri... |
/* @author rich
* Created on 14-Dec-2004
*/
package org.lsmp.djep.sjep;
import org.nfunk.jep.*;
/**
* Represents an imutable monomial a x^i * y^j * ... * z^k, a constant.
*
* @author Rich Morris
* Created on 14-Dec-2004
*/
public class Monomial extends AbstractPNode {
PConstant coeff;
PNodeI ... |
/* @author rich
* Created on 22-Dec-2004
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.sjep;
import org.nfunk.jep.ParseException;
/**
* Default methods, when more specific methods do not work.
*
* @author Rich Morris
* Created on 22-Dec-2004
*/
public abstract class A... |
/* @author rich
* Created on 14-Dec-2004
*/
package org.lsmp.djep.sjep;
import org.lsmp.djep.xjep.*;
import org.nfunk.jep.*;
import org.nfunk.jep.type.*;
import org.nfunk.jep.function.*;
/**
* Main entry point for simplification routines.
*
*<p>
Uses a complete reworking of the ways equations are rep... |
/* @author rich
* Created on 15-Dec-2004
*/
package org.lsmp.djep.sjep;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
import org.lsmp.djep.xjep.*;
/**
* Represents a function.
*
* @author Rich Morris
* Created on 15-Dec-2004
*/
public class PFunction extends AbstractPNode {
String n... |
/* @author rich
* Created on 23-Dec-2004
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.sjep;
import org.nfunk.jep.*;
/**
* A mutable polynomial representing a + b + c.
* There are no requirements that this is in a reduced form
* so some powers can be zero.
*
* @author Rich ... |
/* @author rich
* Created on 17-Dec-2004
*/
package org.lsmp.djep.sjep;
import org.nfunk.jep.*;
/**
* An element in a polynomial representation of an expression.
* Provides the main routines for creating, comparing and manipulating polynomials.
*
* @author Rich Morris
* Created on 17-Dec-2004
*/
pu... |
/* @author rich
* Created on 16-Dec-2004
*/
package org.lsmp.djep.sjep;
import org.lsmp.djep.xjep.*;
import org.nfunk.jep.Node;
import org.nfunk.jep.ParseException;
/**
* Represents an operator.
*
* @author Rich Morris
* Created on 16-Dec-2004
*/
public class POperator extends AbstractPNode {
X... |
/* @author rich
* Created on 16-Nov-2003
*/
package org.lsmp.djep.xjep;
import org.nfunk.jep.*;
/**
* A Visitor which returns an exact copy of the tree.
* This class should be extended by visitors which
* modify trees and creates a new tree.
*
* @author Rich Morris
* Created on 16-Nov-2003
*/
... |
/* @author rich
* Created on 18-Jun-2003
*/
package org.lsmp.djep.xjep;
import org.nfunk.jep.*;
import org.nfunk.jep.type.*;
import java.io.PrintStream;
import java.util.Hashtable;
import java.text.NumberFormat;
import java.text.FieldPosition;
/**
* Prints an expression.
* Prints the expression with l... |
/* @author rich
* Created on 16-Nov-2003
*/
package org.lsmp.djep.xjep;
import org.nfunk.jep.*;
/**
* A Visitor which visits each node of a expression tree.
* It returns the top node.
* This visitor should be extended by Visitors which modify trees in place.
*
* @author Rich Morris
* Created on ... |
package org.lsmp.djep.xjep;
//import org.lsmp.djep.matrixParser.*;
import org.nfunk.jep.*;
/**
* Simplifies an expression.
* To use
* <pre>
* JEP j = ...; Node in = ...;
* SimplificationVisitor sv = new SimplificationVisitor(tu);
* Node out = sv.simplify(in);
* </pre>
*
* <p>
* Its intend... |
/* @author rich
* Created on 03-Aug-2003
*/
package org.lsmp.djep.xjep;
import org.nfunk.jep.function.PostfixMathCommandI;
import org.nfunk.jep.*;
/**
* An Operator with additional information about its commutativity etc.
* <p>
* Operators have a number of properties:
* <ul>
* <li>A symbol or name... |
/* @author rich
* Created on 18-Jun-2003
*/
package org.lsmp.djep.xjep;
import org.nfunk.jep.function.PostfixMathCommand;
import org.nfunk.jep.*;
import java.util.*;
/**
* A function specified by a string.
* For example
* <pre>
* XJepI jep = new XJep();
* j.addFunction("zap",new MacroFunction("zap"... |
/* @author rich
* Created on 18-Jun-2003
*/
package org.lsmp.djep.xjep;
//import org.lsmp.djep.matrixParser.*;
import org.nfunk.jep.*;
import org.nfunk.jep.function.PostfixMathCommandI;
/**
* Executes commands like diff and eval embedded in expression trees.
* For example you could do
* <pre>eval(di... |
/* @author rich
* Created on 28-Feb-2004
*/
package org.lsmp.djep.xjep;
import org.nfunk.jep.*;
/**
* Variables which have their equations stored.
*
* @author Rich Morris
* Created on 28-Feb-2004
*/
public class XVariable extends Variable {
private Node equation=null;
public XVariable(Strin... |
package org.lsmp.djep.xjep;
import org.nfunk.jep.*;
/**
* This class is used for the evaluation of an expression. It uses the Visitor
* design pattern to traverse the function tree and evaluate the expression
* using a stack.
* <p>
* Function nodes are evaluated by first evaluating all the children node... |
/* @author rich
* Created on 19-Jun-2003
*/
package org.lsmp.djep.xjep;
import org.nfunk.jep.*;
/**
* Interface defining the special actions performed during the preprocess
* stage. This interface should be implemented by PostFixMath Commands
* which wish to perform a special action during the XJep.prep... |
/* @author Rich Morris
* Created on 19-Jun-2003
*/
package org.lsmp.djep.xjep;
//import org.lsmp.djep.matrixParser.*;
import org.nfunk.jep.*;
/**
* An abstract ParserVisitor
* which adds some useful error handling facilities.
* Visitors which require these facilities should extend this class.
* Genera... |
/* @author rich
* Created on 16-Nov-2003
*/
package org.lsmp.djep.xjep;
import org.nfunk.jep.*;
import org.nfunk.jep.function.Exp;
import org.nfunk.jep.function.PostfixMathCommandI;
import org.lsmp.djep.xjep.PrintVisitor.PrintRulesI;
import org.lsmp.djep.xjep.function.*;
import java.util.*;
import java.io... |
/* @author rich
* Created on 18-Jun-2003
*/
package org.lsmp.djep.xjep;
import org.nfunk.jep.function.PostfixMathCommand;
import org.nfunk.jep.*;
import java.util.*;
/**
* Symbolic eval(x^3,x,2) operator.
* @author R Morris.
* Created on 18-Jun-2003
*/
public class Eval extends PostfixMathCommand ... |
/*****************************************************************************
JEP 2.4.1, Extensions 1.1.1
April 30 2007
(c) Copyright 2007, Nathan Funk and Richard Morris
See LICENSE-*.txt for license information.
*****************************************************************************... |
/* @author rich
* Created on 18-Nov-2003
*/
package org.lsmp.djep.xjep.function;
import org.lsmp.djep.xjep.CommandVisitorI;
import org.lsmp.djep.xjep.TreeUtils;
import org.lsmp.djep.xjep.XJep;
import org.lsmp.djep.xjep.XVariable;
import org.nfunk.jep.*;
import org.nfunk.jep.function.*;
/**
* An assign... |
/* @author rich
* Created on 02-May-2005
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.xjep.function;
import java.util.Stack;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.function.PostfixMathCommand;
/**
* Convert a number to a string in a given base.
* toBase... |
/* @author rich
* Created on 02-May-2005
*
* See LICENSE.txt for license information.
*/
package org.lsmp.djep.xjep.function;
import java.util.Stack;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.function.PostfixMathCommand;
/**
* @author Rich Morris
* Created on 02-May-2005
*/
pub... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.