Class MinimumDegree
java.lang.Object
org.ojalgo.matrix.decomposition.MinimumDegree
Approximate Minimum Degree (AMD) style ordering for pre-ordering a symmetric sparse matrix prior to
numerical factorisation (Cholesky or LDL). This is NOT the full/correct AMD-algorithm as described by
Amestoy, Davis, and Duff, but rather something simpler that aims to accomplish similar results. It is
clearly not as fast as a highly tuned proper AMD implementation, but compared to not doing any ordering at
all it is found to provide up to 90% of the potential speedup in overall use cases.
This implementation:
- Assumes the input
R064CSCrepresents a symmetric pattern with only the upper triangle stored. - Treats the matrix as an adjacency graph and computes a fill-reducing column ordering.
- Does not modify the input matrix; it only returns a permutation vector.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapproximate(R064CSC matrix) Approximates a minimum degree ordering for a symmetricR064CSCmatrix.(package private) int[]getOrder()voidpermute(double[] destination, double[] source) Permutes a vector according to the computed ordering.Permutes a symmetricR064CSCmatrix according to the computed ordering.voidreverse(double[] destination, double[] source) The inverse permutation of a vector according to the computed ordering.(package private) int[]
-
Field Details
-
myPermutation
-
-
Constructor Details
-
MinimumDegree
public MinimumDegree()
-
-
Method Details
-
approximate
Approximates a minimum degree ordering for a symmetricR064CSCmatrix. The result is stored internally. To permute vectors or matrices according to the computed ordering, use thepermute(double[], double[])orpermute(R064CSC, int[])} methods.The input is assumed to store only the upper/right triangle of the symmetric pattern; lower-triangular entries (if present) are ignored.
-
permute
public void permute(double[] destination, double[] source) Permutes a vector according to the computed ordering. Copies from source to destination, reordering as it goes. -
permute
-
reverse
public void reverse(double[] destination, double[] source) The inverse permutation of a vector according to the computed ordering. Copies from source to destination, reordering as it goes. -
getOrder
int[] getOrder() -
reverseOrder
int[] reverseOrder()
-