public class Matrices extends Object
Matrices class contains static utility methods
for various matrix properties and operations.| Modifier and Type | Method and Description |
|---|---|
static boolean |
hasZeroDiagonal(Matrix m)
Returns
true if the specified matrix has
only zero values on its diagonal. |
static boolean |
isNonNegative(Matrix m)
Returns
true if the matrix contains only positive
numbers or zeros. |
static boolean |
isSymmetric(Matrix m)
Returns
true if the specified matrix is symmetric. |
static double[] |
toArray(Vector v)
Returns the content of the specified vector as an array.
|
static Vector |
unmodifiableVector(Vector v)
Returns an unmodifiable view of the specified vector.
|
public static Vector unmodifiableVector(Vector v)
UnsupportedOperationException
if Vector.setValue(int,double) is called.v - Vector to return anpublic static boolean hasZeroDiagonal(Matrix m)
true if the specified matrix has
only zero values on its diagonal. If the matrix is
not square or has non-zero values on the diagonal, the
return result is false.m - Matrix to test.true if the matrix is square and has
only zero values on its diagonal.public static boolean isSymmetric(Matrix m)
true if the specified matrix is symmetric.
A matrix m is symmetric if it's equal to its
transpose, m = mT. Stated
directly, a matrix m is symmetric if it has the
same number of rows as columns:
m.numRows() == m.numColumns()
and meets the symmetry condition:
m.value(i,j) == m.value(j,i)fori,j < m.numRows().
m - Matrix to test.true if the matrix is symmetric.public static boolean isNonNegative(Matrix m)
true if the matrix contains only positive
numbers or zeros. If it contains a finite negative number,
Double.NaN, or Double.NEGATIVE_INFINITY, the
result will be false.m - Matrix to test.true if the matrix contains only positive
entries or zeros.public static double[] toArray(Vector v)
v - The vector.Copyright © 2019 Alias-i, Inc.. All rights reserved.