org.lsmp.djep.groupJep.values
Class Polynomial

java.lang.Object
  extended byjava.lang.Number
      extended byorg.lsmp.djep.groupJep.values.Polynomial
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FreeGroupElement

public class Polynomial
extends java.lang.Number

The ring of polynomials over a ring R.

Author:
Rich Morris Created on 09-Mar-2004
See Also:
Serialized Form

Constructor Summary
Polynomial(RingI baseRing, java.lang.String symbol, java.lang.Number[] coeffs)
           
 
Method Summary
 Polynomial add(Polynomial poly)
           
 Complex calculateComplexValue(Complex rootVal)
          returns the complex value of this polynomial.
 double doubleValue()
          value of constant coeff.
 boolean equals(Polynomial n)
           
 float floatValue()
          value of constant coeff.
 RingI getBaseRing()
           
 java.lang.Number getCoeff(int i)
           
 java.lang.Number[] getCoeffs()
           
 int getDegree()
           
 java.lang.String getSymbol()
           
 int intValue()
          value of constant coeff.
 long longValue()
          value of constant coeff.
 Polynomial mul(Polynomial poly)
           
protected  void setCoeffs(java.lang.Number[] coeffs)
          Sub classes can change the coefficients.
 Polynomial sub(Polynomial poly)
           
 java.lang.String toString()
           
protected  Polynomial valueOf(java.lang.Number[] lcoeffs)
          sub classes should overright this to make the correct type.
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Polynomial

public Polynomial(RingI baseRing,
                  java.lang.String symbol,
                  java.lang.Number[] coeffs)
Method Detail

setCoeffs

protected void setCoeffs(java.lang.Number[] coeffs)
Sub classes can change the coefficients. Other methods should treat polynomials as imutable.


valueOf

protected Polynomial valueOf(java.lang.Number[] lcoeffs)
sub classes should overright this to make the correct type.


add

public Polynomial add(Polynomial poly)

sub

public Polynomial sub(Polynomial poly)

mul

public Polynomial mul(Polynomial poly)

toString

public java.lang.String toString()

getDegree

public int getDegree()

getSymbol

public java.lang.String getSymbol()

getCoeffs

public java.lang.Number[] getCoeffs()

getCoeff

public java.lang.Number getCoeff(int i)

getBaseRing

public RingI getBaseRing()

intValue

public int intValue()
value of constant coeff.


longValue

public long longValue()
value of constant coeff.


floatValue

public float floatValue()
value of constant coeff.


doubleValue

public double doubleValue()
value of constant coeff.


equals

public boolean equals(Polynomial n)

calculateComplexValue

public Complex calculateComplexValue(Complex rootVal)
returns the complex value of this polynomial. Where the value of the symbol is replaced by rootVal.



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