org.apache.commons.math3.linear

Interface FieldMatrix<T extends FieldElement<T>>

• Type Parameters:
T - the type of the field elements
All Superinterfaces:
AnyMatrix
All Known Implementing Classes:
AbstractFieldMatrix, Array2DRowFieldMatrix, BlockFieldMatrix, SparseFieldMatrix

public interface FieldMatrix<T extends FieldElement<T>>
extends AnyMatrix
Interface defining field-valued matrix with basic algebraic operations.

Matrix element indexing is 0-based -- e.g., getEntry(0, 0) returns the element in the first row, first column of the matrix.

• Method Summary

Methods
Modifier and Type Method and Description
FieldMatrix<T> add(FieldMatrix<T> m)
Compute the sum of this and m.
void addToEntry(int row, int column, T increment)
Change an entry in the specified row and column.
FieldMatrix<T> copy()
Make a (deep) copy of this.
void copySubMatrix(int[] selectedRows, int[] selectedColumns, T[][] destination)
Copy a submatrix.
void copySubMatrix(int startRow, int endRow, int startColumn, int endColumn, T[][] destination)
Copy a submatrix.
FieldMatrix<T> createMatrix(int rowDimension, int columnDimension)
Create a new FieldMatrix of the same type as the instance with the supplied row and column dimensions.
T[] getColumn(int column)
Get the entries in column number col as an array.
FieldMatrix<T> getColumnMatrix(int column)
Get the entries in column number column as a column matrix.
FieldVector<T> getColumnVector(int column)
Returns the entries in column number column as a vector.
T[][] getData()
Returns matrix entries as a two-dimensional array.
T getEntry(int row, int column)
Returns the entry in the specified row and column.
Field<T> getField()
Get the type of field elements of the matrix.
T[] getRow(int row)
Get the entries in row number row as an array.
FieldMatrix<T> getRowMatrix(int row)
Get the entries in row number row as a row matrix.
FieldVector<T> getRowVector(int row)
Get the entries in row number row as a vector.
FieldMatrix<T> getSubMatrix(int[] selectedRows, int[] selectedColumns)
Get a submatrix.
FieldMatrix<T> getSubMatrix(int startRow, int endRow, int startColumn, int endColumn)
Get a submatrix.
T getTrace()
Returns the trace of the matrix (the sum of the elements on the main diagonal).
FieldMatrix<T> multiply(FieldMatrix<T> m)
Postmultiply this matrix by m.
void multiplyEntry(int row, int column, T factor)
Change an entry in the specified row and column.
FieldVector<T> operate(FieldVector<T> v)
Returns the result of multiplying this by the vector v.
T[] operate(T[] v)
Returns the result of multiplying this by the vector v.
FieldMatrix<T> power(int p)
Returns the result multiplying this with itself p times.
FieldMatrix<T> preMultiply(FieldMatrix<T> m)
Premultiply this matrix by m.
FieldVector<T> preMultiply(FieldVector<T> v)
Returns the (row) vector result of premultiplying this by the vector v.
T[] preMultiply(T[] v)
Returns the (row) vector result of premultiplying this by the vector v.
FieldMatrix<T> scalarAdd(T d)
Increment each entry of this matrix.
FieldMatrix<T> scalarMultiply(T d)
Multiply each entry by d.
void setColumn(int column, T[] array)
Set the entries in column number column as a column matrix.
void setColumnMatrix(int column, FieldMatrix<T> matrix)
Set the entries in column number column as a column matrix.
void setColumnVector(int column, FieldVector<T> vector)
Set the entries in column number column as a vector.
void setEntry(int row, int column, T value)
Set the entry in the specified row and column.
void setRow(int row, T[] array)
Set the entries in row number row as a row matrix.
void setRowMatrix(int row, FieldMatrix<T> matrix)
Set the entries in row number row as a row matrix.
void setRowVector(int row, FieldVector<T> vector)
Set the entries in row number row as a vector.
void setSubMatrix(T[][] subMatrix, int row, int column)
Replace the submatrix starting at (row, column) using data in the input subMatrix array.
FieldMatrix<T> subtract(FieldMatrix<T> m)
Subtract m from this matrix.
FieldMatrix<T> transpose()
Returns the transpose of this matrix.
T walkInColumnOrder(FieldMatrixChangingVisitor<T> visitor)
Visit (and possibly change) all matrix entries in column order.
T walkInColumnOrder(FieldMatrixChangingVisitor<T> visitor, int startRow, int endRow, int startColumn, int endColumn)
Visit (and possibly change) some matrix entries in column order.
T walkInColumnOrder(FieldMatrixPreservingVisitor<T> visitor)
Visit (but don't change) all matrix entries in column order.
T walkInColumnOrder(FieldMatrixPreservingVisitor<T> visitor, int startRow, int endRow, int startColumn, int endColumn)
Visit (but don't change) some matrix entries in column order.
T walkInOptimizedOrder(FieldMatrixChangingVisitor<T> visitor)
Visit (and possibly change) all matrix entries using the fastest possible order.
T walkInOptimizedOrder(FieldMatrixChangingVisitor<T> visitor, int startRow, int endRow, int startColumn, int endColumn)
Visit (and possibly change) some matrix entries using the fastest possible order.
T walkInOptimizedOrder(FieldMatrixPreservingVisitor<T> visitor)
Visit (but don't change) all matrix entries using the fastest possible order.
T walkInOptimizedOrder(FieldMatrixPreservingVisitor<T> visitor, int startRow, int endRow, int startColumn, int endColumn)
Visit (but don't change) some matrix entries using the fastest possible order.
T walkInRowOrder(FieldMatrixChangingVisitor<T> visitor)
Visit (and possibly change) all matrix entries in row order.
T walkInRowOrder(FieldMatrixChangingVisitor<T> visitor, int startRow, int endRow, int startColumn, int endColumn)
Visit (and possibly change) some matrix entries in row order.
T walkInRowOrder(FieldMatrixPreservingVisitor<T> visitor)
Visit (but don't change) all matrix entries in row order.
T walkInRowOrder(FieldMatrixPreservingVisitor<T> visitor, int startRow, int endRow, int startColumn, int endColumn)
Visit (but don't change) some matrix entries in row order.
• Methods inherited from interface org.apache.commons.math3.linear.AnyMatrix

getColumnDimension, getRowDimension, isSquare