Package one.microstream.math
Class Matrix<T>
java.lang.Object
one.microstream.math.Matrix<T>
public class Matrix<T> extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Matrix.IterationMode
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description protected T[]
getArray(int arrayIndex)
protected T[][]
getData()
T
getElementAt(int rowIndex, int colIndex)
Class<T>
getType()
Iterable<T>
iterate()
Iterable<T>
iterate(int centerRowIndex, int centerColumnIndex, double range)
Iterable<T>
iterate(int centerRowIndex, int centerColumnIndex, int squareRadius)
Iterable<T>
iterate(int firstRow, int firstColumn, int lastRow, int lastColumn)
protected Iterable<T>
iterate(int firstRow, int firstColumn, int lastRow, int lastColumn, Double range)
T
setElementAt(int rowIndex, int colIndex, T newElement)
void
swapElements(int rowIndex1, int colIndex1, int rowIndex2, int colIndex2)
String
toString()
static <T> T[][]
validateArray(T[][] array)
Validates ifarray
is a well-formed array in terms of a matrix.
-
Constructor Details
-
Method Details
-
validateArray
Validates ifarray
is a well-formed array in terms of a matrix.Well-formed arrays meet the following criteria:
- Both dimensions have a size greater than 0.
- No nested array may be null.
- All nested arrays have the same size.- Type Parameters:
T
- the element type- Parameters:
array
- the array to validate- Returns:
- the given array
- Throws:
MatrixException
- if array is an invalid matrixNullPointerException
- if array or a member of it isnull
-
getType
-
getData
-
getArray
-
toString
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
getElementAt
- Parameters:
rowIndex
- the row indexcolIndex
- the column index- Returns:
- the element at position (rowIndex, colIndex)
-
setElementAt
- Parameters:
rowIndex
- the row indexcolIndex
- the column indexnewElement
- the element to set- Returns:
- the old element at position (rowIndex, colIndex)
-
swapElements
public void swapElements(int rowIndex1, int colIndex1, int rowIndex2, int colIndex2) -
iterate
-
iterate
protected Iterable<T> iterate(int firstRow, int firstColumn, int lastRow, int lastColumn, Double range) throws IllegalArgumentException- Throws:
IllegalArgumentException
-
iterate
public Iterable<T> iterate(int firstRow, int firstColumn, int lastRow, int lastColumn) throws IllegalArgumentException- Throws:
IllegalArgumentException
-
iterate
public Iterable<T> iterate(int centerRowIndex, int centerColumnIndex, int squareRadius) throws IllegalArgumentException- Throws:
IllegalArgumentException
-
iterate
public Iterable<T> iterate(int centerRowIndex, int centerColumnIndex, double range) throws IllegalArgumentException- Throws:
IllegalArgumentException
-