Class RationalFunction<F extends Field<F>>
- java.lang.Object
-
- org.jscience.mathematics.function.Function<F,F>
-
- org.jscience.mathematics.function.RationalFunction<F>
-
- All Implemented Interfaces:
java.io.Serializable,javolution.lang.Immutable,javolution.lang.Realtime,javolution.lang.ValueType,Field<RationalFunction<F>>,GroupAdditive<RationalFunction<F>>,GroupMultiplicative<RationalFunction<F>>,Ring<RationalFunction<F>>,Structure<RationalFunction<F>>
public class RationalFunction<F extends Field<F>> extends Function<F,F> implements Field<RationalFunction<F>>
This class represents the quotient of twoPolynomial, it is also afield(invertible).- Version:
- 3.1, April 1, 2006
- Author:
- Jean-Marie Dautelle
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RationalFunction<F>copy()Returns a copy of this rational function.RationalFunction<F>differentiate(Variable<F> v)Returns the first derivative of this function with respect to the specified variable.Function<F,F>divide(Function<F,F> that)Returns the quotient of this function with the one specified.RationalFunction<F>divide(RationalFunction<F> that)Returns the quotient of two rational functions.booleanequals(java.lang.Object obj)Indicates if this function is equals to the specified object.Fevaluate()Evaluates this function using itsvariablescurrent values.Polynomial<F>getDividend()Returns the dividend of this rational function.Polynomial<F>getDivisor()Returns the divisor of this rational function.java.util.List<Variable<F>>getVariables()Returns a lexically ordered list of the variables (or arguments) for this function (empty list for constant functions).inthashCode()Returns the hash code for this function (consistent withFunction.equals(Object).RationalFunction<F>inverse()Returns the inverse of this rational function.Function<F,F>minus(Function<F,F> that)Returns the difference of this function with the one specified.RationalFunction<F>minus(RationalFunction<F> that)Returns the difference of two rational functions.RationalFunction<F>opposite()Returns the opposite of this rational function.Function<F,F>plus(Function<F,F> that)Returns the sum of this function with the one specified.RationalFunction<F>plus(RationalFunction<F> that)Returns the sum of two rational functions.RationalFunction<F>pow(int n)Returns this function raised at the specified exponent.Function<F,F>times(Function<F,F> that)Returns the product of this function with the one specified.RationalFunction<F>times(RationalFunction<F> that)Returns the product of two rational functions.javolution.text.TexttoText()Returns the textual representation of this real-time object (equivalent totoStringexcept that the returned value can be allocated from the local context space).static <F extends Field<F>>
RationalFunction<F>valueOf(Polynomial<F> dividend, Polynomial<F> divisor)Returns the rational function from the specified dividend and divisor.
-
-
-
Method Detail
-
getDividend
public Polynomial<F> getDividend()
Returns the dividend of this rational function.- Returns:
- this rational function dividend.
-
getDivisor
public Polynomial<F> getDivisor()
Returns the divisor of this rational function.- Returns:
- this rational function divisor.
-
valueOf
public static <F extends Field<F>> RationalFunction<F> valueOf(Polynomial<F> dividend, Polynomial<F> divisor)
Returns the rational function from the specified dividend and divisor.- Parameters:
dividend- the dividend value.divisor- the divisor value.- Returns:
dividend / divisor
-
plus
public RationalFunction<F> plus(RationalFunction<F> that)
Returns the sum of two rational functions.- Specified by:
plusin interfaceGroupAdditive<F extends Field<F>>- Parameters:
that- the rational function being added.- Returns:
this + that
-
opposite
public RationalFunction<F> opposite()
Returns the opposite of this rational function.- Specified by:
oppositein interfaceGroupAdditive<F extends Field<F>>- Returns:
- this
-
minus
public RationalFunction<F> minus(RationalFunction<F> that)
Returns the difference of two rational functions.- Parameters:
that- the rational function being subtracted.- Returns:
this - that
-
times
public RationalFunction<F> times(RationalFunction<F> that)
Returns the product of two rational functions.
-
inverse
public RationalFunction<F> inverse()
Returns the inverse of this rational function.- Specified by:
inversein interfaceGroupMultiplicative<F extends Field<F>>- Returns:
1 / this
-
divide
public RationalFunction<F> divide(RationalFunction<F> that)
Returns the quotient of two rational functions.- Parameters:
that- the rational function divisor.- Returns:
this / that
-
getVariables
public java.util.List<Variable<F>> getVariables()
Description copied from class:FunctionReturns a lexically ordered list of the variables (or arguments) for this function (empty list for constant functions).
-
evaluate
public F evaluate()
Description copied from class:FunctionEvaluates this function using itsvariablescurrent values.
-
toText
public javolution.text.Text toText()
Description copied from class:FunctionReturns the textual representation of this real-time object (equivalent totoStringexcept that the returned value can be allocated from the local context space).
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:FunctionIndicates if this function is equals to the specified object.
-
hashCode
public int hashCode()
Description copied from class:FunctionReturns the hash code for this function (consistent withFunction.equals(Object).
-
differentiate
public RationalFunction<F> differentiate(Variable<F> v)
Description copied from class:FunctionReturns the first derivative of this function with respect to the specified variable.- Overrides:
differentiatein classFunction<F extends Field<F>,F extends Field<F>>- Parameters:
v- the variable for which the derivative is calculated.- Returns:
d[this]/dv- See Also:
- Derivative -- from MathWorld
-
plus
public Function<F,F> plus(Function<F,F> that)
Description copied from class:FunctionReturns the sum of this function with the one specified.
-
minus
public Function<F,F> minus(Function<F,F> that)
Description copied from class:FunctionReturns the difference of this function with the one specified.
-
times
public Function<F,F> times(Function<F,F> that)
Description copied from class:FunctionReturns the product of this function with the one specified.
-
divide
public Function<F,F> divide(Function<F,F> that)
Description copied from class:FunctionReturns the quotient of this function with the one specified. Evaluation of this function may raise an exception if the function result is not a {
-
pow
public RationalFunction<F> pow(int n)
Description copied from class:FunctionReturns this function raised at the specified exponent.
-
copy
public RationalFunction<F> copy()
Returns a copy of this rational function.allocatedby the calling thread (possibly on the stack).- Specified by:
copyin interfacejavolution.lang.ValueType- Returns:
- an identical and independant copy of this rational function.
-
-