public class PowerOfTwoOperation extends java.lang.Object implements DatasetOperation
| Constructor and Description |
|---|
PowerOfTwoOperation() |
| Modifier and Type | Method and Description |
|---|---|
long |
getSerializationVersion()
Returns the current version of the serialization format.
|
int |
getVersion()
Returns the current class version.
|
void |
initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
Initializes an instance with a current-version object graph.
|
static boolean |
isPowerOf2(int a)
Determines whether a number is a power of 2
|
static int |
nextPowerOf2(int a)
Returns the next power of two i.e.
|
static int |
pad(int a)
Returns the next number >= the input which is a power of two
i.e.
|
Dataset |
run(Dataset input)
For each dimension in the input, if the dimension is not a power of 2 add elements of value 0 until this
condition is satisified.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetObjectMap, init, initPreviousVersion, initUnknownVersion, load, read, save, writepublic static int nextPowerOf2(int a)
a - number to padpublic static int pad(int a)
a - number to padpublic static boolean isPowerOf2(int a)
a - number to examinepublic Dataset run(Dataset input)
run in interface DatasetOperationinput - Dataset on which to operatepublic long getSerializationVersion()
ObjectMapgetSerializationVersion in interface ObjectMappublic int getVersion()
ObjectMapgetVersion in interface ObjectMappublic void initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
ObjectMapinitCurrentVersion in interface ObjectMapobjectMap - object graph for initialization