cern.colt.matrix.tdouble.algo
Class SparseDoubleAlgebra
- java.lang.Object
-
- cern.colt.matrix.tdouble.algo.SparseDoubleAlgebra
-
public class SparseDoubleAlgebra extends java.lang.ObjectLinear algebraic matrix operations operating on sparse matrices.
-
-
Field Summary
Fields Modifier and Type Field and Description static SparseDoubleAlgebraDEFAULTA default Algebra object; hasDoubleProperty.DEFAULTattached for tolerance.static SparseDoubleAlgebraZEROA default Algebra object; hasDoubleProperty.ZEROattached for tolerance.
-
Constructor Summary
Constructors Constructor and Description SparseDoubleAlgebra()Constructs a new instance with an equality tolerance given by Property.DEFAULT.tolerance().SparseDoubleAlgebra(double tolerance)Constructs a new instance with the given equality tolerance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description SparseDoubleCholeskyDecompositionchol(DoubleMatrix2D matrix, int order)Constructs and returns the Cholesky-decomposition of the given matrix.java.lang.Objectclone()Returns a copy of the receiver.doubledet(DoubleMatrix2D A)Returns the determinant of matrix A.SparseDoubleLUDecompositionlu(DoubleMatrix2D matrix, int order)Constructs and returns the LU-decomposition of the given matrix.doublenorm1(DoubleMatrix2D A)Returns the 1-norm of matrix A, which is the maximum absolute column sum.doublenormInfinity(DoubleMatrix2D A)Returns the infinity norm of matrix A, which is the maximum absolute row sum.DoublePropertyproperty()Returns the property object attached to this Algebra, defining tolerance.SparseDoubleQRDecompositionqr(DoubleMatrix2D matrix, int order)Constructs and returns the QR-decomposition of the given matrix.voidsetProperty(DoubleProperty property)Attaches the given property object to this Algebra, defining tolerance.DoubleMatrix1Dsolve(DoubleMatrix2D A, DoubleMatrix1D b)Solves A*x = b.
-
-
-
Field Detail
-
DEFAULT
public static final SparseDoubleAlgebra DEFAULT
A default Algebra object; hasDoubleProperty.DEFAULTattached 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 SparseDoubleAlgebra ZERO
A default Algebra object; hasDoubleProperty.ZEROattached 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
-
SparseDoubleAlgebra
public SparseDoubleAlgebra()
Constructs a new instance with an equality tolerance given by Property.DEFAULT.tolerance().
-
SparseDoubleAlgebra
public SparseDoubleAlgebra(double tolerance)
Constructs a new instance with the given equality tolerance.- Parameters:
tolerance- the tolerance to be used for equality operations.
-
-
Method Detail
-
chol
public SparseDoubleCholeskyDecomposition chol(DoubleMatrix2D matrix, int order)
Constructs and returns the Cholesky-decomposition of the given matrix.- Parameters:
matrix- sparse matrixorder- ordering option (0 or 1); 0: natural ordering, 1: amd(A+A')- Returns:
- Cholesky-decomposition of the given matrix
-
clone
public java.lang.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:
clonein classjava.lang.Object- Returns:
- a copy of the receiver.
-
det
public double det(DoubleMatrix2D A)
Returns the determinant of matrix A.- Parameters:
A- sparse matrix- Returns:
- the determinant of matrix A
-
lu
public SparseDoubleLUDecomposition lu(DoubleMatrix2D matrix, int order)
Constructs and returns the LU-decomposition of the given matrix.- Parameters:
matrix- sparse matrixorder- 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 double norm1(DoubleMatrix2D A)
Returns the 1-norm of matrix A, which is the maximum absolute column sum.
-
normInfinity
public double normInfinity(DoubleMatrix2D A)
Returns the infinity norm of matrix A, which is the maximum absolute row sum.
-
property
public DoubleProperty property()
Returns the property object attached to this Algebra, defining tolerance.- Returns:
- the Property object.
- See Also:
setProperty(DoubleProperty)
-
qr
public SparseDoubleQRDecomposition qr(DoubleMatrix2D matrix, int order)
Constructs and returns the QR-decomposition of the given matrix.- Parameters:
matrix- sparse matrixorder- 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(DoubleProperty property)
Attaches the given property object to this Algebra, defining tolerance.- Parameters:
property- the Property object to be attached.- Throws:
java.lang.UnsupportedOperationException- if this==DEFAULT && property!=this.property() - The DEFAULT Algebra object is immutable.java.lang.UnsupportedOperationException- if this==ZERO && property!=this.property() - The ZERO Algebra object is immutable.- See Also:
property
-
solve
public DoubleMatrix1D solve(DoubleMatrix2D A, DoubleMatrix1D b)
Solves A*x = b.- Parameters:
A- sparse matrixb- 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().
-
-
DMelt 3.0 © DataMelt by jWork.ORG