Collection of static methods to deal with spatial grids that are used in the MicroCoSm model.
More...
|
static double[] | vectorizeArray (double[][][] originalArray) |
| Transforms a 3D array to a 1D array. More...
|
|
static double[] | vectorizeArray (double[][] originalArray) |
| Transforms a 2D array to a 1D array. More...
|
|
static double[][][] | reshapeArray (double[] vectorized, int nI, int nJ, int nK) |
| Reshape a vectorized array to 3 dimensional array. More...
|
|
static int | gcd (int a, int b) |
| Find the greatest common divisor of two integer numbers. More...
|
|
static boolean | isConsistent (int[] a, int[] b) |
| Check the consistency of two grid sizes. More...
|
|
static void | addTo (double[] a, double[] b) |
| Add every entry of array b to the corresponding entry in array a. More...
|
|
static void | subtractFrom (double[] a, double[] b) |
| Subtract every entry of matrix b from the corresponding entry in matrix a. (Perform a-b) More...
|
|
static double | computeSum (double[] a) |
| Return the sum of all elements in a double array. More...
|
|
Collection of static methods to deal with spatial grids that are used in the MicroCoSm model.
Collection of static methods to deal with spatial grids that are used in the MicroCoSm model. Includes methods for dealing with the vectorized array data structure and for checking consistency of different cubic grids.
- Author
- Andreas Dotsch (andre.nosp@m.as.d.nosp@m.oetsc.nosp@m.h@he.nosp@m.lmhol.nosp@m.tz-h.nosp@m.zi.de), Helmholtz Centre for Infection Research (Germany)
static void utils.GridOperations.addTo |
( |
double[] |
a, |
|
|
double[] |
b |
|
) |
| |
|
static |
Add every entry of array b to the corresponding entry in array a.
Add every entry of array b to the corresponding entry in array a
- Parameters
-
a | Target array |
b | Array of values being added to a |
static double utils.GridOperations.computeSum |
( |
double[] |
a | ) |
|
|
static |
Return the sum of all elements in a double array.
Return the sum of all elements in a double array
- Parameters
-
- Returns
- the sum of all elements of a
static int utils.GridOperations.gcd |
( |
int |
a, |
|
|
int |
b |
|
) |
| |
|
static |
Find the greatest common divisor of two integer numbers.
Find the greatest common divisor of two integer numbers
- Parameters
-
a | Integer one |
b | Integer two |
- Returns
- the greatest common divisor (int)
- Deprecated:
static boolean utils.GridOperations.isConsistent |
( |
int[] |
a, |
|
|
int[] |
b |
|
) |
| |
|
static |
Check the consistency of two grid sizes.
Check the consistency of two grid sizes. Two grids of cubic voxels are consistent if one could be transformed to the other by dividing and then multipliying the number of voxels in each dimension by an integer number, respectively.
- Parameters
-
a | Grid sizes of first grid as an array of integers {nI,nJ,nK} |
b | Grid sizes of second grid as an array of integers {nI,nJ,nK} |
- Returns
- true if grids are consistent
static double [][][] utils.GridOperations.reshapeArray |
( |
double[] |
vectorized, |
|
|
int |
nI, |
|
|
int |
nJ, |
|
|
int |
nK |
|
) |
| |
|
static |
Reshape a vectorized array to 3 dimensional array.
Reshape a vectorized array to 3 dimensional array
- Parameters
-
vectorized | the vectorized array |
nI | Array size in I direction |
nJ | Array size in J direction |
nK | Array size in K direction |
- Returns
- the reshaped array
- Deprecated:
static void utils.GridOperations.subtractFrom |
( |
double[] |
a, |
|
|
double[] |
b |
|
) |
| |
|
static |
Subtract every entry of matrix b from the corresponding entry in matrix a. (Perform a-b)
Subtract every entry of matrix b from the corresponding entry in matrix a. (Perform a-b)
- Parameters
-
a | Target array |
b | Array of values being subtracted from a |
static double [] utils.GridOperations.vectorizeArray |
( |
double |
originalArray[][][] | ) |
|
|
static |
Transforms a 3D array to a 1D array.
Transforms a 3D array to a 1D array
- Parameters
-
originalArray | 3 dimensional array to transform |
- Returns
- Vectorized array in one dimension
- Deprecated:
static double [] utils.GridOperations.vectorizeArray |
( |
double |
originalArray[][] | ) |
|
|
static |
Transforms a 2D array to a 1D array.
Transforms a 2D array to a 1D array
- Parameters
-
originalArray | 2 dimensional array to transform |
- Returns
- Vectorized array in one dimension
- Deprecated:
The documentation for this class was generated from the following file: