org.apache.mahout.math.matrix.linalg
Class Property

java.lang.Object
  extended by org.apache.mahout.math.matrix.linalg.Property

Deprecated. until unit tests are in place. Until this time, this class/interface is unsupported.

@Deprecated
public final class Property
extends Object


Field Summary
static Property DEFAULT
          Deprecated. The default Property object; currently has tolerance()==1.0E-9.
static Property ZERO
          Deprecated. A Property object with tolerance()==0.0.
 
Constructor Summary
Property(double newTolerance)
          Deprecated. Constructs an instance with a tolerance of Math.abs(newTolerance).
 
Method Summary
static void checkRectangular(AbstractMatrix2D a)
          Deprecated. Checks whether the given matrix A is rectangular.
static void checkSquare(AbstractMatrix2D a)
          Deprecated. Checks whether the given matrix A is square.
static void checkSquare(Matrix matrix)
          Deprecated.  
static double density(DoubleMatrix2D a)
          Deprecated. Returns the matrix's fraction of non-zero cells; A.cardinality() / A.size().
 boolean equals(DoubleMatrix1D a, double value)
          Deprecated. Returns whether all cells of the given matrix A are equal to the given value.
 boolean equals(DoubleMatrix1D a, DoubleMatrix1D b)
          Deprecated. Returns whether both given matrices A and B are equal.
 boolean equals(DoubleMatrix2D a, double value)
          Deprecated. Returns whether all cells of the given matrix A are equal to the given value.
 boolean equals(DoubleMatrix2D a, DoubleMatrix2D b)
          Deprecated. Returns whether both given matrices A and B are equal.
 boolean isDiagonal(DoubleMatrix2D a)
          Deprecated. A matrix A is diagonal if A[i,j] == 0 whenever i != j.
static boolean isDiagonallyDominantByColumn(DoubleMatrix2D a)
          Deprecated. A matrix A is diagonally dominant by column if the absolute value of each diagonal element is larger than the sum of the absolute values of the off-diagonal elements in the corresponding column.
static boolean isDiagonallyDominantByRow(DoubleMatrix2D a)
          Deprecated. A matrix A is diagonally dominant by row if the absolute value of each diagonal element is larger than the sum of the absolute values of the off-diagonal elements in the corresponding row.
 boolean isIdentity(DoubleMatrix2D a)
          Deprecated. A matrix A is an identity matrix if A[i,i] == 1 and all other cells are zero.
 boolean isLowerBidiagonal(DoubleMatrix2D a)
          Deprecated. A matrix A is lower bidiagonal if A[i,j]==0 unless i==j || i==j+1.
 boolean isLowerTriangular(DoubleMatrix2D a)
          Deprecated. A matrix A is lower triangular if A[i,j]==0 whenever i < j.
static boolean isNonNegative(DoubleMatrix2D a)
          Deprecated. A matrix A is non-negative if A[i,j] >= 0 holds for all cells.
 boolean isOrthogonal(DoubleMatrix2D a)
          Deprecated. A square matrix A is orthogonal if A*transpose(A) = I.
static boolean isPositive(DoubleMatrix2D a)
          Deprecated. A matrix A is positive if A[i,j] > 0 holds for all cells.
 boolean isSkewSymmetric(DoubleMatrix2D a)
          Deprecated. A square matrix A is skew-symmetric if A = -transpose(A), that is A[i,j] == -A[j,i].
