org.jscience.mathematics.analysis.polynomials
Class DoublePolynomialFraction

java.lang.Object
  extended by org.jscience.mathematics.analysis.DoubleFunction
      extended by org.jscience.mathematics.analysis.polynomials.DoublePolynomialFraction
All Implemented Interfaces:
java.io.Serializable, Field.Member, Ring.Member, AbelianGroup.Member, AbstractMapping, C1Function, PrimitiveMapping, Member

public class DoublePolynomialFraction
extends DoubleFunction

This class implements fractions of polynomials with one unknown and real coefficients.

See Also:
Serialized Form

Constructor Summary
DoublePolynomialFraction(DoublePolynomial p)
          Simple constructor.
DoublePolynomialFraction(DoublePolynomial numerator, DoublePolynomial denominator)
          Simple constructor.
DoublePolynomialFraction(DoublePolynomialFraction f)
          Copy-constructor.
 
Method Summary
 DoublePolynomialFraction add(DoublePolynomialFraction f)
          Add a fraction to the instance.
 DoublePolynomialFraction differentiate()
          Returns the differential of this function.
 DoublePolynomialFraction divide(DoublePolynomialFraction f)
          Divide the instance by a fraction.
 DoublePolynomial getDenominator()
          Get the denominator.
 DoublePolynomial getNumerator()
          Get the numerator.
 DoublePolynomialFraction invert()
          Invert the instance.
 double map(double x)
          Evaluates this polynomial fraction.
 double map(float x)
          Evaluates this polynomial.
 double map(int x)
          Evaluates this polynomial.
 double map(long x)
          Evaluates this polynomial.
 DoublePolynomialFraction multiply(DoublePolynomialFraction f)
          Multiply the instance by a fraction.
 DoublePolynomialFraction negate()
          Negate a fraction.
 DoublePolynomialFraction subtract(DoublePolynomialFraction f)
          Subtract a fraction to the instance.
 java.lang.String toString()
          DOCUMENT ME!
 java.lang.String toString(java.lang.String unknown)
          DOCUMENT ME!
 
Methods inherited from class org.jscience.mathematics.analysis.DoubleFunction
add, add, compose, cos, divide, divide, exp, getIntervalsList, inverse, log, multiply, multiply, power, setIntervalsList, sin, sqrt, subtract, subtract, taylorExpand, tensor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoublePolynomialFraction

public DoublePolynomialFraction(DoublePolynomial numerator,
                                DoublePolynomial denominator)
Simple constructor. Build a fraction from a numerator and a denominator.

Parameters:
numerator - numerator of the fraction
denominator - denominator of the fraction
Throws:
java.lang.ArithmeticException - if the denominator is null

DoublePolynomialFraction

public DoublePolynomialFraction(DoublePolynomial p)
Simple constructor. Build a fraction from a single Polynom

Parameters:
p - value of the fraction

DoublePolynomialFraction

public DoublePolynomialFraction(DoublePolynomialFraction f)
Copy-constructor.

Parameters:
f - fraction to copy
Method Detail

map

public double map(double x)
Evaluates this polynomial fraction.

Specified by:
map in interface PrimitiveMapping
Specified by:
map in class DoubleFunction
Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!
See Also:
org.jscience.mathematics.analysis.IntervalList.

map

public double map(float x)
Evaluates this polynomial.

Specified by:
map in interface PrimitiveMapping
Overrides:
map in class DoubleFunction
Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

map

public double map(long x)
Evaluates this polynomial.

Specified by:
map in interface PrimitiveMapping
Overrides:
map in class DoubleFunction
Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

map

public double map(int x)
Evaluates this polynomial.

Specified by:
map in interface PrimitiveMapping
Overrides:
map in class DoubleFunction
Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

differentiate

public DoublePolynomialFraction differentiate()
Returns the differential of this function.

Specified by:
differentiate in interface C1Function
Specified by:
differentiate in class DoubleFunction
Returns:
DOCUMENT ME!

negate

public DoublePolynomialFraction negate()
Negate a fraction.

Specified by:
negate in interface AbelianGroup.Member
Overrides:
negate in class DoubleFunction
Returns:
a new fraction which is the opposite of this

add

public DoublePolynomialFraction add(DoublePolynomialFraction f)
Add a fraction to the instance.

Parameters:
f - fraction to add.
Returns:
DOCUMENT ME!

subtract

public DoublePolynomialFraction subtract(DoublePolynomialFraction f)
Subtract a fraction to the instance.

Parameters:
f - fraction to subtract.
Returns:
DOCUMENT ME!

multiply

public DoublePolynomialFraction multiply(DoublePolynomialFraction f)
Multiply the instance by a fraction.

Parameters:
f - fraction to multiply by
Returns:
DOCUMENT ME!

divide

public DoublePolynomialFraction divide(DoublePolynomialFraction f)
Divide the instance by a fraction.

Parameters:
f - fraction to divide by
Returns:
DOCUMENT ME!
Throws:
java.lang.ArithmeticException - if f is null

invert

public DoublePolynomialFraction invert()
Invert the instance. Replace the instance by its inverse.

Returns:
DOCUMENT ME!
Throws:
java.lang.ArithmeticException - if the instance is null

getNumerator

public DoublePolynomial getNumerator()
Get the numerator.

Returns:
the numerator

getDenominator

public DoublePolynomial getDenominator()
Get the denominator.

Returns:
the denominator (leeding coefficient is always positive)

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

toString

public java.lang.String toString(java.lang.String unknown)
DOCUMENT ME!

Parameters:
unknown - DOCUMENT ME!
Returns:
DOCUMENT ME!