Show / Hide Table of Contents

Interface ISparseVector<T>

Describes a vector that can be stepped through.

Inherited Members
IVector<T>.Length
IVector<T>.this[int]
IVector<T>.SwapElements(int, int)
IVector<T>.CopyTo(IVector<T>)
IVector<T>.Reset()
IVector<T>.Clear()
Namespace: SpiceSharp.Algebra
Assembly: SpiceSharp.dll
Syntax
public interface ISparseVector<T> : IVector<T>
Type Parameters
Name Description
T

Properties

ElementCount

Gets the number of elements in the vector.

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

The element count.

Methods

FindElement(int)

Finds a vector element at the specified index.

Declaration
Element<T> FindElement(int index)
Parameters
Type Name Description
int index

The index.

Returns
Type Description
Element<T>

The vector element; otherwise null.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown if index is negative.

GetElement(int)

Gets a vector element at the specified index. If it doesn't exist, a new one is created.

Declaration
Element<T> GetElement(int index)
Parameters
Type Name Description
int index

The index.

Returns
Type Description
Element<T>

The vector element.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown if index is negative.

GetFirstInVector()

Gets the first ISparseVectorElement<T> in the vector.

Declaration
ISparseVectorElement<T> GetFirstInVector()
Returns
Type Description
ISparseVectorElement<T>

The first element in the vector.

GetLastInVector()

Gets the last ISparseVectorElement<T> in the vector.

Declaration
ISparseVectorElement<T> GetLastInVector()
Returns
Type Description
ISparseVectorElement<T>

The last element in the vector.

RemoveElement(int)

Removes a vector element at the specified index.

Declaration
bool RemoveElement(int index)
Parameters
Type Name Description
int index

The index.

Returns
Type Description
bool

true if the element was removed; otherwise, false.

Extension Methods

Utility.ThrowIfNull<T>(T, string)
In this article
Back to top Generated by DocFX