protected static class RegionPlacementMaintainer.RandomizedMatrix extends Object
Modifier and Type  Field and Description 

private int[] 
colInverse 
private int 
cols 
private int[] 
colTransform 
private int[] 
rowInverse 
private int 
rows 
private int[] 
rowTransform 
Constructor and Description 

RandomizedMatrix(int rows,
int cols)
Create a randomization scheme for a matrix of a given size.

Modifier and Type  Method and Description 

float[][] 
invert(float[][] matrix)
Copy a given matrix into a new matrix, transforming each row index and
each column index according to the inverse of the randomization scheme
that was created at construction time.

int[] 
invertIndices(int[] indices)
Given an array where each element
indices[i] represents the
randomized column index corresponding to randomized row index i ,
create a new array with the corresponding inverted indices. 
float[][] 
transform(float[][] matrix)
Copy a given matrix into a new matrix, transforming each row index and
each column index according to the randomization scheme that was created
at construction time.

private final int rows
private final int cols
private final int[] rowTransform
private final int[] rowInverse
private final int[] colTransform
private final int[] colInverse
public RandomizedMatrix(int rows, int cols)
rows
 the number of rows in the matrixcols
 the number of columns in the matrixpublic float[][] transform(float[][] matrix)
matrix
 the cost matrix to transformpublic float[][] invert(float[][] matrix)
matrix
 the cost matrix to be invertedpublic int[] invertIndices(int[] indices)
indices[i]
represents the
randomized column index corresponding to randomized row index i
,
create a new array with the corresponding inverted indices.indices
 an array of transformed indices to be invertedCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.