Struct OnePort<T>
A structure containing the unknowns for a one-port.
Inherited Members
Namespace: SpiceSharp.Components.CommonBehaviors
Assembly: SpiceSharp.dll
Syntax
public readonly struct OnePort<T>
Type Parameters
Name | Description |
---|---|
T | The base value type. |
Remarks
A one-port is a device with two pins, where the current into one pin is equal to the current out of the other.
Constructors
OnePort(IVariableFactory<IVariable<T>>, IComponentBindingContext)
Initializes a new instance of the OnePort<T> struct.
Declaration
public OnePort(IVariableFactory<IVariable<T>> factory, IComponentBindingContext context)
Parameters
Type | Name | Description |
---|---|---|
IVariableFactory<IVariable<T>> | factory | The factory. |
IComponentBindingContext | context | The context. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
NodeMismatchException | Thrown if |
OnePort(IVariable<T>, IVariable<T>)
Initializes a new instance of the OnePort<T> struct.
Declaration
public OnePort(IVariable<T> positive, IVariable<T> negative)
Parameters
Type | Name | Description |
---|---|---|
IVariable<T> | positive | The positive. |
IVariable<T> | negative | The negative. |
Fields
Negative
The negative node.
Declaration
public readonly IVariable<T> Negative
Field Value
Type | Description |
---|---|
IVariable<T> |
Positive
The positive node.
Declaration
public readonly IVariable<T> Positive
Field Value
Type | Description |
---|---|
IVariable<T> |
Methods
Equals(object)
Determines whether the specified object, is equal to this instance.
Declaration
public override 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 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
GetMatrixLocations(IVariableMap)
Gets the matrix locations in the order (Positive, Positive), (Positive, Negative), (Negative, Positive), (Negative, Negative).
Declaration
public MatrixLocation[] GetMatrixLocations(IVariableMap map)
Parameters
Type | Name | Description |
---|---|---|
IVariableMap | map | The map. |
Returns
Type | Description |
---|---|
MatrixLocation[] | An array of matrix locations. |
GetRhsIndices(IVariableMap)
Gets the right-hand-side indices, in the order Positive, then Negative.
Declaration
public int[] GetRhsIndices(IVariableMap map)
Parameters
Type | Name | Description |
---|---|---|
IVariableMap | map | The map. |
Returns
Type | Description |
---|---|
int[] | An array with indices. |
Operators
operator ==(OnePort<T>, OnePort<T>)
Implements the operator ==.
Declaration
public static bool operator ==(OnePort<T> left, OnePort<T> right)
Parameters
Type | Name | Description |
---|---|---|
OnePort<T> | left | The left. |
OnePort<T> | right | The right. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |
operator !=(OnePort<T>, OnePort<T>)
Implements the operator !=.
Declaration
public static bool operator !=(OnePort<T> left, OnePort<T> right)
Parameters
Type | Name | Description |
---|---|---|
OnePort<T> | left | The left. |
OnePort<T> | right | The right. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |