FieldMatrix methods regardless of the underlying storage.
All the methods implemented here use getEntry(int, int) to access
matrix elements. Derived class can provide faster implementations.
| Modifier and Type | Field and Description |
|---|---|
| private final Field | field
Field to which the elements belong. |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | AbstractFieldMatrix(final Field<T>
field to which the elements belong field)Creates a matrix with no data |
| protected | AbstractFieldMatrix(final Field<T>
Field to which the elements belong. field, final int Number of rows in the new matrix. rowDimension, final int Number of columns in the new matrix. columnDimension)Create a new FieldMatrix<t> with the supplied row and column dimensions. |
| Modifier and Type | Method and Description |
|---|---|
| public FieldMatrix | add(FieldMatrix<T>
Matrix to be added. m)Implements org. Compute the sum of this and m. |
| public abstract void | addToEntry(int
Row location of entry to be set. row, int Column location of entry to be set. column, T Value to add to the current matrix entry in
increment)(row, column).Redeclares org. Change an entry in the specified row and column. |
| protected static < Type of the field elements T extends FieldElement | Returns: a new arrayfield to which array elements belong field, final int number of rows rows, final int number of columns (may be negative to build partial
arrays in the same way columns)new Field[rows][] works)
Deprecated
as of 3.2, replaced by
MathArrays#buildArray(Field, int, int)
Build an array of elements. |
| protected static < the type of the field elements T extends FieldElement | Returns: a new arrayfield to which array elements belong field, final int of the array length)
Deprecated
as of 3.2, replaced by
MathArrays#buildArray(Field, int)
Build an array of elements. |
| protected void | checkAdditionCompatible(final FieldMatrix<T>
Matrix to check. m)Check if a matrix is addition compatible with the instance. |
| protected void | |
| protected void | checkMultiplicationCompatible(final FieldMatrix<T>
Matrix to check. m)Check if a matrix is multiplication compatible with the instance. |
| protected void | |
| protected void | checkSubMatrixIndex(final int
Initial row index. startRow, final int Final row index. endRow, final int Initial column index. startColumn, final int Final column index. endColumn)Check if submatrix ranges indices are valid. |
| protected void | checkSubMatrixIndex(final int[]
Array of row indices. selectedRows, final int[] Array of column indices. selectedColumns)Check if submatrix ranges indices are valid. |
| protected void | checkSubtractionCompatible(final FieldMatrix<T>
Matrix to check. m)Check if a matrix is subtraction compatible with the instance. |
| public abstract FieldMatrix | |
| public void | copySubMatrix(final int
Initial row index. startRow, final int Final row index (inclusive). endRow, final int Initial column index. startColumn, final int Final column index (inclusive). endColumn, final T[][] The array where the submatrix data should be copied
(if larger than rows/columns counts, only the upper-left part will be modified). destination)Implements org. Copy a submatrix. |
| public void | copySubMatrix(int[]
Array of row indices. selectedRows, int[] Array of column indices. selectedColumns, T[][] Arrays where the submatrix data should be copied
(if larger than rows/columns counts, only the upper-left part will be used) destination)Implements org. Copy a submatrix. |
| public abstract FieldMatrix | createMatrix(final int
the number of rows in the new matrix rowDimension, final int the number of columns in the new matrix columnDimension)Redeclares org. Create a new FieldMatrix<t> of the same type as the instance with the supplied row and column dimensions. |
| public boolean | Returns: true if object equals thisthe object to test equality against. object)Overrides java. Returns true iff |
| protected static < Type of the field elements. T extends FieldElement | Returns: the field to which the array elements belong.Data array. d)Get the elements type from an array. |
| protected static < Type of the field elements. T extends FieldElement | Returns: the field to which the array elements belong.Data array. d)Get the elements type from an array. |
| public T[] | getColumn(final int
the column to be fetched column)Implements org. Get the entries in column number |
| public abstract int | getColumnDimension()
Redeclares org. Returns the number of columns in the matrix. |
| public FieldMatrix | getColumnMatrix(final int
Column to be fetched. column)Implements org. Get the entries in column number |
| public FieldVector | getColumnVector(final int
Column to be fetched. column)Implements org. Returns the entries in column number |
| public T[][] | getData()
Implements org. Returns matrix entries as a two-dimensional array. |
| public abstract T | getEntry(int
row location of entry to be fetched row, int column location of entry to be fetched column)Redeclares org. Returns the entry in the specified row and column. |
| public Field | getField()
Implements org. Get the type of field elements of the matrix. |
| public T[] | getRow(final int
Row to be fetched. row)Implements org. Get the entries in row number |
| public abstract int | getRowDimension()
Redeclares org. Returns the number of rows in the matrix. |
| public FieldMatrix | getRowMatrix(final int
Row to be fetched. row)Implements org. Get the entries in row number |
| public FieldVector | getRowVector(final int
Row to be fetched row)Implements org. Get the entries in row number |
| public FieldMatrix | getSubMatrix(final int
Initial row index startRow, final int Final row index (inclusive) endRow, final int Initial column index startColumn, final int Final column index (inclusive) endColumn)Implements org. Get a submatrix. |
| public FieldMatrix | getSubMatrix(final int[]
Array of row indices. selectedRows, final int[] Array of column indices. selectedColumns)Implements org. Get a submatrix. |
| public T | getTrace()
Implements org. Returns the trace of the matrix (the sum of the elements on the main diagonal). |
| public int | Returns: hashcode for matrixOverrides java. Computes a hashcode for the matrix. |
| public boolean | |
| public FieldMatrix | multiply(final FieldMatrix<T>
Matrix to postmultiply by. m)Implements org. Postmultiply this matrix by |
| public abstract void | multiplyEntry(int
Row location of entry to be set. row, int Column location of entry to be set. column, T Multiplication factor for the current matrix entry
in factor)(row,column)Redeclares org. Change an entry in the specified row and column. |
| public T[] | operate(final T[]
the vector to operate on v)Implements org. Returns the result of multiplying this by the vector |
| public FieldVector | operate(final FieldVector<T>
the vector to operate on v)Implements org. Returns the result of multiplying this by the vector |
| public FieldMatrix | power(final int
raise this to power p p)Implements org. Returns the result multiplying this with itself |
| public FieldMatrix | preMultiply(final FieldMatrix<T>
Matrix to premultiply by. m)Implements org. Premultiply this matrix by |
| public T[] | preMultiply(final T[]
the row vector to premultiply by v)Implements org. Returns the (row) vector result of premultiplying this by the vector
|
| public FieldVector | preMultiply(final FieldVector<T>
the row vector to premultiply by v)Implements org. Returns the (row) vector result of premultiplying this by the vector
|
| public FieldMatrix | scalarAdd(final T
Value to be added to each entry. d)Implements org. Increment each entry of this matrix. |
| public FieldMatrix | scalarMultiply(final T
Value to multiply all entries by. d)Implements org. Multiply each entry by |
| public void | setColumn(final int
the column to be set column, final T[] column array (must have the same number of rows as the instance) array)Implements org. Set the entries in column number |
| public void | setColumnMatrix(final int
Column to be set. column, final FieldMatrix<T> column matrix (must have one column and the same
number of rows as the instance). matrix)Implements org. Set the entries in column number |
| public void | setColumnVector(final int
Column to be set. column, final FieldVector<T> Column vector (must have the same number of rows
as the instance). vector)Implements org. Set the entries in column number |
| public abstract void | setEntry(int
row location of entry to be set row, int column location of entry to be set column, T matrix entry to be set in row,column value)Redeclares org. Set the entry in the specified row and column. |
| public void | setRow(final int
Row to be set. row, final T[] Row matrix (must have the same number of columns as
the instance). array)Implements org. Set the entries in row number |
| public void | setRowMatrix(final int
Row to be set. row, final FieldMatrix<T> Row matrix (must have one row and the same number
of columns as the instance). matrix)Implements org. Set the entries in row number |
| public void | setRowVector(final int
Row to be set. row, final FieldVector<T> row vector (must have the same number of columns
as the instance). vector)Implements org. Set the entries in row number |
| public void | setSubMatrix(final T[][]
Array containing the submatrix replacement data. subMatrix, final int Row coordinate of the top-left element to be replaced. row, final int Column coordinate of the top-left element to be replaced. column)Implements org. Replace the submatrix starting at |
| public FieldMatrix | subtract(final FieldMatrix<T>
Matrix to be subtracted. m)Implements org. Subtract |
| public String | Returns: a string representation for this matrixOverrides java. Get a string representation for this matrix. |
| public FieldMatrix | transpose()
Implements org. Returns the transpose of this matrix. |
| public T | walkInColumnOrder(final FieldMatrixChangingVisitor<T>
visitor used to process all matrix entries visitor)Implements org. Visit (and possibly change) all matrix entries in column order. |
| public T | walkInColumnOrder(final FieldMatrixPreservingVisitor<T>
visitor used to process all matrix entries visitor)Implements org. Visit (but don't change) all matrix entries in column order. |
| public T | walkInColumnOrder(final FieldMatrixChangingVisitor<T>
visitor used to process all matrix entries visitor, final int Initial row index startRow, final int Final row index (inclusive) endRow, final int Initial column index startColumn, final int Final column index endColumn)Implements org. Visit (and possibly change) some matrix entries in column order. |
| public T | walkInColumnOrder(final FieldMatrixPreservingVisitor<T>
visitor used to process all matrix entries visitor, final int Initial row index startRow, final int Final row index (inclusive) endRow, final int Initial column index startColumn, final int Final column index endColumn)Implements org. Visit (but don't change) some matrix entries in column order. |
| public T | walkInOptimizedOrder(final FieldMatrixChangingVisitor<T>
visitor used to process all matrix entries visitor)Implements org. Visit (and possibly change) all matrix entries using the fastest possible order. |
| public T | walkInOptimizedOrder(final FieldMatrixPreservingVisitor<T>
visitor used to process all matrix entries visitor)Implements org. Visit (but don't change) all matrix entries using the fastest possible order. |
| public T | walkInOptimizedOrder(final FieldMatrixChangingVisitor<T>
visitor used to process all matrix entries visitor, final int Initial row index startRow, final int Final row index (inclusive) endRow, final int Initial column index startColumn, final int Final column index (inclusive) endColumn)Implements org. Visit (and possibly change) some matrix entries using the fastest possible order. |
| public T | walkInOptimizedOrder(final FieldMatrixPreservingVisitor<T>
visitor used to process all matrix entries visitor, final int Initial row index startRow, final int Final row index (inclusive) endRow, final int Initial column index startColumn, final int Final column index (inclusive) endColumn)Implements org. Visit (but don't change) some matrix entries using the fastest possible order. |
| public T | walkInRowOrder(final FieldMatrixChangingVisitor<T>
visitor used to process all matrix entries visitor)Implements org. Visit (and possibly change) all matrix entries in row order. |
| public T | walkInRowOrder(final FieldMatrixPreservingVisitor<T>
visitor used to process all matrix entries visitor)Implements org. Visit (but don't change) all matrix entries in row order. |
| public T | walkInRowOrder(final FieldMatrixChangingVisitor<T>
visitor used to process all matrix entries visitor, final int Initial row index startRow, final int Final row index (inclusive) endRow, final int Initial column index startColumn, final int Final column index endColumn)Implements org. Visit (and possibly change) some matrix entries in row order. |
| public T | walkInRowOrder(final FieldMatrixPreservingVisitor<T>
visitor used to process all matrix entries visitor, final int Initial row index startRow, final int Final row index (inclusive) endRow, final int Initial column index startColumn, final int Final column index endColumn)Implements org. Visit (but don't change) some matrix entries in row order. |