Class Array2DRowFieldMatrix<T extends FieldElement<T>>
- java.lang.Object
-
- org.hipparchus.linear.AbstractFieldMatrix<T>
-
- org.hipparchus.linear.Array2DRowFieldMatrix<T>
-
- Type Parameters:
T- the type of the field elements
- All Implemented Interfaces:
Serializable,AnyMatrix,FieldMatrix<T>,FieldBlendable<FieldMatrix<T>,T>
public class Array2DRowFieldMatrix<T extends FieldElement<T>> extends AbstractFieldMatrix<T> implements Serializable
Implementation ofFieldMatrixusing aFieldElement[][] array to store entries.As specified in the
FieldMatrixinterface, matrix element indexing is 0-based -- e.g.,getEntry(0, 0)returns the element in the first row, first column of the matrix- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Array2DRowFieldMatrix(Field<T> field)Creates a matrix with no dataArray2DRowFieldMatrix(Field<T> field, int rowDimension, int columnDimension)Create a newFieldMatrix<T>with the supplied row and column dimensions.Array2DRowFieldMatrix(Field<T> field, T[] v)Create a new (column)FieldMatrix<T>usingvas the data for the unique column of the created matrix.Array2DRowFieldMatrix(Field<T> field, T[][] d)Create a newFieldMatrix<T>using the input array as the underlying data array.Array2DRowFieldMatrix(Field<T> field, T[][] d, boolean copyArray)Create a newFieldMatrix<T>using the input array as the underlying data array.Array2DRowFieldMatrix(T[] v)Create a new (column)FieldMatrix<T>usingvas the data for the unique column of the created matrix.Array2DRowFieldMatrix(T[][] d)Create a newFieldMatrix<T>using the input array as the underlying data array.Array2DRowFieldMatrix(T[][] d, boolean copyArray)Create a newFieldMatrix<T>using the input array as the underlying data array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Array2DRowFieldMatrix<T>add(Array2DRowFieldMatrix<T> m)Addmto this matrix.voidaddToEntry(int row, int column, T increment)Change an entry in the specified row and column.FieldMatrix<T>copy()Make a (deep) copy of this.FieldMatrix<T>createMatrix(int rowDimension, int columnDimension)Create a newFieldMatrixof the same type as the instance with the supplied row and column dimensions.intgetColumnDimension()Returns the number of columns in the matrix.T[][]getData()Returns matrix entries as a two-dimensional array.T[][]getDataRef()Get a reference to the underlying data array.TgetEntry(int row, int column)Returns the entry in the specified row and column.T[]getRow(int row)Get the entries in row numberrowas an array.intgetRowDimension()Returns the number of rows in the matrix.FieldMatrix<T>getSubMatrix(int startRow, int endRow, int startColumn, int endColumn)Get a submatrix.Array2DRowFieldMatrix<T>multiply(Array2DRowFieldMatrix<T> m)Postmultiplying this matrix bym.voidmultiplyEntry(int row, int column, T factor)Change an entry in the specified row and column.FieldMatrix<T>multiplyTransposed(Array2DRowFieldMatrix<T> m)Returns the result of postmultiplyingthisbym^T.FieldMatrix<T>multiplyTransposed(FieldMatrix<T> m)Returns the result of postmultiplyingthisbym^T.T[]operate(T[] v)Returns the result of multiplying this by the vectorv.T[]preMultiply(T[] v)Returns the (row) vector result of premultiplying this by the vectorv.voidsetEntry(int row, int column, T value)Set the entry in the specified row and column.voidsetRow(int row, T[] array)Set the entries in row numberrowas a row matrix.voidsetSubMatrix(T[][] subMatrix, int row, int column)Replace the submatrix starting at(row, column)using data in the inputsubMatrixarray.Array2DRowFieldMatrix<T>subtract(Array2DRowFieldMatrix<T> m)Subtractmfrom this matrix.FieldMatrix<T>transposeMultiply(Array2DRowFieldMatrix<T> m)Returns the result of postmultiplyingthis^Tbym.FieldMatrix<T>transposeMultiply(FieldMatrix<T> m)Returns the result of postmultiplyingthis^Tbym.TwalkInColumnOrder(FieldMatrixChangingVisitor<T> visitor)Visit (and possibly change) all matrix entries in column order.TwalkInColumnOrder(FieldMatrixChangingVisitor<T> visitor, int startRow, int endRow, int startColumn, int endColumn)Visit (and possibly change) some matrix entries in column order.TwalkInColumnOrder(FieldMatrixPreservingVisitor<T> visitor)Visit (but don't change) all matrix entries in column order.TwalkInColumnOrder(FieldMatrixPreservingVisitor<T> visitor, int startRow, int endRow, int startColumn, int endColumn)Visit (but don't change) some matrix entries in column order.TwalkInRowOrder(FieldMatrixChangingVisitor<T> visitor)Visit (and possibly change) all matrix entries in row order.TwalkInRowOrder(FieldMatrixChangingVisitor<T> visitor, int startRow, int endRow, int startColumn, int endColumn)Visit (and possibly change) some matrix entries in row order.TwalkInRowOrder(FieldMatrixPreservingVisitor<T> visitor)Visit (but don't change) all matrix entries in row order.TwalkInRowOrder(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 class org.hipparchus.linear.AbstractFieldMatrix
add, checkAdditionCompatible, checkColumnIndex, checkMultiplicationCompatible, checkRowIndex, checkSubMatrixIndex, checkSubMatrixIndex, checkSubtractionCompatible, copySubMatrix, copySubMatrix, equals, extractField, extractField, getColumn, getColumnMatrix, getColumnVector, getField, getRowMatrix, getRowVector, getSubMatrix, getTrace, hashCode, isSquare, multiply, operate, power, preMultiply, preMultiply, scalarAdd, scalarMultiply, setColumn, setColumnMatrix, setColumnVector, setRowMatrix, setRowVector, subtract, toString, transpose, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hipparchus.linear.FieldMatrix
blendArithmeticallyWith, map, mapToSelf
-
-
-
-
Constructor Detail
-
Array2DRowFieldMatrix
public Array2DRowFieldMatrix(Field<T> field)
Creates a matrix with no data- Parameters:
field- field to which the elements belong
-
Array2DRowFieldMatrix
public Array2DRowFieldMatrix(Field<T> field, int rowDimension, int columnDimension) throws MathIllegalArgumentException
Create a newFieldMatrix<T>with the supplied row and column dimensions.- Parameters:
field- Field to which the elements belong.rowDimension- Number of rows in the new matrix.columnDimension- Number of columns in the new matrix.- Throws:
MathIllegalArgumentException- if row or column dimension is not positive.
-
Array2DRowFieldMatrix
public Array2DRowFieldMatrix(T[][] d) throws MathIllegalArgumentException, NullArgumentException
Create a newFieldMatrix<T>using the input array as the underlying data array.The input array is copied, not referenced. This constructor has the same effect as calling
Array2DRowFieldMatrix(FieldElement[][], boolean)with the second argument set totrue.- Parameters:
d- Data for the new matrix.- Throws:
MathIllegalArgumentException- ifdis not rectangular.NullArgumentException- ifdisnull.MathIllegalArgumentException- if there are not at least one row and one column.- See Also:
Array2DRowFieldMatrix(FieldElement[][], boolean)
-
Array2DRowFieldMatrix
public Array2DRowFieldMatrix(Field<T> field, T[][] d) throws MathIllegalArgumentException, NullArgumentException
Create a newFieldMatrix<T>using the input array as the underlying data array.The input array is copied, not referenced. This constructor has the same effect as calling
Array2DRowFieldMatrix(FieldElement[][], boolean)with the second argument set totrue.- Parameters:
field- Field to which the elements belong.d- Data for the new matrix.- Throws:
MathIllegalArgumentException- ifdis not rectangular.NullArgumentException- ifdisnull.MathIllegalArgumentException- if there are not at least one row and one column.- See Also:
Array2DRowFieldMatrix(FieldElement[][], boolean)
-
Array2DRowFieldMatrix
public Array2DRowFieldMatrix(T[][] d, boolean copyArray) throws MathIllegalArgumentException, NullArgumentException
Create a newFieldMatrix<T>using the input array as the underlying data array.If an array is built specially in order to be embedded in a
FieldMatrix<T>and not used directly, thecopyArraymay be set tofalse. This will prevent the copying and improve performance as no new array will be built and no data will be copied.- Parameters:
d- Data for the new matrix.copyArray- Whether to copy or reference the input array.- Throws:
MathIllegalArgumentException- ifdis not rectangular.MathIllegalArgumentException- if there are not at least one row and one column.NullArgumentException- ifdisnull.- See Also:
Array2DRowFieldMatrix(FieldElement[][])
-
Array2DRowFieldMatrix
public Array2DRowFieldMatrix(Field<T> field, T[][] d, boolean copyArray) throws MathIllegalArgumentException, NullArgumentException
Create a newFieldMatrix<T>using the input array as the underlying data array.If an array is built specially in order to be embedded in a
FieldMatrix<T>and not used directly, thecopyArraymay be set tofalse. This will prevent the copying and improve performance as no new array will be built and no data will be copied.- Parameters:
field- Field to which the elements belong.d- Data for the new matrix.copyArray- Whether to copy or reference the input array.- Throws:
MathIllegalArgumentException- ifdis not rectangular.MathIllegalArgumentException- if there are not at least one row and one column.NullArgumentException- ifdisnull.- See Also:
Array2DRowFieldMatrix(FieldElement[][])
-
Array2DRowFieldMatrix
public Array2DRowFieldMatrix(T[] v) throws MathIllegalArgumentException
Create a new (column)FieldMatrix<T>usingvas the data for the unique column of the created matrix. The input array is copied.- Parameters:
v- Column vector holding data for new matrix.- Throws:
MathIllegalArgumentException- if v is empty
-
Array2DRowFieldMatrix
public Array2DRowFieldMatrix(Field<T> field, T[] v)
Create a new (column)FieldMatrix<T>usingvas the data for the unique column of the created matrix. The input array is copied.- Parameters:
field- Field to which the elements belong.v- Column vector holding data for new matrix.
-
-
Method Detail
-
createMatrix
public FieldMatrix<T> createMatrix(int rowDimension, int columnDimension) throws MathIllegalArgumentException
Create a newFieldMatrixof the same type as the instance with the supplied row and column dimensions.- Specified by:
createMatrixin interfaceFieldMatrix<T extends FieldElement<T>>- Specified by:
createMatrixin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
rowDimension- the number of rows in the new matrixcolumnDimension- the number of columns in the new matrix- Returns:
- a new matrix of the same type as the instance
- Throws:
MathIllegalArgumentException- if row or column dimension is not positive.
-
copy
public FieldMatrix<T> copy()
Make a (deep) copy of this.- Specified by:
copyin interfaceFieldMatrix<T extends FieldElement<T>>- Specified by:
copyin classAbstractFieldMatrix<T extends FieldElement<T>>- Returns:
- a copy of this matrix.
-
add
public Array2DRowFieldMatrix<T> add(Array2DRowFieldMatrix<T> m) throws MathIllegalArgumentException
Addmto this matrix.- Parameters:
m- Matrix to be added.- Returns:
this+ m.- Throws:
MathIllegalArgumentException- ifmis not the same size as this matrix.
-
subtract
public Array2DRowFieldMatrix<T> subtract(Array2DRowFieldMatrix<T> m) throws MathIllegalArgumentException
Subtractmfrom this matrix.- Parameters:
m- Matrix to be subtracted.- Returns:
this+ m.- Throws:
MathIllegalArgumentException- ifmis not the same size as this matrix.
-
multiply
public Array2DRowFieldMatrix<T> multiply(Array2DRowFieldMatrix<T> m) throws MathIllegalArgumentException
Postmultiplying this matrix bym.- Parameters:
m- Matrix to postmultiply by.- Returns:
this* m.- Throws:
MathIllegalArgumentException- if the number of columns of this matrix is not equal to the number of rows ofm.
-
multiplyTransposed
public FieldMatrix<T> multiplyTransposed(Array2DRowFieldMatrix<T> m) throws MathIllegalArgumentException
Returns the result of postmultiplyingthisbym^T.- Parameters:
m- matrix to first transpose and second postmultiply by- Returns:
this * m^T- Throws:
MathIllegalArgumentException- ifcolumnDimension(this) != columnDimension(m)- Since:
- 1.3
-
multiplyTransposed
public FieldMatrix<T> multiplyTransposed(FieldMatrix<T> m)
Returns the result of postmultiplyingthisbym^T.This is equivalent to call
multiply(m.FieldMatrix.transpose()), but some implementations may avoid building the intermediate transposed matrix.- Specified by:
multiplyTransposedin interfaceFieldMatrix<T extends FieldElement<T>>- Parameters:
m- matrix to first transpose and second postmultiply by- Returns:
this * m^T
-
transposeMultiply
public FieldMatrix<T> transposeMultiply(Array2DRowFieldMatrix<T> m) throws MathIllegalArgumentException
Returns the result of postmultiplyingthis^Tbym.- Parameters:
m- matrix to postmultiply by- Returns:
this^T * m- Throws:
MathIllegalArgumentException- ifcolumnDimension(this) != columnDimension(m)- Since:
- 1.3
-
transposeMultiply
public FieldMatrix<T> transposeMultiply(FieldMatrix<T> m)
Returns the result of postmultiplyingthis^Tbym.This is equivalent to call
FieldMatrix.transpose().multiply(m), but some implementations may avoid building the intermediate transposed matrix.- Specified by:
transposeMultiplyin interfaceFieldMatrix<T extends FieldElement<T>>- Parameters:
m- matrix to postmultiply by- Returns:
this^T * m
-
getData
public T[][] getData()
Returns matrix entries as a two-dimensional array.- Specified by:
getDatain interfaceFieldMatrix<T extends FieldElement<T>>- Overrides:
getDatain classAbstractFieldMatrix<T extends FieldElement<T>>- Returns:
- a 2-dimensional array of entries.
-
getDataRef
public T[][] getDataRef()
Get a reference to the underlying data array. This methods returns internal data, not fresh copy of it.- Returns:
- the 2-dimensional array of entries.
-
setSubMatrix
public void setSubMatrix(T[][] subMatrix, int row, int column) throws MathIllegalArgumentException, NullArgumentException
Replace the submatrix starting at(row, column)using data in the inputsubMatrixarray. Indexes are 0-based.Example:
Starting with1 2 3 4 5 6 7 8 9 0 1 2
and
subMatrix = {{3, 4} {5,6}}, invokingsetSubMatrix(subMatrix,1,1))will result in1 2 3 4 5 3 4 8 9 5 6 2
- Specified by:
setSubMatrixin interfaceFieldMatrix<T extends FieldElement<T>>- Overrides:
setSubMatrixin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
subMatrix- Array containing the submatrix replacement data.row- Row coordinate of the top-left element to be replaced.column- Column coordinate of the top-left element to be replaced.- Throws:
MathIllegalArgumentException- ifsubMatrixdoes not fit into this matrix from element in(row, column).NullArgumentException- ifsubMatrixisnull.
-
getEntry
public T getEntry(int row, int column) throws MathIllegalArgumentException
Returns the entry in the specified row and column.- Specified by:
getEntryin interfaceFieldMatrix<T extends FieldElement<T>>- Specified by:
getEntryin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
row- row location of entry to be fetchedcolumn- column location of entry to be fetched- Returns:
- matrix entry in row,column
- Throws:
MathIllegalArgumentException- if the row or column index is not valid.
-
setEntry
public void setEntry(int row, int column, T value) throws MathIllegalArgumentExceptionSet the entry in the specified row and column.- Specified by:
setEntryin interfaceFieldMatrix<T extends FieldElement<T>>- Specified by:
setEntryin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
row- row location of entry to be setcolumn- column location of entry to be setvalue- matrix entry to be set in row,column- Throws:
MathIllegalArgumentException- if the row or column index is not valid.
-
addToEntry
public void addToEntry(int row, int column, T increment) throws MathIllegalArgumentExceptionChange an entry in the specified row and column.- Specified by:
addToEntryin interfaceFieldMatrix<T extends FieldElement<T>>- Specified by:
addToEntryin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
row- Row location of entry to be set.column- Column location of entry to be set.increment- Value to add to the current matrix entry in(row, column).- Throws:
MathIllegalArgumentException- if the row or column index is not valid.
-
multiplyEntry
public void multiplyEntry(int row, int column, T factor) throws MathIllegalArgumentExceptionChange an entry in the specified row and column.- Specified by:
multiplyEntryin interfaceFieldMatrix<T extends FieldElement<T>>- Specified by:
multiplyEntryin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
row- Row location of entry to be set.column- Column location of entry to be set.factor- Multiplication factor for the current matrix entry in(row,column)- Throws:
MathIllegalArgumentException- if the row or column index is not valid.
-
getRowDimension
public int getRowDimension()
Returns the number of rows in the matrix.- Specified by:
getRowDimensionin interfaceAnyMatrix- Specified by:
getRowDimensionin classAbstractFieldMatrix<T extends FieldElement<T>>- Returns:
- rowDimension
-
getColumnDimension
public int getColumnDimension()
Returns the number of columns in the matrix.- Specified by:
getColumnDimensionin interfaceAnyMatrix- Specified by:
getColumnDimensionin classAbstractFieldMatrix<T extends FieldElement<T>>- Returns:
- columnDimension
-
operate
public T[] operate(T[] v) throws MathIllegalArgumentException
Returns the result of multiplying this by the vectorv.- Specified by:
operatein interfaceFieldMatrix<T extends FieldElement<T>>- Overrides:
operatein classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
v- the vector to operate on- Returns:
this * v- Throws:
MathIllegalArgumentException- if the number of columns ofthismatrix is not equal to the size of the vectorv.
-
preMultiply
public T[] preMultiply(T[] v) throws MathIllegalArgumentException
Returns the (row) vector result of premultiplying this by the vectorv.- Specified by:
preMultiplyin interfaceFieldMatrix<T extends FieldElement<T>>- Overrides:
preMultiplyin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
v- the row vector to premultiply by- Returns:
v * this- Throws:
MathIllegalArgumentException- if the number of rows ofthismatrix is not equal to the size of the vectorv
-
getSubMatrix
public FieldMatrix<T> getSubMatrix(int startRow, int endRow, int startColumn, int endColumn) throws MathIllegalArgumentException
Get a submatrix. Rows and columns are indicated counting from 0 to n - 1.- Specified by:
getSubMatrixin interfaceFieldMatrix<T extends FieldElement<T>>- Overrides:
getSubMatrixin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
startRow- Initial row indexendRow- Final row index (inclusive)startColumn- Initial column indexendColumn- Final column index (inclusive)- Returns:
- the matrix containing the data of the specified rows and columns.
- Throws:
MathIllegalArgumentException- isendRow < startRowofendColumn < startColumn.
-
walkInRowOrder
public T walkInRowOrder(FieldMatrixChangingVisitor<T> visitor)
Visit (and possibly change) all matrix entries in row order.Row order starts at upper left and iterating through all elements of a row from left to right before going to the leftmost element of the next row.
- Specified by:
walkInRowOrderin interfaceFieldMatrix<T extends FieldElement<T>>- Overrides:
walkInRowOrderin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
visitor- visitor used to process all matrix entries- Returns:
- the value returned by
FieldMatrixChangingVisitor.end()at the end of the walk - See Also:
FieldMatrix.walkInRowOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int),FieldMatrix.walkInColumnOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInColumnOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int)
-
walkInRowOrder
public T walkInRowOrder(FieldMatrixPreservingVisitor<T> visitor)
Visit (but don't change) all matrix entries in row order.Row order starts at upper left and iterating through all elements of a row from left to right before going to the leftmost element of the next row.
- Specified by:
walkInRowOrderin interfaceFieldMatrix<T extends FieldElement<T>>- Overrides:
walkInRowOrderin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
visitor- visitor used to process all matrix entries- Returns:
- the value returned by
FieldMatrixPreservingVisitor.end()at the end of the walk - See Also:
FieldMatrix.walkInRowOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int),FieldMatrix.walkInColumnOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInColumnOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int)
-
walkInRowOrder
public T walkInRowOrder(FieldMatrixChangingVisitor<T> visitor, int startRow, int endRow, int startColumn, int endColumn) throws MathIllegalArgumentException
Visit (and possibly change) some matrix entries in row order.Row order starts at upper left and iterating through all elements of a row from left to right before going to the leftmost element of the next row.
- Specified by:
walkInRowOrderin interfaceFieldMatrix<T extends FieldElement<T>>- Overrides:
walkInRowOrderin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
visitor- visitor used to process all matrix entriesstartRow- Initial row indexendRow- Final row index (inclusive)startColumn- Initial column indexendColumn- Final column index- Returns:
- the value returned by
FieldMatrixChangingVisitor.end()at the end of the walk - Throws:
MathIllegalArgumentException- if the indices are not valid.- See Also:
FieldMatrix.walkInRowOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInRowOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int),FieldMatrix.walkInColumnOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInColumnOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int)
-
walkInRowOrder
public T walkInRowOrder(FieldMatrixPreservingVisitor<T> visitor, int startRow, int endRow, int startColumn, int endColumn) throws MathIllegalArgumentException
Visit (but don't change) some matrix entries in row order.Row order starts at upper left and iterating through all elements of a row from left to right before going to the leftmost element of the next row.
- Specified by:
walkInRowOrderin interfaceFieldMatrix<T extends FieldElement<T>>- Overrides:
walkInRowOrderin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
visitor- visitor used to process all matrix entriesstartRow- Initial row indexendRow- Final row index (inclusive)startColumn- Initial column indexendColumn- Final column index- Returns:
- the value returned by
FieldMatrixPreservingVisitor.end()at the end of the walk - Throws:
MathIllegalArgumentException- if the indices are not valid.- See Also:
FieldMatrix.walkInRowOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInRowOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInColumnOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInColumnOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int)
-
walkInColumnOrder
public T walkInColumnOrder(FieldMatrixChangingVisitor<T> visitor)
Visit (and possibly change) all matrix entries in column order.Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the topmost element of the next column.
- Specified by:
walkInColumnOrderin interfaceFieldMatrix<T extends FieldElement<T>>- Overrides:
walkInColumnOrderin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
visitor- visitor used to process all matrix entries- Returns:
- the value returned by
FieldMatrixChangingVisitor.end()at the end of the walk - See Also:
FieldMatrix.walkInRowOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInRowOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int),FieldMatrix.walkInColumnOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int)
-
walkInColumnOrder
public T walkInColumnOrder(FieldMatrixPreservingVisitor<T> visitor)
Visit (but don't change) all matrix entries in column order.Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the topmost element of the next column.
- Specified by:
walkInColumnOrderin interfaceFieldMatrix<T extends FieldElement<T>>- Overrides:
walkInColumnOrderin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
visitor- visitor used to process all matrix entries- Returns:
- the value returned by
FieldMatrixPreservingVisitor.end()at the end of the walk - See Also:
FieldMatrix.walkInRowOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInRowOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int),FieldMatrix.walkInColumnOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int)
-
walkInColumnOrder
public T walkInColumnOrder(FieldMatrixChangingVisitor<T> visitor, int startRow, int endRow, int startColumn, int endColumn) throws MathIllegalArgumentException
Visit (and possibly change) some matrix entries in column order.Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the topmost element of the next column.
- Specified by:
walkInColumnOrderin interfaceFieldMatrix<T extends FieldElement<T>>- Overrides:
walkInColumnOrderin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
visitor- visitor used to process all matrix entriesstartRow- Initial row indexendRow- Final row index (inclusive)startColumn- Initial column indexendColumn- Final column index- Returns:
- the value returned by
FieldMatrixChangingVisitor.end()at the end of the walk - Throws:
MathIllegalArgumentException- ifendRow < startRoworendColumn < startColumn.- See Also:
FieldMatrix.walkInRowOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInRowOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int),FieldMatrix.walkInColumnOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInColumnOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInColumnOrder(FieldMatrixPreservingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int)
-
walkInColumnOrder
public T walkInColumnOrder(FieldMatrixPreservingVisitor<T> visitor, int startRow, int endRow, int startColumn, int endColumn) throws MathIllegalArgumentException
Visit (but don't change) some matrix entries in column order.Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the topmost element of the next column.
- Specified by:
walkInColumnOrderin interfaceFieldMatrix<T extends FieldElement<T>>- Overrides:
walkInColumnOrderin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
visitor- visitor used to process all matrix entriesstartRow- Initial row indexendRow- Final row index (inclusive)startColumn- Initial column indexendColumn- Final column index- Returns:
- the value returned by
FieldMatrixPreservingVisitor.end()at the end of the walk - Throws:
MathIllegalArgumentException- ifendRow < startRoworendColumn < startColumn.- See Also:
FieldMatrix.walkInRowOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInRowOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int),FieldMatrix.walkInColumnOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInColumnOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInColumnOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor),FieldMatrix.walkInOptimizedOrder(FieldMatrixChangingVisitor, int, int, int, int),FieldMatrix.walkInOptimizedOrder(FieldMatrixPreservingVisitor, int, int, int, int)
-
getRow
public T[] getRow(int row) throws MathIllegalArgumentException
Get the entries in row numberrowas an array.- Specified by:
getRowin interfaceFieldMatrix<T extends FieldElement<T>>- Overrides:
getRowin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
row- Row to be fetched.- Returns:
- array of entries in the row.
- Throws:
MathIllegalArgumentException- if the specified row index is not valid.
-
setRow
public void setRow(int row, T[] array) throws MathIllegalArgumentExceptionSet the entries in row numberrowas a row matrix.- Specified by:
setRowin interfaceFieldMatrix<T extends FieldElement<T>>- Overrides:
setRowin classAbstractFieldMatrix<T extends FieldElement<T>>- Parameters:
row- Row to be set.array- Row matrix (must have the same number of columns as the instance).- Throws:
MathIllegalArgumentException- if the specified row index is invalid.
-
-