All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lsmp.djep.matrixJep.SpecialPreProcessorI Maven / Gradle / Ivy

Go to download

JEP is a Java library for parsing and evaluating mathematical expressions.

The newest version!
/* @author rich
 * Created on 14-Feb-2005
 *
 * See LICENSE.txt for license information.
 */
package org.lsmp.djep.matrixJep;
import org.lsmp.djep.matrixJep.nodeTypes.*;
import org.nfunk.jep.*;
/**
 * Applies a special preprocessing step for a function or operator.
 * 
 * @author Rich Morris
 * Created on 14-Feb-2005
 */
public interface SpecialPreProcessorI
{
	/**
	 * Subverts the preprocessing stage.
	 * Preprocessing performs a number of operations:
	 * 
    *
  1. Converts each node into one of the subtypes of MatrixNodeI
  2. *
  3. Calculate the dimensions for the results
  4. *
  5. Performs any special symbolic operations such as differentation
  6. *
* In general the first step in preprocessing is to run the preprocessor on the children of the node. * This can be done using *
	 * MatrixNodeI children[] = visitor.visitChildrenAsArray(node,null);
	 * 
* The final step is to construct a node of the correct type. The MatrixNodeFactory * argument has a number of methods to do this. For example *
	 * return (ASTMFunNode) nf.buildOperatorNode(node.getOperator(),children,rhsDim);
	 * 
* Note how the dimension is specified. * * @param node the top node of the tree representing the function and its arguments. * @param visitor A reference to the preprocessing visitor. * @param jep A reference of the MatrixJep instance. * @param nf A reference to the node factory object. * @return A new MatrixNodeI representing the converted function. * @throws ParseException if some error occurs. */ public MatrixNodeI preprocess( ASTFunNode node, MatrixPreprocessor visitor, MatrixJep jep, MatrixNodeFactory nf) throws ParseException; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy