Class MarkowitzQuickDiagonal<T>
Markowitz-based pivot search. Quickly search the diagonal for valid pivots.
Implements
Inherited Members
Namespace: SpiceSharp.Algebra.Solve
Assembly: SpiceSharp.dll
Syntax
public class MarkowitzQuickDiagonal<T> : MarkowitzSearchStrategy<T>, ICloneable<MarkowitzSearchStrategy<T>>
Type Parameters
Name | Description |
---|---|
T | The base value type. |
Properties
MaxMarkowitzTies
Gets or sets the maximum number of diagonals that are considered for choosing the pivot.
Declaration
[GreaterThan(1)]
public static int MaxMarkowitzTies { get; set; }
Property Value
Type | Description |
---|---|
int | The maximum number of searched pivots with the same markowitz product. |
Remarks
The pivot search strategy will try to find pivots with the lowest "Markowitz product", which scores how many extra unwanted elements a row/column could create as a by-product of factoring the solver. When this score is tied, this search strategy will keep a list of them with a maximum of this amount of elements.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if the value is not greater than 1. |
TiesMultiplier
Gets or sets a heuristic for speeding up pivot searching.
Declaration
[GreaterThanOrEquals(0)]
public static int TiesMultiplier { get; set; }
Property Value
Type | Description |
---|---|
int | The multiplier for searching pivots with the same markowitz products. |
Remarks
Instead of searching the whole matrix for a pivot on the diagonal, the search strategy can choose to stop searching for more pivot elements with the lowest "Markowitz product", which scores how many extra unwanted elements a row/column could create as a by-product of factoring the solver. When this score is tied, this search strategy will keep a list of them with a maximum of (MarkowitzProduct * TiesMultiplier) elements. In other words, pivots with a high Markowitz product will ask the search strategy for more entries to make sure that we can do better. Set this value to MaxMarkowitzTies to always search for the maximum number of eligible pivots.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if the value is negative. |
Methods
Clone()
Clones the instance.
Declaration
public override MarkowitzSearchStrategy<T> Clone()
Returns
Type | Description |
---|---|
MarkowitzSearchStrategy<T> | The cloned instance. |
Overrides
FindPivot(Markowitz<T>, ISparseMatrix<T>, int, int)
Find a pivot in a matrix.
Declaration
public override Pivot<ISparseMatrixElement<T>> FindPivot(Markowitz<T> markowitz, ISparseMatrix<T> matrix, int eliminationStep, int max)
Parameters
Type | Name | Description |
---|---|---|
Markowitz<T> | markowitz | The Markowitz pivot strategy. |
ISparseMatrix<T> | matrix | The matrix. |
int | eliminationStep | The current elimination step. |
int | max | The maximum row/column index. |
Returns
Type | Description |
---|---|
Pivot<ISparseMatrixElement<T>> | The pivot element, or null if no pivot was found. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
ArgumentOutOfRangeException | Thrown if |