|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.matrix.DimensionCheck
public class DimensionCheck
This class collects the common functions for checking matrix dimensions.
| Method Summary | |
|---|---|
static boolean |
isColumnVector(MatrixDimension A)
Check if a matrix is a column vector. |
static boolean |
isFat(MatrixDimension A)
Check if a matrix is a fat matrix. |
static boolean |
isRowVector(MatrixDimension A)
Check if a matrix is a row vector. |
static boolean |
isSquare(MatrixDimension A)
Check if a matrix is a square matrix. |
static boolean |
isTall(MatrixDimension A)
Check if a matrix is a tall matrix. |
static boolean |
isVector(MatrixDimension A)
Check if a matrix is a row or a column vector. |
static boolean |
sameDimension(MatrixDimension A1,
MatrixDimension A2)
Check if two matrices are of the same dimension. |
static void |
throwIfDifferentDimension(MatrixDimension A1,
MatrixDimension A2)
Throws if A1.nrow ! |
static void |
throwIfIncompatible4Multiplication(MatrixDimension A1,
MatrixDimension A2)
Throws if A1.ncol ! |
static void |
throwIfIncompatible4Multiplication(MatrixDimension A,
Vector v)
Throws if A.ncol ! |
static void |
throwIfInvalidColumn(MatrixDimension A,
int col)
Throws if accessing an out of range column. |
static void |
throwIfInvalidRow(MatrixDimension A,
int row)
Throws if accessing an out of range row. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean isColumnVector(MatrixDimension A)
A - a matrix
true iff the matrix has only one columnpublic static boolean isRowVector(MatrixDimension A)
A - a matrix
true iff the matrix has only one rowpublic static boolean isVector(MatrixDimension A)
A - a matrix
true iff the matrix has only one row or one columnpublic static boolean isSquare(MatrixDimension A)
A - a matrix
true iff the matrix has as many rows as it has columnspublic static boolean isTall(MatrixDimension A)
A - a matrix
true iff the matrix has no fewer rows than it has columnspublic static boolean isFat(MatrixDimension A)
A - a matrix
true iff the matrix has no fewer columns than it has rows
public static boolean sameDimension(MatrixDimension A1,
MatrixDimension A2)
A1 - a matrixA2 - a matrix
true iff rows and columns, i.e. the dimensions of A1 and A2, are equal
public static void throwIfDifferentDimension(MatrixDimension A1,
MatrixDimension A2)
A1.nrow != A2.nrow
OR
A1.ncol != A2.ncol
A1 - a matrixA2 - a matrix
public static void throwIfIncompatible4Multiplication(MatrixDimension A1,
MatrixDimension A2)
A1.ncol != A2.nrow
A1 - a matrixA2 - a matrix
public static void throwIfIncompatible4Multiplication(MatrixDimension A,
Vector v)
A.ncol != v.size
A - a matrixv - a vector
public static void throwIfInvalidRow(MatrixDimension A,
int row)
A - a matrixrow - a row index
public static void throwIfInvalidColumn(MatrixDimension A,
int col)
A - a matrixcol - a column index
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||