|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--wavelet_util.binary
Calculate power and log functions using fast binary operations.
Constructor Summary | |
binary()
|
Method Summary | |
static byte |
log2(int val)
Calculate floor( log2( val ) ), where val > 0 |
static int |
nearestPower2(int val)
nearestPower2 |
static int |
power2(byte n)
Calculate 2n where n >= 0 |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public binary()
Method Detail |
public static int power2(byte n)
n
- a value between 0..31public static byte log2(int val)
Calculate floor( log2( val ) ), where val > 0
The log function is undefined for 0.
val
- a positive valuepublic static int nearestPower2(int val)
Given a value "val", where val > 0, nearestPower2 returns the power of 2 that is less than or equal to val.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |