Show / Hide Table of Contents

Interface ISolver<T>

Describes a linear system of equations. It tracks permutations of the equations and the variables.

Inherited Members
IParameterSetCollection.GetParameterSet<P>()
IParameterSetCollection.TryGetParameterSet<P>(out P)
IParameterSetCollection.ParameterSets
IParameterSet.SetParameter<P>(string, P)
IParameterSet.TrySetParameter<P>(string, P)
IParameterSet.GetProperty<P>(string)
IParameterSet.TryGetProperty<P>(string, out P)
IParameterSet.CreateParameterSetter<P>(string)
IParameterSet.CreatePropertyGetter<P>(string)
Namespace: SpiceSharp.Algebra
Assembly: SpiceSharp.dll
Syntax
public interface ISolver<T> : IParameterSetCollection, IParameterSet
Type Parameters
Name Description
T

The base type.

Properties

Degeneracy

Gets or sets the degeneracy of the matrix. For example, specifying 1 will let the solver know that one equation is expected to be linearly dependent on the others.

Declaration
int Degeneracy { get; set; }
Property Value
Type Description
int

The degeneracy.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown if the value is negative.

IsFactored

Gets a value indicating whether this solver has been factored. A solver needs to be factored becore it can solve for a solution.

Declaration
bool IsFactored { get; }
Property Value
Type Description
bool

true if this solver is factored; otherwise, false.

this[MatrixLocation]

Gets or sets the value of the matrix at the specified location.

Declaration
T this[MatrixLocation location] { get; set; }
Parameters
Type Name Description
MatrixLocation location

The location.

Property Value
Type Description
T

The value of the matrix element.

this[int]

Gets or sets the value of the right hand side vector at the specified row.

Declaration
T this[int row] { get; set; }
Parameters
Type Name Description
int row

The row.

Property Value
Type Description
T

The value of the right hand side vector.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown if row is negative.

this[int, int]

Gets or sets the value of the matrix at the specified row and column.

Declaration
T this[int row, int column] { get; set; }
Parameters
Type Name Description
int row

The row.

int column

The column.

Property Value
Type Description
T

The value.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown if row or column is negative.

Size

Gets the size of the solver. This is the total number of equations.

Declaration
int Size { get; }
Property Value
Type Description
int

The size.

Methods

BackwardSubstitute(IVector<T>)

Applies backward substitution on a factored matrix and the intermediate vector.

Declaration
void BackwardSubstitute(IVector<T> solution)
Parameters
Type Name Description
IVector<T> solution

The solution vector.

BackwardSubstituteTransposed(IVector<T>)

Applies backward substitution on the adjoint matrix and the intermediate vector.

Declaration
void BackwardSubstituteTransposed(IVector<T> solution)
Parameters
Type Name Description
IVector<T> solution

The solution vector.

Clear()

Clears the solver of any elements. The size of the solver becomes 0.

Declaration
void Clear()
Remarks

The method is only redefined here to avoid ambiguity issues between IMatrix<T> and IVector<T>.

ComputeDegenerateContribution(int)

Computes a contribution for degenerate solvers (Degeneracy is larger than 0). Used when solving submatrices separately.

Declaration
T ComputeDegenerateContribution(int index)
Parameters
Type Name Description
int index

The index.

Returns
Type Description
T

Returns the contribution.

ComputeDegenerateContributionTransposed(int)

Computes a contribution of the transposed solving for degenerate solvers (Degeneracy is larger than 0). Used when solving submatrices separately.

Declaration
T ComputeDegenerateContributionTransposed(int index)
Parameters
Type Name Description
int index

The index.

Returns
Type Description
T

Returns the contribution.

Factor()

Factor the equation matrix and right hand side vector. This method can save time when factoring similar matrices in succession.

Declaration
bool Factor()
Returns
Type Description
bool

true if the factoring was successful; otherwise, false.

ForwardSubstitute(IVector<T>)

Applies forward substitution on a factored matrix and right-hand side vector.

Declaration
void ForwardSubstitute(IVector<T> solution)
Parameters
Type Name Description
IVector<T> solution

The solution vector.

Exceptions
Type Condition
ArgumentNullException

Thrown if solution is null.

AlgebraException

Thrown if the solver is not factored yet.

ArgumentException

Thrown if solution does not have Size elements.

ForwardSubstituteTransposed(IVector<T>)

Applies forward substitution on the adjoint matrix and right-hand side vector.

Declaration
void ForwardSubstituteTransposed(IVector<T> solution)
Parameters
Type Name Description
IVector<T> solution

The solution vector.

Exceptions
Type Condition
ArgumentNullException

Thrown if solution is null.

AlgebraException

Thrown if the solver is not factored yet.

ArgumentException

Thrown if solution does not have Size elements.

Reset()

Clears all matrix and vector elements.

Declaration
void Reset()
Remarks

This method is only redefined here to avoid ambiguity issues between IMatrix<T> and IVector<T>.

Extension Methods

Utility.ThrowIfNull<T>(T, string)
Documentation.ParameterValues<T>(IParameterSet, bool)
Documentation.Parameters(IParameterSet)
Documentation.ParameterValues<T>(IParameterSetCollection, bool)
Documentation.Parameters(IParameterSetCollection)
In this article
Back to top Generated by DocFX