Package no.uib.cipr.matrix
Class AbstractMatrix
- java.lang.Object
-
- no.uib.cipr.matrix.AbstractMatrix
-
- All Implemented Interfaces:
java.lang.Iterable<MatrixEntry>
,Matrix
- Direct Known Subclasses:
BandMatrix
,CompColMatrix
,CompDiagMatrix
,CompRowMatrix
,DenseMatrix
,DistColMatrix
,DistRowMatrix
,FlexCompColMatrix
,FlexCompRowMatrix
,LowerSymmBandMatrix
,LowerSymmDenseMatrix
,LowerSymmPackMatrix
,LowerTriangBandMatrix
,LowerTriangDenseMatrix
,LowerTriangPackMatrix
,SymmTridiagMatrix
,TridiagMatrix
,UpperSymmBandMatrix
,UpperSymmDenseMatrix
,UpperSymmPackMatrix
,UpperTriangBandMatrix
,UpperTriangDenseMatrix
,UpperTriangPackMatrix
public abstract class AbstractMatrix extends java.lang.Object implements Matrix
Partial implementation ofMatrix
. The following methods throwUnsupportedOperationException
, and should be overridden by a subclass:get(int,int)
set(int,int,double)
copy
- All the direct solution methods
For the rest of the methods, simple default implementations using a matrix iterator has been provided. There are some kernel operations which the simpler operations forward to, for instance,
mult(Matrix,Matrix)
forwards tomultAdd(double,Matrix,Matrix)
. Subclasses can thus focus on overriding the kernel operations, which are:-
multAdd(double,Vector,Vector)
andtransMultAdd(double,Vector,Vector)
. -
rank1(double,Vector,Vector)
andrank1(double,Vector,Vector)
. -
multAdd(double,Matrix,Matrix)
,transAmultAdd(double,Matrix,Matrix)
,transBmultAdd(double,Matrix,Matrix)
, andtransABmultAdd(double,Matrix,Matrix)
. -
scale(double)
. -
set(double,Matrix)
andadd(double,Matrix)
. -
transpose
andtranspose(Matrix)
. - All the norms.
Finally, a default iterator is provided by this class, which works by calling the
get
function. A tailored replacement should be used by subclasses.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface no.uib.cipr.matrix.Matrix
Matrix.Norm
-
-
Field Summary
Fields Modifier and Type Field Description protected int
numColumns
Number of columnsprotected int
numRows
Number of rows
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMatrix(int numRows, int numColumns)
Constructor for AbstractMatrixprotected
AbstractMatrix(Matrix A)
Constructor for AbstractMatrix, same size as A.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Matrix
add(double alpha, Matrix B)
A = alpha*B + A
.void
add(int row, int column, double value)
A(row,column) += value
Matrix
add(Matrix B)
A = B + A
.protected void
check(int row, int column)
Checks the passed row and column indicesprotected void
checkMultAdd(Matrix B, Matrix C)
Checks the arguments tomult
andmultAdd
protected void
checkMultAdd(Vector x, Vector y)
Checks the arguments tomult
andmultAdd
protected void
checkRank1(Matrix C)
Checks that a matrix rank1 update is possible for the given matrixprotected void
checkRank1(Vector x, Vector y)
Checks that a vector rank1 update is possible for the given vectorsprotected void
checkRank2(Matrix B, Matrix C)
Checks that a rank2 update is legal for the given argumentsprotected void
checkRank2(Vector x, Vector y)
Checks that a vector rank2 update is legal with the given vectorsprotected void
checkSize(Matrix B)
Checks that the sizes of this matrix and the given conformprotected void
checkSolve(Matrix B, Matrix X)
Checks that a matrix inversion is legal for the given arguments.protected void
checkSolve(Vector b, Vector x)
Checks that a matrix inversion is legal for the given arguments.protected void
checkTransABmultAdd(Matrix B, Matrix C)
Checks the arguments totransABmultAdd
andtransABmultAdd
protected void
checkTransAmultAdd(Matrix B, Matrix C)
Checks the arguments totransAmult
andtransAmultAdd
protected void
checkTransBmultAdd(Matrix B, Matrix C)
Checks the arguments totransBmult
andtransBmultAdd
protected void
checkTransMultAdd(Vector x, Vector y)
Checks the arguments totransMult
andtransMultAdd
protected void
checkTranspose()
Checks that the matrix may be transposedprotected void
checkTranspose(Matrix B)
Checks that this matrix can be transposed into the given matrixprotected void
checkTransRank1(Matrix C)
Checks that a transposed rank1 update is leagal with the given argumentprotected void
checkTransRank2(Matrix B, Matrix C)
Checks that a transposed rank2 update is leagal with the given argumentsMatrix
copy()
Creates a deep copy of the matrixdouble
get(int row, int column)
ReturnsA(row,column)
boolean
isSquare()
Returns true if the matrix is squarejava.util.Iterator<MatrixEntry>
iterator()
protected double
max()
Returns the largest absolute valueprotected double
max(double[] x)
Returns the largest element of the passed arrayMatrix
mult(double alpha, Matrix B, Matrix C)
C = alpha*A*B
Vector
mult(double alpha, Vector x, Vector y)
y = alpha*A*x
Matrix
mult(Matrix B, Matrix C)
C = A*B
Vector
mult(Vector x, Vector y)
y = A*x
Matrix
multAdd(double alpha, Matrix B, Matrix C)
C = alpha*A*B + C
Vector
multAdd(double alpha, Vector x, Vector y)
y = alpha*A*x + y
Matrix
multAdd(Matrix B, Matrix C)
C = A*B + C
Vector
multAdd(Vector x, Vector y)
y = A*x + y
double
norm(Matrix.Norm type)
Computes the given norm of the matrixprotected double
norm1()
Computes the 1 normprotected double
normF()
Computes the Frobenius norm.protected double
normInf()
Computes the infinity normint
numColumns()
Number of columns in the matrixint
numRows()
Number of rows in the matrixMatrix
rank1(double alpha, Matrix C)
A = alpha*C*CT + A
.Matrix
rank1(double alpha, Vector x)
A = alpha*x*xT + A
.Matrix
rank1(double alpha, Vector x, Vector y)
A = alpha*x*yT + A
.Matrix
rank1(Matrix C)
A = C*CT + A
.Matrix
rank1(Vector x)
A = x*xT + A
.Matrix
rank1(Vector x, Vector y)
A = x*yT + A
.Matrix
rank2(double alpha, Matrix B, Matrix C)
A = alpha*B*CT + alpha*C*BT + A
.Matrix
rank2(double alpha, Vector x, Vector y)
A = alpha*x*yT + alpha*y*xT + A
.Matrix
rank2(Matrix B, Matrix C)
A = B*CT + C*BT + A
.Matrix
rank2(Vector x, Vector y)
A = x*yT + y*xT + A
.Matrix
scale(double alpha)
A = alpha*A
Matrix
set(double alpha, Matrix B)
A=alpha*B
.void
set(int row, int column, double value)
A(row,column) = value
Matrix
set(Matrix B)
A=B
.Matrix
solve(Matrix B, Matrix X)
X = A\B
.Vector
solve(Vector b, Vector x)
x = A\b
.java.lang.String
toString()
Matrix
transABmult(double alpha, Matrix B, Matrix C)
C = alpha*AT*BT
Matrix
transABmult(Matrix B, Matrix C)
C = AT*BT
Matrix
transABmultAdd(double alpha, Matrix B, Matrix C)
C = alpha*AT*BT + C
Matrix
transABmultAdd(Matrix B, Matrix C)
C = AT*BT + C
Matrix
transAmult(double alpha, Matrix B, Matrix C)
C = alpha*AT*B
Matrix
transAmult(Matrix B, Matrix C)
C = AT*B
Matrix
transAmultAdd(double alpha, Matrix B, Matrix C)
C = alpha*AT*B + C
Matrix
transAmultAdd(Matrix B, Matrix C)
C = AT*B + C
Matrix
transBmult(double alpha, Matrix B, Matrix C)
C = alpha*A*BT
Matrix
transBmult(Matrix B, Matrix C)
C = A*BT
Matrix
transBmultAdd(double alpha, Matrix B, Matrix C)
C = alpha*A*BT + C
Matrix
transBmultAdd(Matrix B, Matrix C)
C = A*BT + C
Vector
transMult(double alpha, Vector x, Vector y)
y = alpha*AT*x
Vector
transMult(Vector x, Vector y)
y = AT*x
Vector
transMultAdd(double alpha, Vector x, Vector y)
y = alpha*AT*x + y
Vector
transMultAdd(Vector x, Vector y)
y = AT*x + y
Matrix
transpose()
Transposes the matrix in-place.Matrix
transpose(Matrix B)
Sets the tranpose of this matrix intoB
.Matrix
transRank1(double alpha, Matrix C)
A = alpha*CT*C + A
The matrices must be square and of the same sizeMatrix
transRank1(Matrix C)
A = CT*C + A
The matrices must be square and of the same sizeMatrix
transRank2(double alpha, Matrix B, Matrix C)
A = alpha*BT*C + alpha*CT*B + A
.Matrix
transRank2(Matrix B, Matrix C)
A = BT*C + CT*B + A
.Matrix
transSolve(Matrix B, Matrix X)
X = AT\B
.Vector
transSolve(Vector b, Vector x)
x = AT\b
.Matrix
zero()
Zeros all the entries in the matrix, while preserving any underlying structure.
-
-
-
Constructor Detail
-
AbstractMatrix
protected AbstractMatrix(int numRows, int numColumns)
Constructor for AbstractMatrix
-
AbstractMatrix
protected AbstractMatrix(Matrix A)
Constructor for AbstractMatrix, same size as A. The invoking constructor should set this matrix equal the argument matrix
-
-
Method Detail
-
numRows
public int numRows()
Description copied from interface:Matrix
Number of rows in the matrix
-
numColumns
public int numColumns()
Description copied from interface:Matrix
Number of columns in the matrix- Specified by:
numColumns
in interfaceMatrix
-
isSquare
public boolean isSquare()
Description copied from interface:Matrix
Returns true if the matrix is square
-
set
public void set(int row, int column, double value)
Description copied from interface:Matrix
A(row,column) = value
-
add
public void add(int row, int column, double value)
Description copied from interface:Matrix
A(row,column) += value
-
get
public double get(int row, int column)
Description copied from interface:Matrix
ReturnsA(row,column)
-
check
protected void check(int row, int column)
Checks the passed row and column indices
-
copy
public Matrix copy()
Description copied from interface:Matrix
Creates a deep copy of the matrix
-
zero
public Matrix zero()
Description copied from interface:Matrix
Zeros all the entries in the matrix, while preserving any underlying structure. Useful for general, unstructured matrices.
-
mult
public Vector mult(double alpha, Vector x, Vector y)
Description copied from interface:Matrix
y = alpha*A*x
-
multAdd
public Vector multAdd(Vector x, Vector y)
Description copied from interface:Matrix
y = A*x + y
-
multAdd
public Vector multAdd(double alpha, Vector x, Vector y)
Description copied from interface:Matrix
y = alpha*A*x + y
-
checkMultAdd
protected void checkMultAdd(Vector x, Vector y)
Checks the arguments tomult
andmultAdd
-
transMult
public Vector transMult(Vector x, Vector y)
Description copied from interface:Matrix
y = AT*x
-
transMult
public Vector transMult(double alpha, Vector x, Vector y)
Description copied from interface:Matrix
y = alpha*AT*x
-
transMultAdd
public Vector transMultAdd(Vector x, Vector y)
Description copied from interface:Matrix
y = AT*x + y
- Specified by:
transMultAdd
in interfaceMatrix
- Parameters:
x
- Vector of sizeA.numRows()
y
- Vector of sizeA.numColumns()
- Returns:
- y
-
transMultAdd
public Vector transMultAdd(double alpha, Vector x, Vector y)
Description copied from interface:Matrix
y = alpha*AT*x + y
- Specified by:
transMultAdd
in interfaceMatrix
x
- Vector of sizeA.numRows()
y
- Vector of sizeA.numColumns()
- Returns:
- y
-
checkTransMultAdd
protected void checkTransMultAdd(Vector x, Vector y)
Checks the arguments totransMult
andtransMultAdd
-
solve
public Vector solve(Vector b, Vector x)
Description copied from interface:Matrix
x = A\b
. Not all matrices support this operation, those that do not throwUnsupportedOperationException
. Note that it is often more efficient to use a matrix decomposition and its associated solver
-
transSolve
public Vector transSolve(Vector b, Vector x)
Description copied from interface:Matrix
x = AT\b
. Not all matrices support this operation, those that do not throwUnsupportedOperationException
. Note that it is often more efficient to use a matrix decomposition and its associated solver- Specified by:
transSolve
in interfaceMatrix
- Parameters:
b
- Vector of sizeA.numColumns()
x
- Vector of sizeA.numRows()
- Returns:
- x
-
checkSolve
protected void checkSolve(Vector b, Vector x)
Checks that a matrix inversion is legal for the given arguments. This is for the square case, not for least-squares problems
-
rank1
public Matrix rank1(Vector x)
Description copied from interface:Matrix
A = x*xT + A
. The matrix must be square, and the vector of the same length
-
rank1
public Matrix rank1(double alpha, Vector x)
Description copied from interface:Matrix
A = alpha*x*xT + A
. The matrix must be square, and the vector of the same length
-
rank1
public Matrix rank1(Vector x, Vector y)
Description copied from interface:Matrix
A = x*yT + A
. The matrix must be square, and the vectors of the same length
-
rank1
public Matrix rank1(double alpha, Vector x, Vector y)
Description copied from interface:Matrix
A = alpha*x*yT + A
. The matrix must be square, and the vectors of the same length
-
checkRank1
protected void checkRank1(Vector x, Vector y)
Checks that a vector rank1 update is possible for the given vectors
-
rank2
public Matrix rank2(Vector x, Vector y)
Description copied from interface:Matrix
A = x*yT + y*xT + A
. The matrix must be square, and the vectors of the same length
-
rank2
public Matrix rank2(double alpha, Vector x, Vector y)
Description copied from interface:Matrix
A = alpha*x*yT + alpha*y*xT + A
. The matrix must be square, and the vectors of the same length
-
checkRank2
protected void checkRank2(Vector x, Vector y)
Checks that a vector rank2 update is legal with the given vectors
-
mult
public Matrix mult(double alpha, Matrix B, Matrix C)
Description copied from interface:Matrix
C = alpha*A*B
-
multAdd
public Matrix multAdd(Matrix B, Matrix C)
Description copied from interface:Matrix
C = A*B + C
-
multAdd
public Matrix multAdd(double alpha, Matrix B, Matrix C)
Description copied from interface:Matrix
C = alpha*A*B + C
-
checkMultAdd
protected void checkMultAdd(Matrix B, Matrix C)
Checks the arguments tomult
andmultAdd
-
transAmult
public Matrix transAmult(Matrix B, Matrix C)
Description copied from interface:Matrix
C = AT*B
- Specified by:
transAmult
in interfaceMatrix
- Parameters:
B
- Matrix such thatB.numRows() == A.numRows()
andB.numColumns() == C.numColumns()
C
- Matrix such thatC.numRows() == A.numColumns()
andB.numColumns() == C.numColumns()
- Returns:
- C
-
transAmult
public Matrix transAmult(double alpha, Matrix B, Matrix C)
Description copied from interface:Matrix
C = alpha*AT*B
- Specified by:
transAmult
in interfaceMatrix
B
- Matrix such thatB.numRows() == A.numRows()
andB.numColumns() == C.numColumns()
C
- Matrix such thatC.numRows() == A.numColumns()
andB.numColumns() == C.numColumns()
- Returns:
- C
-
transAmultAdd
public Matrix transAmultAdd(Matrix B, Matrix C)
Description copied from interface:Matrix
C = AT*B + C
- Specified by:
transAmultAdd
in interfaceMatrix
- Parameters:
B
- Matrix such thatB.numRows() == A.numRows()
andB.numColumns() == C.numColumns()
C
- Matrix such thatC.numRows() == A.numColumns()
andB.numColumns() == C.numColumns()
- Returns:
- C
-
transAmultAdd
public Matrix transAmultAdd(double alpha, Matrix B, Matrix C)
Description copied from interface:Matrix
C = alpha*AT*B + C
- Specified by:
transAmultAdd
in interfaceMatrix
B
- Matrix such thatB.numRows() == A.numRows()
andB.numColumns() == C.numColumns()
C
- Matrix such thatC.numRows() == A.numColumns()
andB.numColumns() == C.numColumns()
- Returns:
- C
-
checkTransAmultAdd
protected void checkTransAmultAdd(Matrix B, Matrix C)
Checks the arguments totransAmult
andtransAmultAdd
-
transBmult
public Matrix transBmult(Matrix B, Matrix C)
Description copied from interface:Matrix
C = A*BT
- Specified by:
transBmult
in interfaceMatrix
- Parameters:
B
- Matrix such thatB.numRows() == A.numRows()
andB.numColumns() == C.numColumns()
C
- Matrix such thatC.numRows() == A.numColumns()
andB.numColumns() == C.numColumns()
- Returns:
- C
-
transBmult
public Matrix transBmult(double alpha, Matrix B, Matrix C)
Description copied from interface:Matrix
C = alpha*A*BT
- Specified by:
transBmult
in interfaceMatrix
B
- Matrix such thatB.numRows() == A.numRows()
andB.numColumns() == C.numColumns()
C
- Matrix such thatC.numRows() == A.numColumns()
andB.numColumns() == C.numColumns()
- Returns:
- C
-
transBmultAdd
public Matrix transBmultAdd(Matrix B, Matrix C)
Description copied from interface:Matrix
C = A*BT + C
- Specified by:
transBmultAdd
in interfaceMatrix
- Parameters:
B
- Matrix such thatB.numRows() == A.numRows()
andB.numColumns() == C.numColumns()
C
- Matrix such thatC.numRows() == A.numColumns()
andB.numColumns() == C.numColumns()
- Returns:
- C
-
transBmultAdd
public Matrix transBmultAdd(double alpha, Matrix B, Matrix C)
Description copied from interface:Matrix
C = alpha*A*BT + C
- Specified by:
transBmultAdd
in interfaceMatrix
B
- Matrix such thatB.numRows() == A.numRows()
andB.numColumns() == C.numColumns()
C
- Matrix such thatC.numRows() == A.numColumns()
andB.numColumns() == C.numColumns()
- Returns:
- C
-
checkTransBmultAdd
protected void checkTransBmultAdd(Matrix B, Matrix C)
Checks the arguments totransBmult
andtransBmultAdd
-
transABmult
public Matrix transABmult(Matrix B, Matrix C)
Description copied from interface:Matrix
C = AT*BT
- Specified by:
transABmult
in interfaceMatrix
- Parameters:
B
- Matrix such thatB.numColumns() == A.numRows()
andB.numRows() == C.numColumns()
C
- Matrix such thatC.numRows() == A.numColumns()
andB.numRows() == C.numColumns()
- Returns:
- C
-
transABmult
public Matrix transABmult(double alpha, Matrix B, Matrix C)
Description copied from interface:Matrix
C = alpha*AT*BT
- Specified by:
transABmult
in interfaceMatrix
B
- Matrix such thatB.numColumns() == A.numRows()
andB.numRows() == C.numColumns()
C
- Matrix such thatC.numRows() == A.numColumns()
andB.numRows() == C.numColumns()
- Returns:
- C
-
transABmultAdd
public Matrix transABmultAdd(Matrix B, Matrix C)
Description copied from interface:Matrix
C = AT*BT + C
- Specified by:
transABmultAdd
in interfaceMatrix
- Parameters:
B
- Matrix such thatB.numColumns() == A.numRows()
andB.numRows() == C.numColumns()
C
- Matrix such thatC.numRows() == A.numColumns()
andB.numRows() == C.numColumns()
- Returns:
- C
-
transABmultAdd
public Matrix transABmultAdd(double alpha, Matrix B, Matrix C)
Description copied from interface:Matrix
C = alpha*AT*BT + C
- Specified by:
transABmultAdd
in interfaceMatrix
B
- Matrix such thatB.numColumns() == A.numRows()
andB.numRows() == C.numColumns()
C
- Matrix such thatC.numRows() == A.numColumns()
andB.numRows() == C.numColumns()
- Returns:
- C
-
checkTransABmultAdd
protected void checkTransABmultAdd(Matrix B, Matrix C)
Checks the arguments totransABmultAdd
andtransABmultAdd
-
solve
public Matrix solve(Matrix B, Matrix X)
Description copied from interface:Matrix
X = A\B
. Not all matrices support this operation, those that do not throwUnsupportedOperationException
. Note that it is often more efficient to use a matrix decomposition and its associated solver
-
transSolve
public Matrix transSolve(Matrix B, Matrix X)
Description copied from interface:Matrix
X = AT\B
. Not all matrices support this operation, those that do not throwUnsupportedOperationException
. Note that it is often more efficient to use a matrix decomposition and its associated transpose solver- Specified by:
transSolve
in interfaceMatrix
- Parameters:
B
- Matrix with a number of rows equalA.numColumns()
, and the same number of columns asX
X
- Matrix with the same number of rows asA
, and the same number of columns asB
- Returns:
- X
-
checkSolve
protected void checkSolve(Matrix B, Matrix X)
Checks that a matrix inversion is legal for the given arguments. This is for the square case, not for least-squares problems
-
rank1
public Matrix rank1(Matrix C)
Description copied from interface:Matrix
A = C*CT + A
. The matrices must be square and of the same size
-
rank1
public Matrix rank1(double alpha, Matrix C)
Description copied from interface:Matrix
A = alpha*C*CT + A
. The matrices must be square and of the same size
-
checkRank1
protected void checkRank1(Matrix C)
Checks that a matrix rank1 update is possible for the given matrix
-
transRank1
public Matrix transRank1(Matrix C)
Description copied from interface:Matrix
A = CT*C + A
The matrices must be square and of the same size- Specified by:
transRank1
in interfaceMatrix
- Returns:
- A
-
transRank1
public Matrix transRank1(double alpha, Matrix C)
Description copied from interface:Matrix
A = alpha*CT*C + A
The matrices must be square and of the same size- Specified by:
transRank1
in interfaceMatrix
- Returns:
- A
-
checkTransRank1
protected void checkTransRank1(Matrix C)
Checks that a transposed rank1 update is leagal with the given argument
-
rank2
public Matrix rank2(Matrix B, Matrix C)
Description copied from interface:Matrix
A = B*CT + C*BT + A
. This matrix must be square
-
rank2
public Matrix rank2(double alpha, Matrix B, Matrix C)
Description copied from interface:Matrix
A = alpha*B*CT + alpha*C*BT + A
. This matrix must be square
-
checkRank2
protected void checkRank2(Matrix B, Matrix C)
Checks that a rank2 update is legal for the given arguments
-
transRank2
public Matrix transRank2(Matrix B, Matrix C)
Description copied from interface:Matrix
A = BT*C + CT*B + A
. This matrix must be square- Specified by:
transRank2
in interfaceMatrix
- Parameters:
B
- Matrix with the same number of rows asC
and the same number of columns asA
C
- Matrix with the same number of rows asB
and the same number of columns asA
- Returns:
- A
-
transRank2
public Matrix transRank2(double alpha, Matrix B, Matrix C)
Description copied from interface:Matrix
A = alpha*BT*C + alpha*CT*B + A
. This matrix must be square- Specified by:
transRank2
in interfaceMatrix
B
- Matrix with the same number of rows asC
and the same number of columns asA
C
- Matrix with the same number of rows asB
and the same number of columns asA
- Returns:
- A
-
checkTransRank2
protected void checkTransRank2(Matrix B, Matrix C)
Checks that a transposed rank2 update is leagal with the given arguments
-
set
public Matrix set(Matrix B)
Description copied from interface:Matrix
A=B
. The matrices must be of the same size
-
set
public Matrix set(double alpha, Matrix B)
Description copied from interface:Matrix
A=alpha*B
. The matrices must be of the same size
-
add
public Matrix add(Matrix B)
Description copied from interface:Matrix
A = B + A
. The matrices must be of the same size
-
add
public Matrix add(double alpha, Matrix B)
Description copied from interface:Matrix
A = alpha*B + A
. The matrices must be of the same size
-
checkSize
protected void checkSize(Matrix B)
Checks that the sizes of this matrix and the given conform
-
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.
-
checkTranspose
protected void checkTranspose()
Checks that the matrix may be transposed
-
transpose
public Matrix transpose(Matrix B)
Description copied from interface:Matrix
Sets the tranpose of this matrix intoB
. Matrix dimensions must be compatible
-
checkTranspose
protected void checkTranspose(Matrix B)
Checks that this matrix can be transposed into the given matrix
-
norm
public double norm(Matrix.Norm type)
Description copied from interface:Matrix
Computes the given norm of the matrix
-
norm1
protected double norm1()
Computes the 1 norm
-
normF
protected double normF()
Computes the Frobenius norm. This implementation is overflow resistant
-
normInf
protected double normInf()
Computes the infinity norm
-
max
protected double max()
Returns the largest absolute value
-
max
protected double max(double[] x)
Returns the largest element of the passed array
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
iterator
public java.util.Iterator<MatrixEntry> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<MatrixEntry>
-
-