Struct Contribution<T>
A container for a contribution between two nodes.
Inherited Members
Namespace: SpiceSharp.Components.Common
Assembly: SpiceSharp.dll
Syntax
public struct Contribution<T> where T : struct
Type Parameters
Name | Description |
---|---|
T | The base value type. |
Remarks
Please be careful using this struct, as it is mutable. Its main use-case is to make code more readable by grouping variables for more complex models, because the conductance and equivalent current are often evaluated and passed around together.
Constructors
Contribution(T, T)
Initializes a new instance of the Contribution<T> struct.
Declaration
public Contribution(T g, T ceq)
Parameters
Type | Name | Description |
---|---|---|
T | g | The equivalent conductance. |
T | ceq | The equivalent current. |
Fields
C
The equivalent current.
Declaration
public T C
Field Value
Type | Description |
---|---|
T |
G
The equivalent conductance (Y-matrix contribution).
Declaration
public T G
Field Value
Type | Description |
---|---|
T |
Methods
Equals(object)
Determines whether the specified object, is equal to this instance.
Declaration
public override readonly bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with this instance. |
Returns
Type | Description |
---|---|
bool |
|
Overrides
GetHashCode()
Returns a hash code for this instance.
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
Operators
operator ==(Contribution<T>, Contribution<T>)
Implements the operator ==.
Declaration
public static bool operator ==(Contribution<T> left, Contribution<T> right)
Parameters
Type | Name | Description |
---|---|---|
Contribution<T> | left | The left. |
Contribution<T> | right | The right. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |
operator !=(Contribution<T>, Contribution<T>)
Implements the operator !=.
Declaration
public static bool operator !=(Contribution<T> left, Contribution<T> right)
Parameters
Type | Name | Description |
---|---|---|
Contribution<T> | left | The left. |
Contribution<T> | right | The right. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |