Skip to content

MGroup.LinearAlgebra.Reordering

Dimitris Tsapetis edited this page Apr 17, 2019 · 1 revision

IReorderingAlgorithm

Calculates fill-reducting permutations for the rows/columns of a symmetric sparse matrix. Authors: Serafeim Bakalakos

public interface MGroup.LinearAlgebra.Reordering.IReorderingAlgorithm

Methods

Type Name Summary
ValueTuple<Int32[], Boolean> FindPermutation(SparsityPatternSymmetric pattern) Finds a fill-reducting permutation for the rows/columns of a symmetric sparse matrix, described by its sparsity pattern. The returned permutation can be new-to-old or old-to-new.

ISparsityPattern

Describes the indices of the non-zero entries of a sparse matrix, without taking into account their values. Authors: Serafeim Bakalakos

public interface MGroup.LinearAlgebra.Reordering.ISparsityPattern

Properties

Type Name Summary
Int32 NumColumns The number of columns of the matrix.
Int32 NumRows The number of rows of the matrix.

Methods

Type Name Summary
Int32 CountNonZeros() Counts how many non zero entries are stored in the matrix. This includes zeros that are explicitly stored.
IEnumerable<ValueTuple<Int32, Int32>> EnumerateNonZeros() Iterates over the non zero entries of the matrix. This includes zeros that are explicitly stored.
Boolean IsNonZero(Int32 rowIdx, Int32 colIdx) Returns true if the matrix entry at (, ) is non-zero or it is equal to 0, but explicitly stored (a.k.a. non-structural zero). Otherwise returns false.

ISparsityPatternSymmetric

Describes the indices of the non-zero entries of a symmetric sparse matrix, without taking into account their values. Authors: Serafeim Bakalakos

public interface MGroup.LinearAlgebra.Reordering.ISparsityPatternSymmetric
    : ISparsityPattern

Methods

Type Name Summary
Int32 CountNonZerosUpper() Counts how many non zero entries are stored in the upper triangle of the matrix, including the diagonal. This includes zeros that are explicitly stored.
IEnumerable<ValueTuple<Int32, Int32>> EnumerateNonZerosUpper() Iterates over the non zero entries of the upper part of the matrix, including the diagonal. This includes zeros that are explicitly stored.

OrderingAmdCSparseNet

Calculates a fill-reducing permutation for the rows/columns of a symmetric sparse matrix, using the Approximate Minimum Degree (AMD) ordering algorithm. The AMD implementation used is provided by the CSparse.NET library. For more information, see the AMD user guide, which is distributed as part of the SuiteSparse library. Authors: Serafeim Bakalakos

public class MGroup.LinearAlgebra.Reordering.OrderingAmdCSparseNet
    : IReorderingAlgorithm

Methods

Type Name Summary
ValueTuple<Int32[], Boolean> FindPermutation(SparsityPatternSymmetric pattern) See MGroup.LinearAlgebra.Reordering.IReorderingAlgorithm.FindPermutation(MGroup.LinearAlgebra.Reordering.SparsityPatternSymmetric)

OrderingAmdSuiteSparse

Calculates a fill-reducing permutation for the rows/columns of a symmetric sparse matrix, using the Approximate Minimum Degree (AMD) ordering algorithm. The AMD implementation used is provided by the SuiteSparse library. If SuiteSparse dlls are not available, try using the managed alternative MGroup.LinearAlgebra.Reordering.OrderingAmdCSparseNet instead. For more information, see the AMD user guide, which is distributed as part of the SuiteSparse library. Authors: Serafeim Bakalakos

public class MGroup.LinearAlgebra.Reordering.OrderingAmdSuiteSparse
    : IReorderingAlgorithm

Methods

Type Name Summary
ValueTuple<Int32[], ReorderingStatistics> FindPermutation(Int32 order, Int32 nonZerosUpper, Int32[] cscRowIndices, Int32[] cscColOffsets) Find a fill reducing permutation for the sparsity pattern of a symmetric matrix defined by the parameters. The returned permutation is new-to-old, namely reordered[i] = original[permutation[i]].
ValueTuple<Int32[], Boolean> FindPermutation(SparsityPatternSymmetric pattern) Find a fill reducing permutation for the sparsity pattern of a symmetric matrix defined by the parameters. The returned permutation is new-to-old, namely reordered[i] = original[permutation[i]].
ValueTuple<Int32[], ReorderingStatistics> FindPermutation(DokSymmetric dok) Find a fill reducing permutation for the sparsity pattern of a symmetric matrix defined by the parameters. The returned permutation is new-to-old, namely reordered[i] = original[permutation[i]].

