Parallel Colt 0.9.4

cern.colt.matrix.tfloat.algo
Class SparseFloatAlgebra

java.lang.Object
  extended by cern.colt.matrix.tfloat.algo.SparseFloatAlgebra

public class SparseFloatAlgebra
extends Object

Linear algebraic matrix operations operating on sparse matrices.

Author:
Piotr Wendykier (piotr.wendykier@gmail.com)

Field Summary
static SparseFloatAlgebra DEFAULT
          A default Algebra object; has FloatProperty.DEFAULT attached for tolerance.
static SparseFloatAlgebra ZERO
          A default Algebra object; has FloatProperty.ZERO attached for tolerance.
 
Constructor Summary
SparseFloatAlgebra()
          Constructs a new instance with an equality tolerance given by Property.DEFAULT.tolerance().
SparseFloatAlgebra(float tolerance)
          Constructs a new instance with the given equality tolerance.
 
Method Summary
 SparseFloatCholeskyDecomposition chol(FloatMatrix2D matrix, int order)
          Constructs and returns the Cholesky-decomposition of the given matrix.
 Object clone()
          Returns a copy of the receiver.
 float det(FloatMatrix2D A)
          Returns the determinant of matrix A.
 SparseFloatLUDecomposition lu(FloatMatrix2D matrix, int order)
          Constructs and returns the LU-decomposition of the given matrix.
 float norm1(FloatMatrix2D A)
          Returns the 1-norm of matrix A, which is the maximum absolute column sum.
 float normInfinity(FloatMatrix2D A)
          Returns the infinity norm of matrix A, which is the maximum absolute row sum.
 FloatProperty property()
          Returns the property object attached to this Algebra, defining tolerance.
 SparseFloatQRDecomposition qr(FloatMatrix2D matrix, int order)
          Constructs and returns the QR-decomposition of the given matrix.
 void setProperty(FloatProperty property)
          Attaches the given property object to this Algebra, defining tolerance.
 FloatMatrix1D solve(FloatMatrix2D A, FloatMatrix1D b)
          Solves A*x = b.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final SparseFloatAlgebra DEFAULT
A default Algebra object; has FloatProperty.DEFAULT attached for tolerance. Allows ommiting to construct an Algebra object time and again. Note that this Algebra object is immutable. Any attempt to assign a new Property object to it (via method setProperty), or to alter the tolerance of its property object (via property().setTolerance(...)) will throw an exception.


ZERO

public static final SparseFloatAlgebra ZERO
A default Algebra object; has FloatProperty.ZERO attached for tolerance. Allows ommiting to construct an Algebra object time and again. Note that this Algebra object is immutable. Any attempt to assign a new Property object to it (via method setProperty), or to alter the tolerance of its property object (via property().setTolerance(...)) will throw an exception.

Constructor Detail

SparseFloatAlgebra

public SparseFloatAlgebra()
Constructs a new instance with an equality tolerance given by Property.DEFAULT.tolerance().


SparseFloatAlgebra

public SparseFloatAlgebra(float tolerance)
Constructs a new instance with the given equality tolerance.

Parameters:
tolerance - the tolerance to be used for equality operations.
Method Detail

chol

public SparseFloatCholeskyDecomposition chol(FloatMatrix2D matrix,
                                             int order)
Constructs and returns the Cholesky-decomposition of the given matrix.

Parameters:
matrix - sparse matrix
order - ordering option (0 or 1); 0: natural ordering, 1: amd(A+A')
Returns:
Cholesky-decomposition of the given matrix

clone

public Object clone()
Returns a copy of the receiver. The attached property object is also copied. Hence, the property object of the copy is mutable.

Overrides:
clone in class Object
Returns:
a copy of the receiver.

det

public float det(FloatMatrix2D A)
Returns the determinant of matrix A.

Parameters:
A - sparse matrix
Returns:
the determinant of matrix A

lu

public SparseFloatLUDecomposition lu(FloatMatrix2D matrix,
                                     int order)
Constructs and returns the LU-decomposition of the given matrix.

Parameters:
matrix - sparse matrix
order - ordering option (0 to 3); 0: natural ordering, 1: amd(A+A'), 2: amd(S'*S), 3: amd(A'*A)
Returns:
the LU-decomposition of the given matrix

norm1

public float norm1(FloatMatrix2D A)
Returns the 1-norm of matrix A, which is the maximum absolute column sum.


normInfinity

public float normInfinity(FloatMatrix2D A)
Returns the infinity norm of matrix A, which is the maximum absolute row sum.


property

public FloatProperty property()
Returns the property object attached to this Algebra, defining tolerance.

Returns:
the Property object.
See Also:
setProperty(FloatProperty)

qr

public SparseFloatQRDecomposition qr(FloatMatrix2D matrix,
                                     int order)
Constructs and returns the QR-decomposition of the given matrix.

Parameters:
matrix - sparse matrix
order - ordering option (0 to 3); 0: natural ordering, 1: amd(A+A'), 2: amd(S'*S), 3: amd(A'*A)
Returns:
the QR-decomposition of the given matrix

setProperty

public void setProperty(FloatProperty property)
Attaches the given property object to this Algebra, defining tolerance.

Parameters:
property - the Property object to be attached.
Throws:
UnsupportedOperationException - if this==DEFAULT && property!=this.property() - The DEFAULT Algebra object is immutable.
UnsupportedOperationException - if this==ZERO && property!=this.property() - The ZERO Algebra object is immutable.
See Also:
property

solve

public FloatMatrix1D solve(FloatMatrix2D A,
                           FloatMatrix1D b)
Solves A*x = b.

Parameters:
A - sparse matrix
b - right hand side
Returns:
x; a new independent matrix; solution if A is square, least squares solution if A.rows() > A.columns(), underdetermined system solution if A.rows() < A.columns().

Parallel Colt 0.9.4

Jump to the Parallel Colt Homepage