static boolean isSquare(AbstractMatrix2D a)
          Deprecated. A matrix A is square if it has the same number of rows and columns.
 boolean isStrictlyLowerTriangular(DoubleMatrix2D a)
          Deprecated. A matrix A is strictly lower triangular if A[i,j]==0 whenever i <= j.
 boolean isStrictlyTriangular(DoubleMatrix2D a)
          Deprecated. A matrix A is strictly triangular if it is triangular and its diagonal elements all equal 0.
 boolean isStrictlyUpperTriangular(DoubleMatrix2D a)
          Deprecated. A matrix A is strictly upper triangular if A[i,j]==0 whenever i >= j.
 boolean isSymmetric(DoubleMatrix2D a)
          Deprecated. A matrix A is symmetric if A = tranpose(A), that is A[i,j] == A[j,i].
 boolean isTriangular(DoubleMatrix2D a)
          Deprecated. A matrix A is triangular iff it is either upper or lower triangular.
 boolean isTridiagonal(DoubleMatrix2D a)
          Deprecated. A matrix A is tridiagonal if A[i,j]==0 whenever Math.abs(i-j) > 1.
 boolean isUnitTriangular(DoubleMatrix2D a)
          Deprecated. A matrix A is unit triangular if it is triangular and its diagonal elements all equal 1.
 boolean isUpperBidiagonal(DoubleMatrix2D a)
          Deprecated. A matrix A is upper bidiagonal if A[i,j]==0 unless i==j || i==j-1.
 boolean isUpperTriangular(DoubleMatrix2D a)
          Deprecated. A matrix A is upper triangular if A[i,j]==0 whenever i > j.
 boolean isZero(DoubleMatrix2D a)
          Deprecated. A matrix A is zero if all its cells are zero.
 int lowerBandwidth(DoubleMatrix2D a)
          Deprecated. The lower bandwidth of a square matrix A is the maximum i-j for which A[i,j] is nonzero and i > j.
 int semiBandwidth(DoubleMatrix2D a)
          Deprecated. Returns the semi-bandwidth of the given square matrix A.
 double tolerance()
          Deprecated. Returns the current tolerance.
 int upperBandwidth(DoubleMatrix2D a)
          Deprecated. The upper bandwidth of a square matrix A is the maximum j-i for which A[i,j] is nonzero and j > i.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final Property DEFAULT
Deprecated. 
The default Property object; currently has tolerance()==1.0E-9.


ZERO

public static final Property ZERO
Deprecated. 
A Property object with tolerance()==0.0.

Constructor Detail

Property

public Property(double newTolerance)
Deprecated. 
Constructs an instance with a tolerance of Math.abs(newTolerance).

Method Detail

checkRectangular

public static void checkRectangular(AbstractMatrix2D a)
Deprecated. 
Checks whether the given matrix A is rectangular.

Throws:
IllegalArgumentException - if A.rows() < A.columns().

checkSquare

public static void checkSquare(AbstractMatrix2D a)
Deprecated. 
Checks whether the given matrix A is square.

Throws:
IllegalArgumentException - if A.rows() != A.columns().

checkSquare

public static void checkSquare(Matrix matrix)
Deprecated. 

density

public static double density(DoubleMatrix2D a)
Deprecated. 
Returns the matrix's fraction of non-zero cells; A.cardinality() / A.size().


equals

public boolean equals(DoubleMatrix1D a,
                      double value)
Deprecated. 
Returns whether all cells of the given matrix A are equal to the given value. The result is true if and only if A != null and ! (Math.abs(value - A[i]) > tolerance()) holds for all coordinates.

Parameters:
a - the first matrix to compare.
value - the value to compare against.
Returns:
true if the matrix is equal to the value; false otherwise.

equals

public boolean equals(DoubleMatrix1D a,
                      DoubleMatrix1D b)
Deprecated. 
Returns whether both given matrices A and B are equal. The result is true if A==B. Otherwise, the result is true if and only if both arguments are != null, have the same size and ! (Math.abs(A[i] - B[i]) > tolerance()) holds for all indexes.

Parameters:
a - the first matrix to compare.
b - the second matrix to compare.
Returns:
true if both matrices are equal; false otherwise.

equals

public boolean equals(DoubleMatrix2D a,
                      double value)
Deprecated. 
Returns whether all cells of the given matrix A are equal to the given value. The result is true if and only if A != null and ! (Math.abs(value - A[row,col]) > tolerance()) holds for all coordinates.

Parameters:
a - the first matrix to compare.
value - the value to compare against.
Returns:
true if the matrix is equal to the value; false otherwise.

equals

public boolean equals(DoubleMatrix2D a,
                      DoubleMatrix2D b)
Deprecated. 
Returns whether both given matrices A and B are equal. The result is true if A==B. Otherwise, the result is true if and only if both arguments are != null, have the same number of columns and rows and ! (Math.abs(A[row,col] - B[row,col]) > tolerance()) holds for all coordinates.

