public class CA3DFloat
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private float[][][] |
fullMatrix
3D array contains the full matrix
|
private float[] |
lineNum
Array of unique numbers for compression
|
private int[] |
lineRep
Array of number of repetitions for compression
|
private static long |
serialVersionUID
serialVersionUID
|
private int |
sizeX
Size of the first index
|
private int |
sizeY
Size of the second index
|
private int |
sizeZ
Size of the third index
|
| Constructor and Description |
|---|
CA3DFloat(int sizeX,
int sizeY,
int sizeZ,
float defaultValue)
Constructor of compress 3D array
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(float value,
int x,
int y,
int z)
Add a value to a single location in the array
|
void |
add(float value,
int fromX,
int fromY,
int fromZ,
int toX,
int toY,
int toZ)
Add a value to a region in the array
|
private void |
compressMatrix()
Prepare compressed data from full matrix to write out
|
void |
deepCopyFrom(CA3DFloat matrix)
Initialize a compressed matrix by creating a deep copy
|
private void |
expandMatrix()
Expand compressed data to full matrix
|
float |
get(int x,
int y,
int z)
Get a single value from the array
|
int |
getSizeX()
Getter for the size of first dimension
|
int |
getSizeY()
Getter for the size of second dimension
|
int |
getSizeZ()
Getter for the size of third dimension
|
void |
multiply(float value,
int x,
int y,
int z)
Multiply a value to a single location in the array
|
void |
multiply(float value,
int fromX,
int fromY,
int fromZ,
int toX,
int toY,
int toZ)
Multiply a value to a region in the array
|
private void |
readObject(java.io.ObjectInputStream in)
Read object from input stream
|
void |
set(float value,
int x,
int y,
int z)
Set a value to a single location in the array
|
void |
set(float value,
int fromX,
int fromY,
int fromZ,
int toX,
int toY,
int toZ)
Set a value to a region in the array
|
private void |
writeObject(java.io.ObjectOutputStream out)
Write object to output stream
|
private static final long serialVersionUID
private int sizeX
private int sizeY
private int sizeZ
private float[][][] fullMatrix
private float[] lineNum
private int[] lineRep
public CA3DFloat(int sizeX,
int sizeY,
int sizeZ,
float defaultValue)
sizeX - size of the first indexsizeY - size of the second indexsizeZ - size of the third indexdefaultValue - default value in the arraypublic void set(float value,
int x,
int y,
int z)
value - new valuex - first indexy - second indexz - third indexpublic void set(float value,
int fromX,
int fromY,
int fromZ,
int toX,
int toY,
int toZ)
value - new valuefromX - from first index (inclusive)fromY - from second index (inclusive)fromZ - from third index (inclusive)toX - to first index (inclusive)toY - to second index (inclusive)toZ - to third index (inclusive)public void add(float value,
int x,
int y,
int z)
value - value to be addedx - first indexy - second indexz - third indexpublic void add(float value,
int fromX,
int fromY,
int fromZ,
int toX,
int toY,
int toZ)
value - value to be addedfromX - from first index (inclusive)fromY - from second index (inclusive)fromZ - from third index (inclusive)toX - to first index (inclusive)toY - to second index (inclusive)toZ - to third index (inclusive)public void multiply(float value,
int x,
int y,
int z)
value - value to be multipliedx - first indexy - second indexz - third indexpublic void multiply(float value,
int fromX,
int fromY,
int fromZ,
int toX,
int toY,
int toZ)
value - value to be multipliedfromX - from first index (inclusive)fromY - from second index (inclusive)fromZ - from third index (inclusive)toX - to first index (inclusive)toY - to second index (inclusive)toZ - to third index (inclusive)public float get(int x,
int y,
int z)
x - first indexy - second indexz - third indexpublic int getSizeX()
public int getSizeY()
public int getSizeZ()
private void writeObject(java.io.ObjectOutputStream out)
throws java.io.IOException
out - object output streamjava.io.IOExceptionprivate void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
in - object input streamjava.io.IOExceptionjava.lang.ClassNotFoundExceptionprivate void compressMatrix()
private void expandMatrix()
public void deepCopyFrom(CA3DFloat matrix)
matrix - matrix to be copied from