- java.lang.Object
-
- org.ojalgo.matrix.decomposition.MinimumDegree
-
public final class MinimumDegree extends java.lang.ObjectApproximate 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.
- Assumes the input
-
-
Field Summary
Fields Modifier and Type Field Description private PivotmyPermutation
-
Constructor Summary
Constructors Constructor Description MinimumDegree()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapproximate(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.R064CSCpermute(R064CSC original, int[] recording)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[]reverseOrder()
-
-
-
Field Detail
-
myPermutation
private final Pivot myPermutation
-
-
Method Detail
-
approximate
public void approximate(R064CSC matrix)
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
public R064CSC permute(R064CSC original, int[] recording)
Permutes a symmetricR064CSCmatrix according to the computed ordering. The input is assumed to store only the upper/right triangle of the symmetric pattern.Does not modify the input matrix; it returns a new permuted matrix.
-
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()
-
-