public class CreateMatrix
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static DenseMatrix |
cbind(java.util.List<Vector> vectors)
Combine a list of vectors by columns.
|
static DenseMatrix |
cbind(Matrix... matrices)
Combine an array of matrices by columns.
|
static DenseMatrix |
cbind(Vector... vectors)
Combine an array of vectors by columns.
|
static DenseMatrix |
columns(Matrix A,
int[] cols)
Construct a sub-matrix from the columns of a matrix.
|
static DenseMatrix |
columns(Matrix A,
int begin,
int end)
Construct a sub-matrix from the columns of a matrix.
|
static Matrix |
copyAndReplace(Matrix original,
int rowFrom,
int rowTo,
int colFrom,
int colTo,
Matrix replacement)
Deprecated.
Not supported yet.
|
static DiagonalMatrix |
diagonalMatrix(Matrix A)
Get the diagonal of a matrix.
|
static DenseMatrix |
rbind(java.util.List<Vector> vectors)
Combine a list of array of vectors by rows.
|
static DenseMatrix |
rbind(Matrix... matrices)
Combine an array of matrices by rows.
|
static DenseMatrix |
rbind(Vector... vectors)
Combine an array of vectors by rows.
|
static Matrix |
replace(Matrix original,
int rowFrom,
int rowTo,
int colFrom,
int colTo,
Matrix replacement)
Replace a sub-matrix of a matrix with a smaller matrix.
|
static DenseMatrix |
rows(Matrix A,
int[] rows)
Construct a sub-matrix from the rows of a matrix.
|
static DenseMatrix |
rows(Matrix A,
int begin,
int end)
Construct a sub-matrix from the rows of a matrix.
|
static DenseMatrix |
subMatrix(Matrix A,
int[] rows,
int[] cols)
Construct a sub-matrix from the intersections of rows and columns of a matrix.
|
static DenseMatrix |
subMatrix(Matrix A,
int rowFrom,
int rowTo,
int colFrom,
int colTo)
Construct a sub-matrix from the four corners of a matrix.
|
public static DenseMatrix cbind(Vector... vectors)
vectors - an array of vectors, e.g., v1, v2, v3, ...public static DenseMatrix cbind(java.util.List<Vector> vectors)
vectors - a list of vectors, e.g., v1, v2, v3, ...public static DenseMatrix cbind(Matrix... matrices)
matrices - an array of matrices, e.g., A1, A2, A3, ...public static DenseMatrix rbind(Vector... vectors)
vectors - an array of vector, e.g., v1, v2, v3, ...java.lang.IllegalArgumentException - if the vectors form a jagged arraypublic static DenseMatrix rbind(java.util.List<Vector> vectors)
vectors - a list of vector, e.g., v1, v2, v3, ...java.lang.IllegalArgumentException - if the vectors form a jagged arraypublic static DenseMatrix rbind(Matrix... matrices)
matrices - an array of matrices, e.g., A1, A2, A3, ...public static DenseMatrix subMatrix(Matrix A, int rowFrom, int rowTo, int colFrom, int colTo)
A - a matrixrowFrom - the beginning row indexrowTo - the ending row indexcolFrom - the beginning column indexcolTo - the ending column indexpublic static DenseMatrix subMatrix(Matrix A, int[] rows, int[] cols)
A - a matrixrows - the rows to be extractedcols - the columns to be extractedpublic static DenseMatrix rows(Matrix A, int[] rows)
A - a matrixrows - the rows to be extractedpublic static DenseMatrix rows(Matrix A, int begin, int end)
A - a matrixbegin - the beginning row index (counting from 1)end - the ending row index (counting from 1)public static DenseMatrix columns(Matrix A, int[] cols)
A - a matrixcols - the columns to be extractedpublic static DenseMatrix columns(Matrix A, int begin, int end)
A - a matrixbegin - the beginning column index (counting from 1)end - the ending column index (counting from 1)public static Matrix replace(Matrix original, int rowFrom, int rowTo, int colFrom, int colTo, Matrix replacement)
SymmetricMatrix
because this method does not ensure the symmetry property after replacement.
Note that The original matrix is modified afterward (for performance reason in case of a big matrix).
No new Matrix instance is constructed.
original - the matrix whose entries are to be replacedrowFrom - the beginning row indexrowTo - the ending row indexcolFrom - the beginning column indexcolTo - the ending column indexreplacement - the matrix to be inserted into the original matrix@Deprecated public static Matrix copyAndReplace(Matrix original, int rowFrom, int rowTo, int colFrom, int colTo, Matrix replacement)
SymmetricMatrix
because this method does not ensure the symmetry property after replacement.original - the matrix whose entries are to be replacedrowFrom - the beginning row indexrowTo - the ending row indexcolFrom - the beginning column indexcolTo - the ending column indexreplacement - the matrix to be inserted into the original matrixpublic static DiagonalMatrix diagonalMatrix(Matrix A)
A - a matrixjava.lang.IllegalArgumentException - if A is not square