OrderingCamdSuiteSparse

Implements the Constrained Approximate Minimum Degree (AMD) ordering algorithm, by calling the appropriate SuiteSparse library functions. CAMD is a variant of AMD that reorders the rows/columns of a matrix within each user defined group. On output, the rows/columns of each group are consecutive and each group is ordered according to its user defined priority. For more, see the CAMD user guide, which is distributed as part of the SuiteSparse library. Authors: Serafeim Bakalakos

public class MGroup.LinearAlgebra.Reordering.OrderingCamdSuiteSparse

Methods

Type Name Summary
ValueTuple<Int32[], ReorderingStatistics> FindPermutation(Int32 order, Int32[] cscRowIndices, Int32[] cscColOffsets, Int32[] constraints) Find a fill reducing permutation for the sparsity pattern of a symmetric matrix defined by the parameters. The returned permutation is new-to-old, namely reordered[i] = original[permutation[i]].
ValueTuple<Int32[], ReorderingStatistics> FindPermutation(SparsityPatternSymmetric pattern, Int32[] constraints) Find a fill reducing permutation for the sparsity pattern of a symmetric matrix defined by the parameters. The returned permutation is new-to-old, namely reordered[i] = original[permutation[i]].

ReorderingStatistics

Data transfer object for measurements taken during the execution of a matrix ordering algorithm. Authors: Serafeim Bakalakos

public class MGroup.LinearAlgebra.Reordering.ReorderingStatistics

Properties

Type Name Summary
Int32 NumMovedDenseRows The number of dense rows that are moved to the end during the ordering algorithm.
Int32 SupFactorizedNumNonZeros An upper bound for the number of non zero entries in a subsequent L*L^T factorization.

SparsityPatternSymmetric

Builder for the sparsity pattern of a symmetric matrix. If the values of the matrix entries are needed and the sparsity pattern will not change, use a DOK matrix instead. Only the super-diagonal part is stored (including the diagonal). Efficient for outputting the pattern to column major data structures (e.g. CSC arrays). Authors: Serafeim Bakalakos

public class MGroup.LinearAlgebra.Reordering.SparsityPatternSymmetric
    : ISparsityPatternSymmetric, ISparsityPattern

Properties

Type Name Summary
Int32 NumColumns See MGroup.LinearAlgebra.Reordering.ISparsityPattern.NumColumns.
Int32 NumRows See MGroup.LinearAlgebra.Reordering.ISparsityPattern.NumRows.
Int32 Order The number of rows/columns of the square matrix.

Methods

Type Name Summary
void AddEntry(Int32 rowIdx, Int32 colIdx) Marks the matrix entry (, ) as non-zero. If it was already marked, nothing happens.
ValueTuple<Int32[], Int32[]> BuildSymmetricCSCArrays(Boolean sortRowsOfEachCol) Assembles the indexing arrays according to the Compressed Sparse Columns format.
void ConnectIndices(Int32[] indices, Boolean sorted) Marks all possible matrix entries (i, j), such that i, j belong to ``, as non-zero.
void ConnectIndices(List<Int32> indices, Boolean sorted) Marks all possible matrix entries (i, j), such that i, j belong to ``, as non-zero.
Int32 CountNonZeros() See MGroup.LinearAlgebra.Reordering.ISparsityPattern.CountNonZeros.
Int32 CountNonZerosUpper() See .
IEnumerable<ValueTuple<Int32, Int32>> EnumerateNonZeros() See MGroup.LinearAlgebra.Reordering.ISparsityPattern.EnumerateNonZeros.
IEnumerable<ValueTuple<Int32, Int32>> EnumerateNonZerosUpper() See MGroup.LinearAlgebra.Reordering.ISparsityPatternSymmetric.EnumerateNonZerosUpper.
Boolean IsNonZero(Int32 rowIdx, Int32 colIdx) See MGroup.LinearAlgebra.Reordering.ISparsityPattern.IsNonZero(System.Int32,System.Int32).

Static Methods

Type Name Summary
SparsityPatternSymmetric CreateEmpty(Int32 order) Initializes a new instance of MGroup.LinearAlgebra.Reordering.SparsityPatternSymmetric for a -by- symmetric matrix. Initially all entries are assumed to be 0.
SparsityPatternSymmetric CreateFromDense(Matrix dense, Double tolerance = 0) Initializes a new instance of MGroup.LinearAlgebra.Reordering.SparsityPatternSymmetric for an existing matrix provided as . Initialy, only the entries of that satisfy: Math.Abs([i, j]) &gt; will be considered as non-zero.