@CompileStatic class Matrix
Matrix implements a 2-dimensional array of objects
rows
- the number of rowscolumns
- the number of columnsentries
- the elements of the matrix indexed by row and column; initially
the entries are initialised to nullConstructor and description |
---|
Matrix
() |
Type Params | Return Type | Name and description |
---|---|---|
|
List |
getByColumn(int c) Returns the values in column c of the matrix |
|
List |
getByColumn(int c, Range range) Returns the values in column c of the matrix for a limited range of rows |
|
List |
getByRow(int r) Returns the values in column r of the matrix |
|
List |
getByRow(int r, Range range) Returns the values in row r for of the matrix for a limited range of columns |
|
int[] |
getImageRows(int r, int c) Returns a 3 element array, the centre of which is specified as [r, c] |
|
int[] |
getImageRows(int r, int c, int span) Returns a span-sized element array, the centre of which is specified as [r, c] |
|
void |
setByColumn(List colValues, int c) Set the values in a column of the matrix |
|
void |
setByColumn(List colValues, int c, Range range) Set the values in a column of the matrix in a limited range of rows |
|
void |
setByRow(List rowValues, int r) Set the values in a row of the matrix |
|
void |
setByRow(List rowValues, int r, Range range) Set the values in a row of the matrix for a limited range of columns |
|
String |
toString() |
Returns the values in column c of the matrix
c
- the required column numberReturns the values in column c of the matrix for a limited range of rows
c
- the required column numberrange
- specifes a range of row indicesReturns the values in column r of the matrix
r
- the required row numberReturns the values in row r for of the matrix for a limited range of columns
r
- the required row numberrange
- the set of column numbers from which the values will be returnedReturns a 3 element array, the centre of which is specified as [r, c]
r
- row index of the centre element of the returned matrixc
- column index of the centre element of the returned matrixReturns a span-sized element array, the centre of which is specified as [r, c]
r
- row index of the centre element of the returned matrixc
- column index of the centre element of the returned matrixspan
- the size of the row to be returned, assumed to be oddSet the values in a column of the matrix
colValues
- a List of column valuesc
- the index of the column to be setSet the values in a column of the matrix in a limited range of rows
colValues
- a List of column valuesc
- the index of the column to be setrange
- the set of rows to be setSet the values in a row of the matrix
rowValues
- a List of row valuesr
- the index of the row to be setSet the values in a row of the matrix for a limited range of columns
rowValues
- a List of row valuesr
- the index of the row to be setrange
- the set of columns to be setGPP - Groovy Parallel Patterns generated 07-09-2017 by Jon Kerridge, Edinburgh Napier University - j.kerridge@napier.ac.uk