no.uib.cipr.matrix
Class PermutationMatrix
java.lang.Object
no.uib.cipr.matrix.AbstractMatrix
no.uib.cipr.matrix.PermutationMatrix
- All Implemented Interfaces:
- Iterable<MatrixEntry>, Matrix
public class PermutationMatrix
- extends AbstractMatrix
Matrix that represents a permutation of another matrix's rows / columns.
NOTE: the transpose of a permutation matrix is its inverse.
- Author:
- Sam Halliday
Nested classes/interfaces inherited from interface no.uib.cipr.matrix.Matrix |
Matrix.Norm |
Methods inherited from class no.uib.cipr.matrix.AbstractMatrix |
add, add, add, check, checkMultAdd, checkMultAdd, checkRank1, checkRank1, checkRank2, checkRank2, checkSize, checkSolve, checkSolve, checkTransABmultAdd, checkTransAmultAdd, checkTransBmultAdd, checkTransMultAdd, checkTranspose, checkTranspose, checkTransRank1, checkTransRank2, copy, isSquare, iterator, max, max, mult, mult, mult, multAdd, multAdd, multAdd, multAdd, norm, norm1, normF, normInf, numColumns, numRows, rank1, rank1, rank1, rank1, rank1, rank1, rank2, rank2, rank2, rank2, scale, set, set, set, solve, solve, toString, transABmult, transABmult, transABmultAdd, transABmultAdd, transAmult, transAmultAdd, transAmultAdd, transBmult, transBmult, transBmultAdd, transBmultAdd, transMult, transMult, transMultAdd, transMultAdd, transpose, transRank1, transRank1, transRank2, transRank2, transSolve, transSolve, zero |
PermutationMatrix
public PermutationMatrix(int[] permutations)
fromPartialPivots
public static PermutationMatrix fromPartialPivots(int[] pivots)
- The sequential row permutations to perform, e.g. (2, 3, 3) means: permute
row 1 with row 2, then permute row 2 with row 3, then permute row 3 with
row 3 (i.e. do nothing).
Using this factory will ensure that LAPACK optimisations are available
for multiplication operations.
- Parameters:
pivots
- using fortran (1-indexed) notation.
get
public double get(int row,
int column)
- Description copied from interface:
Matrix
- Returns
A(row,column)
- Specified by:
get
in interface Matrix
- Overrides:
get
in class AbstractMatrix
transpose
public Matrix transpose()
- Description copied from interface:
Matrix
- Transposes the matrix in-place. In most cases, the matrix must be square
for this to work.
- Specified by:
transpose
in interface Matrix
- Overrides:
transpose
in class AbstractMatrix
- Returns:
- This matrix
mult
public Matrix mult(Matrix B,
Matrix C)
- Description copied from interface:
Matrix
C = A*B
- Specified by:
mult
in interface Matrix
- Overrides:
mult
in class AbstractMatrix
- Parameters:
B
- Matrix such that B.numRows() == A.numColumns()
and B.numColumns() == C.numColumns()
C
- Matrix such that C.numRows() == A.numRows()
and
B.numColumns() == C.numColumns()
- Returns:
- C
mult
public Matrix mult(Matrix B,
DenseMatrix C)
transAmult
public Matrix transAmult(Matrix B,
Matrix C)
- Description copied from interface:
Matrix
C = AT*B
- Specified by:
transAmult
in interface Matrix
- Overrides:
transAmult
in class AbstractMatrix
- Parameters:
B
- Matrix such that B.numRows() == A.numRows()
and
B.numColumns() == C.numColumns()
C
- Matrix such that C.numRows() == A.numColumns()
and B.numColumns() == C.numColumns()
- Returns:
- C
transAmult
public Matrix transAmult(Matrix B,
DenseMatrix C)
Copyright © 2015. All Rights Reserved.