org.retro.neural
Class FieldElement

java.lang.Object
  extended byorg.retro.neural.FieldElement
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
Complex, DoubleWrapper, F2, Rational

public abstract class FieldElement
extends java.lang.Object
implements java.lang.Comparable


Constructor Summary
FieldElement()
           
 
Method Summary
abstract  FieldElement add(FieldElement val)
          Calculates the sum of this FieldElement and another one.
abstract  int compareTo(java.lang.Object o)
          Implements Comparable.compareTo(Object).
 FieldElement divide(FieldElement val)
          Calculates the quotient of this FieldElement and another one.
 boolean equals(FieldElement val)
          Checks two FieldElements for equality.
 boolean ge(FieldElement val)
          Checks whether this FieldElement is mathematically greater than or equal to another.
 boolean gt(FieldElement val)
          Checks whether this FieldElement is mathematically greater than another.
abstract  FieldElement instance(double dval)
          Returns an instance of this FieldElement to be used in computing mean and other values.
abstract  FieldElement invert()
          Calculates the inverse element of multiplication for this FieldElement.
 boolean isOne()
          Tests if this FieldElement is the neutral element of multiplication (one).
 boolean isZero()
          Tests if this FieldElement is the neutral element of addition (zero).
 boolean le(FieldElement val)
          Checks whether this FieldElement is mathematically less than or equal to another.
 boolean lt(FieldElement val)
          Checks whether this FieldElement is mathematically less than another.
abstract  FieldElement multiply(FieldElement val)
          Calculates the product of this FieldElement and another one.
abstract  FieldElement negate()
          Calculates the inverse element of addition for this FieldElement.
abstract  FieldElement one()
          Returns the neutral element of multiplication (one element) of this FieldElement's field.
 FieldElement subtract(FieldElement val)
          Calculates the difference of this FieldElement and another one.
abstract  FieldElement zero()
          Returns the neutral element of addition (zero element) of this FieldElement's field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldElement

public FieldElement()
Method Detail

add

public abstract FieldElement add(FieldElement val)
Calculates the sum of this FieldElement and another one.

Parameters:
val -
Returns:
sum

subtract

public FieldElement subtract(FieldElement val)
Calculates the difference of this FieldElement and another one.

Parameters:
val -
Returns:
difference

multiply

public abstract FieldElement multiply(FieldElement val)
Calculates the product of this FieldElement and another one.

Parameters:
val -
Returns:
product

divide

public FieldElement divide(FieldElement val)
Calculates the quotient of this FieldElement and another one.

Parameters:
val -
Returns:
product

zero

public abstract FieldElement zero()
Returns the neutral element of addition (zero element) of this FieldElement's field.

Returns:
zero

one

public abstract FieldElement one()
Returns the neutral element of multiplication (one element) of this FieldElement's field.

Returns:
one

negate

public abstract FieldElement negate()
Calculates the inverse element of addition for this FieldElement.

Returns:
negated

invert

public abstract FieldElement invert()
Calculates the inverse element of multiplication for this FieldElement.

Returns:
inverted

equals

public boolean equals(FieldElement val)
Checks two FieldElements for equality. Should be overridden due to efficiency reasons.

Parameters:
val -
Returns:
true if the two FieldElements are mathematically equal.

isZero

public boolean isZero()
Tests if this FieldElement is the neutral element of addition (zero).

Returns:
true if zero

isOne

public boolean isOne()
Tests if this FieldElement is the neutral element of multiplication (one).

Returns:
true if one

compareTo

public abstract int compareTo(java.lang.Object o)
Implements Comparable.compareTo(Object).

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the object
Returns:
{-,+,0} as this object is less than, equal to, or greater than the specified object.

lt

public boolean lt(FieldElement val)
Checks whether this FieldElement is mathematically less than another.

Parameters:
val -
Returns:
true if this FieldElement is less than val, false otherwise

gt

public boolean gt(FieldElement val)
Checks whether this FieldElement is mathematically greater than another.

Parameters:
val -
Returns:
true if this FieldElement is greater than val, false otherwise

le

public boolean le(FieldElement val)
Checks whether this FieldElement is mathematically less than or equal to another.

Parameters:
val -
Returns:
true if this FieldElement is less than or equal to val, false otherwise

ge

public boolean ge(FieldElement val)
Checks whether this FieldElement is mathematically greater than or equal to another.

Parameters:
val -
Returns:
true if this FieldElement is greater than or equal to val, false otherwise

instance

public abstract FieldElement instance(double dval)
Returns an instance of this FieldElement to be used in computing mean and other values.

Parameters:
dval - the value to use
Returns:
instance