Array 2D<T> Structure
Represents a 2-dimensional array stored in a linear array.
Definition
Namespace: Numerics.NET.Collections
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
C#
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
public readonly struct Array2D<T> : IStorage2D<T, ArraySlice<T>, Array2D<T>>,
IStorage2D<T, Array2D<T>>, IStorage2D<T>
- Implements
- IStorage2D<T>, IStorage2D<T, Array2D<T>>, IStorage2D<T, ArraySlice<T>, Array2D<T>>
Type Parameters
- T
- The element type of the array.
Remarks
Use the Array2D<T> structure to represent two-dimensional arrays in a format suitable for calling external libraries like BLAS and LAPACK. The two-dimensional array is stored in a linear array. Columns are stored in contuguous blocks with a fixed number of elements between them.
Array2D<T> objects do not have a size. The actual dimensions must be supplied separately.
Constructors
Array2D<T>(Int32, Int32) | Constructs a new array. |
Array2D<T>(T[], Int32, Int32) | Constructs a new array. |
Array2D<T>(Int32, Int32, Boolean) | Constructs a new array. |
Properties
Item | Gets or sets the element at the specified position. |
Leading | Gets the number of elements between the start of successive columns. |
Memory2D |
Gets a 2D memory block over the elements of the array.
Return ValueA Memory2D<T>. |
Offset | Gets the offset of the first element in the storage array. |
Span2D |
Gets a 2D span over the elements of the array.
Return ValueA Span2D<T>. |
Values | Gets the storage array. |
Methods
AsArray1D | Returns the array as an array with offset. |
AsSlice | Returns the array as an array slice with unit leadingDimension. |
Clear | Sets the specified number of elements to their default value. |
Clone | Creates a deep copy of the array. |
Clone | Returns a new contiguous 2D array with the specified elements of the current array. |
Column | Returns an array with offset that corresponds to a column in the array. |
Column | Returns an array with offset that corresponds to a column in the array that starts at the specified position. |
Create | Creates an empty 2D array with the specified leading dimension. |
Diagonal | Returns an array slice that corresponds to a column in the array. |
Equals |
Checks if an object is equal to this instance.
(Overrides ValueType.Equals(Object)) |
From( | Returns the array starting at the specified position. |
From( | Returns the array starting at the specified position with the specified leading dimension. |
Get |
Gets a hash code for this instance.
(Overrides ValueType.GetHashCode()) |
Get | Gets the index in the storage array of the element at the specified position. |
Get | Gets the Type of the current instance. (Inherited from Object) |
Resize | Returns a new array with the specified size and leading dimension. Elements are copied to the new array. |
Row | Returns the array slice that corresponds to a row in the array that starts at the specified position. |
Row | Returns the array slice that corresponds to a row in the array that starts at the specified position. |
Slice | Returns an array slice with a specified stride that starts at the specified position. |
Span |
Gets a span over the elements of the array.
Return ValueA Span<T>. |
ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType) |
Transpose | Transposes the elements of the 2D array and returns the result. |
Transpose | Transposes the elements of the 2D array and returns the result in the specified array. |
Vector |
Returns an array slice with a specified stride that starts at the specified position.
Obsolete. |
With |
Returns the array at the current position
with the specified leading dimension.
Obsolete. |
Operators
Equality( | Checks whether two 2D arrays are equal. |
Implicit(Array2D<T> to ReadOnlySpan<T>) | Implicitly converts a 2D array to a read-only span. |
Implicit(Array2D<T> to Span<T>) | Implicitly converts a 2D array to a (writable) span. |
Inequality( | Checks whether two 2D arrays are not equal. |
Fields
Empty | Returns an empty 2D array. |