|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.retro.neural.FieldElement
org.retro.neural.Rational
| Field Summary | |
protected java.math.BigInteger |
denominator
|
protected java.math.BigInteger |
numerator
|
| Constructor Summary | |
Rational(java.math.BigInteger value)
This creates a Rational with denominator 1 |
|
Rational(java.math.BigInteger numerator,
java.math.BigInteger denominator)
This creates a Rational. |
|
Rational(double value)
This creates a Rational out of a double. |
|
Rational(long numerator,
long denominator)
This constructor takes two longs as numerator and denominator. |
|
| Method Summary | |
Rational |
abs()
Returns the absolute value of this Rational number. |
FieldElement |
add(FieldElement val)
Returns the result of this Rational added to another one. |
protected void |
cancel()
Completely cancels this Rational. |
int |
compareTo(java.lang.Object o)
Implements Comparable.compareTo(Object). |
double |
doubleValue()
Returns the value of this Rational as a double. |
boolean |
equals(FieldElement val)
Tests two Rationals for equality. |
java.math.BigInteger |
getDenominator()
Returns the denominator of this Rational. |
java.math.BigInteger |
getNumerator()
Returns the numerator of this Rational. |
FieldElement |
instance(double dval)
Returns an instance of this FieldElement to be used in computing mean and other values. |
FieldElement |
invert()
Returns the inverted Rational to this rational. |
FieldElement |
multiply(FieldElement val)
Returns the result of this Rational multiplied with another one. |
FieldElement |
negate()
Calculates the inverse element of addition for this FieldElement. |
FieldElement |
one()
Returns the one element for this field. |
FieldElement |
subtract(FieldElement val)
Returns the result of this Rational minus another one. |
java.lang.String |
toString()
Returns a String representation of this Rational. |
FieldElement |
zero()
Returns the zero element for this field. |
| Methods inherited from class org.retro.neural.FieldElement |
divide, ge, gt, isOne, isZero, le, lt |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.math.BigInteger numerator
protected java.math.BigInteger denominator
| Constructor Detail |
public Rational(long numerator,
long denominator)
numerator - denominator - public Rational(java.math.BigInteger value)
value - numerator
public Rational(java.math.BigInteger numerator,
java.math.BigInteger denominator)
numerator - denominator - public Rational(double value)
value - | Method Detail |
public java.lang.String toString()
protected void cancel()
public FieldElement add(FieldElement val)
add in class FieldElementval -
public FieldElement subtract(FieldElement val)
subtract in class FieldElementval -
public FieldElement multiply(FieldElement val)
multiply in class FieldElementval -
public FieldElement negate()
FieldElement
negate in class FieldElement
public FieldElement invert()
throws InvalidOperationException
invert in class FieldElementInvalidOperationExceptionpublic java.math.BigInteger getNumerator()
public java.math.BigInteger getDenominator()
public double doubleValue()
numerator.doubleValue() /
denominator.doubleValue();public boolean equals(FieldElement val)
equals in class FieldElementval -
public FieldElement zero()
zero in class FieldElementpublic FieldElement one()
one in class FieldElementpublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.ComparablecompareTo in class FieldElemento - the object
public Rational abs()
public FieldElement instance(double dval)
instance in class FieldElementdval - the value to use
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||