Struct InplaceArray<T>
An array-like object that stores up to four elements. This is a value type that does not allocate any additional memory.
Implements
Inherited Members
Namespace: Unity.MLAgents
Assembly: solution.dll
Syntax
public struct InplaceArray<T> : IEquatable<InplaceArray<T>> where T : struct
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
This does not implement any interfaces such as IList, in order to avoid any accidental boxing allocations.
Constructors
| Name | Description |
|---|---|
| InplaceArray(T) | Create a length-1 array. |
| InplaceArray(T, T) | Create a length-2 array. |
| InplaceArray(T, T, T) | Create a length-3 array. |
| InplaceArray(T, T, T, T) | Create a length-3 array. |
Properties
| Name | Description |
|---|---|
| this[int] | Per-element access. |
| Length | The length of the array. |
Methods
| Name | Description |
|---|---|
| Equals(object) | Check that the arrays are equivalent. |
| Equals(InplaceArray<T>) | Check that the arrays are equivalent. |
| FromList(IList<T>) | Construct an InplaceArray from an IList (e.g. Array or List). The source must be non-empty and have at most 4 elements. |
| GetHashCode() | Get a hashcode for the array. |
| ToString() | Returns a string representation of the array's elements. |
Operators
| Name | Description |
|---|---|
| operator ==(InplaceArray<T>, InplaceArray<T>) | Check that the arrays have the same length and have all equal values. |
| operator !=(InplaceArray<T>, InplaceArray<T>) | Check that the arrays are not equivalent. |