Parameters:
a - the first matrix to compare.
b - the second matrix to compare.
Returns:
true if both matrices are equal; false otherwise.

isDiagonal

public boolean isDiagonal(DoubleMatrix2D a)
Deprecated. 
A matrix A is diagonal if A[i,j] == 0 whenever i != j. Matrix may but need not be square.


isDiagonallyDominantByColumn

public static boolean isDiagonallyDominantByColumn(DoubleMatrix2D a)
Deprecated. 
A matrix A is diagonally dominant by column if the absolute value of each diagonal element is larger than the sum of the absolute values of the off-diagonal elements in the corresponding column. returns true if for all i: abs(A[i,i]) > Sum(abs(A[j,i])); j != i. Matrix may but need not be square.

Note: Ignores tolerance.


isDiagonallyDominantByRow

public static boolean isDiagonallyDominantByRow(DoubleMatrix2D a)
Deprecated. 
A matrix A is diagonally dominant by row if the absolute value of each diagonal element is larger than the sum of the absolute values of the off-diagonal elements in the corresponding row. returns true if for all i: abs(A[i,i]) > Sum(abs(A[i,j])); j != i. Matrix may but need not be square.

Note: Ignores tolerance.


isIdentity

public boolean isIdentity(DoubleMatrix2D a)
Deprecated. 
A matrix A is an identity matrix if A[i,i] == 1 and all other cells are zero. Matrix may but need not be square.


isLowerBidiagonal

public boolean isLowerBidiagonal(DoubleMatrix2D a)
Deprecated. 
A matrix A is lower bidiagonal if A[i,j]==0 unless i==j || i==j+1. Matrix may but need not be square.


isLowerTriangular

public boolean isLowerTriangular(DoubleMatrix2D a)
Deprecated. 
A matrix A is lower triangular if A[i,j]==0 whenever i < j. Matrix may but need not be square.


isNonNegative

public static boolean isNonNegative(DoubleMatrix2D a)
Deprecated. 
A matrix A is non-negative if A[i,j] >= 0 holds for all cells.

Note: Ignores tolerance.


isOrthogonal

public boolean isOrthogonal(DoubleMatrix2D a)
Deprecated. 
A square matrix A is orthogonal if A*transpose(A) = I.

Throws:
IllegalArgumentException - if !isSquare(A).

isPositive

public static boolean isPositive(DoubleMatrix2D a)
Deprecated. 
A matrix A is positive if A[i,j] > 0 holds for all cells.

Note: Ignores tolerance.


isSkewSymmetric

public boolean isSkewSymmetric(DoubleMatrix2D a)
Deprecated. 
A square matrix A is skew-symmetric if A = -transpose(A), that is A[i,j] == -A[j,i].

Throws:
IllegalArgumentException - if !isSquare(A).

isSquare

public static boolean isSquare(AbstractMatrix2D a)
Deprecated. 
A matrix A is square if it has the same number of rows and columns.


isStrictlyLowerTriangular

public boolean isStrictlyLowerTriangular(DoubleMatrix2D a)
Deprecated. 
A matrix A is strictly lower triangular if A[i,j]==0 whenever i <= j. Matrix may but need not be square.


isStrictlyTriangular

public boolean isStrictlyTriangular(DoubleMatrix2D a)
Deprecated. 
A matrix A is strictly triangular if it is triangular and its diagonal elements all equal 0. Matrix may but need not be square.


isStrictlyUpperTriangular

public boolean isStrictlyUpperTriangular(DoubleMatrix2D a)
Deprecated. 
A matrix A is strictly upper triangular if A[i,j]==0 whenever i >= j. Matrix may but need not be square.


isSymmetric

public boolean isSymmetric(DoubleMatrix2D a)
Deprecated. 
A matrix A is symmetric if A = tranpose(A), that is A[i,j] == A[j,i].

Throws:
IllegalArgumentException - if !isSquare(A).

isTriangular

public boolean isTriangular(DoubleMatrix2D a)
Deprecated. 
A matrix A is triangular iff it is either upper or lower triangular. Matrix may but need not be square.


isTridiagonal

