public final class LMath extends Object
Constructor and Description |
---|
LMath() |
Modifier and Type | Method and Description |
---|---|
static int |
binom(int n,
int k)
Calculate binomial coefficient
|
static long |
factorial(int n)
Calcualte factorial.
|
static boolean |
incCounter(int[] v,
int i,
int n,
int k)
Utility method for k-permutation building
|
public static int binom(int n, int k)
public static long factorial(int n)
n
- argumentn!
IllegalArgumentException
- if n < 0
or if n > 20
:
The factorial value is too large to fit
in a long
.public static boolean incCounter(int[] v, int i, int n, int k)
Copyright © 2012 Thomas Hillebrandt. All Rights Reserved.