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
-
Method Summary
Modifier and Type Method Description 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)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.
-
-
-
Method Detail
-
validateArray
public static <T> T[][] validateArray(T[][] array) throws MatrixException, NullPointerExceptionValidates 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-- Parameters:
array-- Throws:
MatrixExceptionNullPointerException
-
toString
public String toString()
- Overrides:
toStringin classObject- See Also:
Object.toString()
-
getElementAt
public T getElementAt(int rowIndex, int colIndex)
- Parameters:
rowIndex-colIndex-
-
setElementAt
public T setElementAt(int rowIndex, int colIndex, T newElement)
- Parameters:
rowIndex-colIndex-newElement-- Returns:
- the old element at position (rowIndex, colIndex)
-
swapElements
public void swapElements(int rowIndex1, int colIndex1, int rowIndex2, int colIndex2)- Parameters:
rowIndex1-colIndex1-rowIndex2-colIndex2-
-
iterate
public Iterable<T> iterate(int firstRow, int firstColumn, int lastRow, int lastColumn) throws IllegalArgumentException
- Parameters:
firstRow-firstColumn-lastRow-lastColumn-- 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
-
-