public boolean isTridiagonal(DoubleMatrix2D a)
Deprecated. 
A matrix A is tridiagonal if A[i,j]==0 whenever Math.abs(i-j) > 1. Matrix may but need not be square.


isUnitTriangular

public boolean isUnitTriangular(DoubleMatrix2D a)
Deprecated. 
A matrix A is unit triangular if it is triangular and its diagonal elements all equal 1. Matrix may but need not be square.


isUpperBidiagonal

public boolean isUpperBidiagonal(DoubleMatrix2D a)
Deprecated. 
A matrix A is upper bidiagonal if A[i,j]==0 unless i==j || i==j-1. Matrix may but need not be square.


isUpperTriangular

public boolean isUpperTriangular(DoubleMatrix2D a)
Deprecated. 
A matrix A is upper triangular if A[i,j]==0 whenever i > j. Matrix may but need not be square.


isZero

public boolean isZero(DoubleMatrix2D a)
Deprecated. 
A matrix A is zero if all its cells are zero.


lowerBandwidth

public int lowerBandwidth(DoubleMatrix2D a)
Deprecated. 
The lower bandwidth of a square matrix A is the maximum i-j for which A[i,j] is nonzero and i > j. A banded matrix has a "band" about the diagonal. Diagonal, tridiagonal and triangular matrices are special cases.

Parameters:
a - the square matrix to analyze.
Returns:
the lower bandwith.
Throws:
IllegalArgumentException - if !isSquare(A).
See Also:
semiBandwidth(DoubleMatrix2D), upperBandwidth(DoubleMatrix2D)

semiBandwidth

public int semiBandwidth(DoubleMatrix2D a)
Deprecated. 
Returns the semi-bandwidth of the given square matrix A. A banded matrix has a "band" about the diagonal. It is a matrix with all cells equal to zero, with the possible exception of the cells along the diagonal line, the k diagonal lines above the diagonal, and the k diagonal lines below the diagonal. The semi-bandwith l is the number k+1. The bandwidth p is the number 2*k + 1. For example, a tridiagonal matrix corresponds to k=1, l=2, p=3, a diagonal or zero matrix corresponds to k=0, l=1, p=1,

The upper bandwidth is the maximum j-i for which A[i,j] is nonzero and j > i. The lower bandwidth is the maximum i-j for which A[i,j] is nonzero and i > j. Diagonal, tridiagonal and triangular matrices are special cases.

Examples:

matrix 4 x 4 
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
4 x 4
1 0 0 0
0 0 0 0
0 0 0 0
0 0 0 1
4 x 4
1 1 0 0
1 1 1 0
0 1 1 1
0 0 1 1
4 x 4
0 1 1 1
0 1 1 1
0 0 0 1
0 0 0 1
4 x 4
0 0 0 0
1 1 0 0
1 1 0 0
1 1 1 1
4 x 4
1 1 0 0
0 1 1 0
0 1 0 1
1 0 1 1
4 x 4
1 1 1 0
0 1 0 0
1 1 0 1
0 0 1 1
upperBandwidth
0
0
1
3 0
1
2
lowerBandwidth
0
0
1
0 3
3
2
semiBandwidth
1
1
2
4 4
4
3
description
zero
diagonal
tridiagonal
upper triangular lower triangular
unstructured
unstructured

Parameters:
a - the square matrix to analyze.
Returns:
the semi-bandwith l.
Throws:
IllegalArgumentException - if !isSquare(A).
See Also:
lowerBandwidth(DoubleMatrix2D), upperBandwidth(DoubleMatrix2D)

tolerance

public double tolerance()
Deprecated. 
Returns the current tolerance.


upperBandwidth

public int upperBandwidth(DoubleMatrix2D a)
Deprecated. 
The upper bandwidth of a square matrix A is the maximum j-i for which A[i,j] is nonzero and j > i. A banded matrix has a "band" about the diagonal. Diagonal, tridiagonal and triangular matrices are special cases.

Parameters:
a - the square matrix to analyze.
Returns:
the upper bandwith.
Throws:
IllegalArgumentException - if !isSquare(A).
See Also:
semiBandwidth(DoubleMatrix2D), lowerBandwidth(DoubleMatrix2D)


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.