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 classMatrix.IterationMode -
Constructor Summary
-
Method Summary
Modifier and Type Method Description protected T[]getArray(int arrayIndex)protected T[][]getData()TgetElementAt(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)TsetElementAt(int rowIndex, int colIndex, T newElement)voidswapElements(int rowIndex1, int colIndex1, int rowIndex2, int colIndex2)StringtoString()static <T> T[][]validateArray(T[][] array)Validates ifarrayis a well-formed array in terms of a matrix.
-
Constructor Details
-
Method Details
-
validateArray
Validates ifarrayis 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:
toStringin 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
-