Interface IHistory<T>
Interface describing a history of a value.
Inherited Members
Namespace: SpiceSharp.Simulations
Assembly: SpiceSharp.dll
Syntax
public interface IHistory<T> : IEnumerable<T>, IEnumerable
Type Parameters
Name | Description |
---|---|
T | The value type. |
Properties
Length
Gets the number of points tracked by the history.
Declaration
int Length { get; }
Property Value
Type | Description |
---|---|
int | The length. |
Value
Gets or sets the current value in the history.
Declaration
T Value { get; set; }
Property Value
Type | Description |
---|---|
T | The current value. |
Methods
Accept()
Accepts the current point and moves on to the next.
Declaration
void Accept()
GetPreviousValue(int)
Gets the previous value. An index of 0 means the current value.
Declaration
T GetPreviousValue(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The number of points to go back. |
Returns
Type | Description |
---|---|
T | The previous value. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if |
Set(Func<int, T>)
Sets all values in the history to the value returned by the specified method.
Declaration
void Set(Func<int, T> method)
Parameters
Type | Name | Description |
---|---|---|
Func<int, T> | method | The method for creating the value. The index indicates the current point. |
Set(T)
Sets all values in the history to the same value.
Declaration
void Set(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value. |
Extension Methods
See Also
IEnumerable<T>