JAutoDiff

nilgiri.math.autodiff
Class DifferentialFunction<X extends Field<X>>

java.lang.Object
  extended by nilgiri.math.autodiff.DifferentialFunction<X>
Type Parameters:
X - A set forms a field.
All Implemented Interfaces:
Differential<Variable<X>,DifferentialFunction<X>>, CommutativeGroup<DifferentialFunction<X>>, CommutativeRing<DifferentialFunction<X>>, Field<DifferentialFunction<X>>, Group<DifferentialFunction<X>>, Ring<DifferentialFunction<X>>
Direct Known Subclasses:
AbstractBinaryFunction, AbstractUnaryFunction, Constant, Variable

public abstract class DifferentialFunction<X extends Field<X>>
extends java.lang.Object
implements Field<DifferentialFunction<X>>, Differential<Variable<X>,DifferentialFunction<X>>

A differential function whose value are in X. Partial derivatives of an object f of DifferentialFunction<X> are given by f.diff(x) where x is an object of Variable<X>.


Method Summary
abstract  DifferentialFunction<X> diff(Variable<X> i_v1)
          Returns an object of D whose value is the derivative with respect to i_v.
 DifferentialFunction<X> div(DifferentialFunction<X> i_v)
          Returns an object of X whose value is (this / i_v).
abstract  X getValue()
          Returns the value in X of the function.
 DifferentialFunction<X> inverse()
          Returns an object of X whose value is (1 / this).
 boolean isConstant()
          Returns true if this is a constant.
 boolean isVariable()
          Returns true if this is a variable.
 DifferentialFunction<X> minus(DifferentialFunction<X> i_v)
          Returns an object of X whose value is (this - i_v).
 DifferentialFunction<X> mul(DifferentialFunction<X> i_v)
          Returns an object of X whose value is the product (this * i_v).
 DifferentialFunction<X> mul(long i_n)
          Returns an object of X whose value is the summation (sum_{1}^{i_n}(this)).
 DifferentialFunction<X> negate()
          Returns an object of X whose value is (- this).
 DifferentialFunction<X> plus(DifferentialFunction<X> i_v)
          Returns an object of X whose value is (this + i_v).
 DifferentialFunction<X> pow(int i_n)
          Returns an object of X whose value is the power (this ^ i_n).
abstract  java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getValue

public abstract X getValue()
Returns the value in X of the function.

Returns:
the value.

toString

public abstract java.lang.String toString()
Overrides:
toString in class java.lang.Object

isConstant

public boolean isConstant()
Returns true if this is a constant.

Returns:
true if this is a constant.

isVariable

public boolean isVariable()
Returns true if this is a variable.

Returns:
true if this is a variable.

diff

public abstract DifferentialFunction<X> diff(Variable<X> i_v1)
Description copied from interface: Differential
Returns an object of D whose value is the derivative with respect to i_v.

Specified by:
diff in interface Differential<Variable<X extends Field<X>>,DifferentialFunction<X extends Field<X>>>
Returns:
the derivative with respect to i_v.

plus

public DifferentialFunction<X> plus(DifferentialFunction<X> i_v)
Description copied from interface: Group
Returns an object of X whose value is (this + i_v).

Specified by:
plus in interface Group<DifferentialFunction<X extends Field<X>>>
Returns:
this + i_v

minus

public DifferentialFunction<X> minus(DifferentialFunction<X> i_v)
Description copied from interface: Group
Returns an object of X whose value is (this - i_v).

Specified by:
minus in interface Group<DifferentialFunction<X extends Field<X>>>
Returns:
this - i_v

mul

public DifferentialFunction<X> mul(DifferentialFunction<X> i_v)
Description copied from interface: Ring
Returns an object of X whose value is the product (this * i_v).

Specified by:
mul in interface Ring<DifferentialFunction<X extends Field<X>>>
Returns:
this * i_v

div

public DifferentialFunction<X> div(DifferentialFunction<X> i_v)
Description copied from interface: Field
Returns an object of X whose value is (this / i_v).

Specified by:
div in interface Field<DifferentialFunction<X extends Field<X>>>
Returns:
this / i_v

inverse

public DifferentialFunction<X> inverse()
Description copied from interface: Field
Returns an object of X whose value is (1 / this).

Specified by:
inverse in interface Field<DifferentialFunction<X extends Field<X>>>
Returns:
1 / this

negate

public DifferentialFunction<X> negate()
Description copied from interface: Group
Returns an object of X whose value is (- this).

Specified by:
negate in interface Group<DifferentialFunction<X extends Field<X>>>
Returns:
- this

mul

public DifferentialFunction<X> mul(long i_n)
Description copied from interface: Group
Returns an object of X whose value is the summation (sum_{1}^{i_n}(this)). Group<X&rt guarantees the results for natural numbers only.

Specified by:
mul in interface Group<DifferentialFunction<X extends Field<X>>>
Parameters:
i_n - a natural number
Returns:
sum_{1}^{i_n}(this)

pow

public DifferentialFunction<X> pow(int i_n)
Description copied from interface: Ring
Returns an object of X whose value is the power (this ^ i_n). Ring guarantees the results for natural numbers only.

Specified by:
pow in interface Ring<DifferentialFunction<X extends Field<X>>>
Parameters:
i_n - a natural number
Returns:
this ^ i_n

JAutoDiff

JAutoDiff website