IStorage2D<T> Interface

Represents the contract for storage of two-dimensional arrays.

Definition

Namespace: Numerics.NET.Collections
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
C#
public interface IStorage2D<T>

Type Parameters

T
The element type of the array.

Remarks

Implement the IStorage2D<T> interface to enable using the storage for implementations of linear algebra and other operations. The format should be suitable for calling external libraries like BLAS and LAPACK.

In general, the two-dimensional array is stored in a linear block of memory. Columns are stored in contuguous blocks with a fixed number of elements between them.

IStorage2D<T> objects do not have a size. The actual dimensions must be supplied separately.

  Caution

Types that implement IStorage2D<T> are generally meant for performance-critical code. No bounds checks or other validation is performed.

Properties

Item Gets or sets the element at the specified position.
LeadingDimension Gets the number of elements between the start of successive columns.
Memory2D Gets a 2D memory block over the elements of the array.

Return Value

A Memory2D<T>.
Offset Gets the position of the first stored element in the array
Span2D Gets a 2D span over the elements of the array.

Return Value

A Span2D<T>.

Methods

Clear Sets the specified number of elements to their default value.
GetIndex Gets the index in the storage array of the element at the specified position.
Span Gets a span over the elements of the array.

Return Value

A Span<T>.

See Also