|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmali.number.Radical1
public class Radical1
Represents a simple subset of radicals, namely, a sum of rational*sqrt(rational). e.g. 4 + sqrt(3) + 5*sqrt(2) The class was designed for use with rotation matrices, where triginomic constants like sin(pi/2) can be represented in simple radical forms.
| Field Summary | |
|---|---|
static Rational |
lowerTmp
|
static Rational |
lowerTmp2
|
static java.lang.Object |
MINUS_ONE
|
static Radical1 |
ONE
|
java.util.HashMap<java.lang.Integer,Rational> |
radicands
|
static Rational |
upperTmp
|
static Rational |
upperTmp2
|
static Radical1 |
ZERO
|
| Constructor Summary | |
|---|---|
Radical1()
|
|
Radical1(int value)
helper to instanciate integer values (sqrt(1) * x/1 terms) |
|
Radical1(int nom,
int den,
int radical)
helper term to instanciate radicals with just one term |
|
Radical1(Radical1 value)
|
|
Radical1(Rational rational)
helper term to instanciate radicals with no sqrt terms (or sqrt(1) terms) |
|
Radical1(Rational rational,
int radical)
helper term to instanciate radicals with just one term |
|
| Method Summary | |
|---|---|
void |
absolute(Radical1 passback)
|
static Radical1 |
add(Radical1 a,
Radical1 b,
Radical1 result)
result = a * b; can be performed in place, i.e. result can be the same argument as a parameter |
void |
addTerm(Rational multiplier,
java.lang.Integer radicand)
A radical is comprised of several terms e.g. this radical has 3 terms: 4 + 3*sqrt(2) + 2/3 * sqrt(3). |
Radical1 |
clone()
|
boolean |
equals(java.lang.Object o)
|
static boolean |
equals(Radical1 a,
Radical1 b)
|
float |
floatValue()
|
void |
get(Radical1 passback)
|
void |
getBounds(Rational upperPassback,
Rational lowerPassback)
Retreives reasonably tight rational bounds. |
int |
hashCode()
|
static Radical1 |
mod(Radical1 rad,
Rational mod,
Radical1 passback)
This performs rad % rational in closed form ... |
static Radical1 |
mul(Radical1 a,
Radical1 b,
Radical1 result)
result = a * b in radicand math. |
Radical1 |
mul(Rational factor,
Radical1 passback)
|
Radical1 |
negate()
|
Radical1 |
negate(Radical1 passback)
|
static Radical1 |
parseRadical1(java.lang.String string)
|
void |
set(Radical1 value)
|
void |
setTerm(Rational multiplier,
java.lang.Integer radicand)
A radical is comprised of several terms e.g. this radical has 3 terms: 4 + 3*sqrt(2) + 2/3 * sqrt(3). |
void |
setTerm(Rational multiplier,
Rational radicand)
A radical is comprised of several terms e.g. this radical has 3 terms: 4 + 3*sqrt(2) + 2/3 * sqrt(3). |
void |
setZero()
|
static Radical1 |
sub(Radical1 a,
Radical1 b,
Radical1 result)
result = a * b; can be performed in place, i.e. result can be the same argument as a parameter |
java.lang.String |
toString()
compativle with the parse implementation (see Parser and parseRadicand1) |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public java.util.HashMap<java.lang.Integer,Rational> radicands
public static final Rational upperTmp
public static final Rational lowerTmp
public static final Rational upperTmp2
public static final Rational lowerTmp2
public static Radical1 ONE
public static Radical1 ZERO
public static java.lang.Object MINUS_ONE
| Constructor Detail |
|---|
public Radical1(Radical1 value)
public Radical1()
public Radical1(int value)
value - public Radical1(Rational rational)
rational -
public Radical1(Rational rational,
int radical)
rational -
public Radical1(int nom,
int den,
int radical)
| Method Detail |
|---|
public final void setZero()
public final void set(Radical1 value)
public final void get(Radical1 passback)
public final float floatValue()
public final Radical1 negate(Radical1 passback)
public Radical1 negate()
public void absolute(Radical1 passback)
public Radical1 mul(Rational factor,
Radical1 passback)
public void setTerm(Rational multiplier,
java.lang.Integer radicand)
public void setTerm(Rational multiplier,
Rational radicand)
public void addTerm(Rational multiplier,
java.lang.Integer radicand)
public void getBounds(Rational upperPassback,
Rational lowerPassback)
upperPassback - lowerPassback -
public static Radical1 add(Radical1 a,
Radical1 b,
Radical1 result)
public static Radical1 sub(Radical1 a,
Radical1 b,
Radical1 result)
public static Radical1 mul(Radical1 a,
Radical1 b,
Radical1 result)
public static Radical1 mod(Radical1 rad,
Rational mod,
Radical1 passback)
rad - mod - passback -
java.lang.ArithmeticException - if tight bounds can't be foundpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object
public static final boolean equals(Radical1 a,
Radical1 b)
public int hashCode()
hashCode in class java.lang.Objectpublic Radical1 clone()
clone in class java.lang.Objectpublic static Radical1 parseRadical1(java.lang.String string)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||