mpv2
Class BlockMatrix

java.lang.Object
  extended by mpv2.AllMatrices
      extended by mpv2.BlockMatrix
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class BlockMatrix
extends AllMatrices
implements java.lang.Cloneable, java.io.Serializable

This is a block matrix consisting of four submatrices, Matlab-notation: [ A, B; C, D].

See Also:
Serialized Form

Field Summary
 
Fields inherited from class mpv2.AllMatrices
K, N
 
Constructor Summary
BlockMatrix(AllMatrices A, AllMatrices B, AllMatrices C, AllMatrices D)
          Construct a Block matrix with four submatrices, [A, B; C, D].
 
Method Summary
 double get(int n, int k)
          Get a single element.
 void getColumn(int k, double[] y)
          Copy a column of the matrix into argument y Legal range of the integer argument is 0 <= k < K.
 void getRow(int n, double[] x)
          Get a row of the matrix into argument x.
 void set(int n, int k, double s)
          Set a single element.
 
Methods inherited from class mpv2.AllMatrices
addColumn, chol, columnNorm0, columnNorm1, columnNorm2, columnNormInf, cond, det, eig, eqConstant, eqCopy, eqCopy, eqCopy, eqCopy, eqCopy, eqDifference, eqEProduct, eqEQuotient, eqIdentity, eqInverse, eqIProduct, eqNegate, eqOnes, eqPermuteColumns, eqPermuteRows, eqProduct, eqProduct, eqRandom, eqScaleColumns, eqScaleRows, eqSum, eqTProduct, eqTranspose, eqZeros, getAll, getAll, getColumn, getColumnDimension, getK, getN, getRow, getRowDimension, getSubMatrix, getSubMatrix, getSubMatrix, getSubMatrix, getValue, innerProduct, lu, lup, norm1, norm2, normF, normInf, pluseqOuterProduct, print, print, print, print, qr, rank, setAll, setColumn, setRow, setValue, sumAll, svd, times, times, times, times, trace, transposeTimes, transposeTimes, transposeTimes, transposeTimes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockMatrix

public BlockMatrix(AllMatrices A,
                   AllMatrices B,
                   AllMatrices C,
                   AllMatrices D)
Construct a Block matrix with four submatrices, [A, B; C, D]. The dimensions for the submatrices must agree. Note that some of the matrices may be null, legal use is like:
BlockMatrix(A,B,C,D); BlockMatrix(A,B,null,null); BlockMatrix(A,null,C,null); BlockMatrix(A,null,null,D); BlockMatrix(A,B,C,null);BlockMatrix(A,B,null,D);

Parameters:
A - A matrix of any kind, or null.
B - A matrix of any kind, or null.
C - A matrix of any kind, or null.
D - A matrix of any kind, or null.
Method Detail

get

public double get(int n,
                  int k)
Get a single element. The method is forwarded to getValue(...) in the correct submatrix.

Specified by:
get in class AllMatrices
Parameters:
n - Row index.
k - Column index.
Returns:
A(n,k)

set

public void set(int n,
                int k,
                double s)
Set a single element. The method is forwarded to setValue(...) in the correct submatrix.

Specified by:
set in class AllMatrices
Parameters:
n - Row index.
k - Column index.
s - A(n,k).

getColumn

public void getColumn(int k,
                      double[] y)
Copy a column of the matrix into argument y Legal range of the integer argument is 0 <= k < K. If argument is out of range a length N array of zeros should be returned.
The corresponding Matlab expression would be: A(:,k+1).

Overrides:
getColumn in class AllMatrices
Parameters:
k - number of the column in the matrix
y - the given column of the matrix

getRow

public void getRow(int n,
                   double[] x)
Get a row of the matrix into argument x. Legal range of the integer argument is 0 <= n < N.

Overrides:
getRow in class AllMatrices
Parameters:
n - number of the row in the matrix.
x - is set to the given row of matrix.
Throws:
java.lang.IllegalArgumentException