|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--utilities.Binomial
A class to compute a binomial function. There are two options with this class. First, you might just call longBinom as a static function, which will calculate the binomial you seek on the spot. If you will be doing alot of similar calculations a better option is to initialize the function with a largest N, this stores all the binomials in memory which (although big) has the advantage of saving a lot of time. Since it takes up so much memory, it is worth getting rid of as quickly as possible (i.e. make it with very small scope)!
Constructor Summary | |
Binomial()
Constructor that does nothing |
|
Binomial(int N)
Constructor that builds a class for speedy multiple callse |
Method Summary | |
java.math.BigDecimal |
binom(int N,
int K)
Determines a binomial function N choose K. |
static java.math.BigDecimal |
longBinom(int N,
int K)
Determines the binomial function. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Binomial()
public Binomial(int N)
N
- Biggest N for future useMethod Detail |
public static java.math.BigDecimal longBinom(int N, int K)
N
- n of the binomial function
public java.math.BigDecimal binom(int N, int K)
N
- nK
- k
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |