org.lsmp.djep.sjep
Interface PNodeI

All Known Implementing Classes:
AbstractPNode, Monomial, PConstant, PFunction, Polynomial, POperator, PVariable

public interface PNodeI

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

Method Summary
 PNodeI add(PNodeI node)
          Adds a node to this one.
 int compareTo(PNodeI fun)
          Compares this expression to argument.
 PNodeI div(PNodeI node)
          Divides this by the argument.
 boolean equals(java.lang.Object o)
          True is nodes represent the same parse trees
 boolean equals(PNodeI node)
          True is nodes represent the same parse trees
 PNodeI expand()
          complete expansion. (1+x)^2 --> 1+2*x+x^2
 PNodeI invert()
          inverts node i.e. 1/x
 boolean isOne()
          True if node represents one
 boolean isZero()
          True if node represents zero
 PNodeI mul(PNodeI node)
          Multiplies this by the argument.
 PNodeI negate()
          negates node i.e.
 PNodeI pow(PNodeI node)
          Raise this to the argument.
 PNodeI sub(PNodeI node)
          Subtracts the argument from this.
 Node toNode()
          Converts the node to standard JEP format.
 java.lang.String toString()
          Produces a string representation of the argument.
 

Method Detail

add

PNodeI add(PNodeI node)
           throws ParseException
Adds a node to this one.

Throws:
ParseException

sub

PNodeI sub(PNodeI node)
           throws ParseException
Subtracts the argument from this.

Throws:
ParseException

negate

PNodeI negate()
              throws ParseException
negates node i.e. -x

Throws:
ParseException

mul

PNodeI mul(PNodeI node)
           throws ParseException
Multiplies this by the argument.

Throws:
ParseException

div

PNodeI div(PNodeI node)
           throws ParseException
Divides this by the argument.

Throws:
ParseException

pow

PNodeI pow(PNodeI node)
           throws ParseException
Raise this to the argument.

Throws:
ParseException

invert

PNodeI invert()
              throws ParseException
inverts node i.e. 1/x

Throws:
ParseException

equals

boolean equals(PNodeI node)
True is nodes represent the same parse trees


equals

boolean equals(java.lang.Object o)
True is nodes represent the same parse trees

Overrides:
equals in class java.lang.Object

compareTo

int compareTo(PNodeI fun)
Compares this expression to argument. Uses a total ordering of expressions. Returns positive if this node comes after the argument.


toNode

Node toNode()
            throws ParseException
Converts the node to standard JEP format.

Throws:
ParseException

toString

java.lang.String toString()
Produces a string representation of the argument.

Overrides:
toString in class java.lang.Object

isZero

boolean isZero()
True if node represents zero


isOne

boolean isOne()
True if node represents one


expand

PNodeI expand()
              throws ParseException
complete expansion. (1+x)^2 --> 1+2*x+x^2

Throws:
ParseException


http://www.singularsys.com/jep Copyright © 2007 Singular Systems