MemorySlice<T> Structure

Represents a slice of elements in a one-dimensional array.

Definition

Namespace: Numerics.NET.Collections
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.0
C#
public readonly struct MemorySlice<T> : IStorageSlice<T, MemorySlice<T>>, 
	IStorageSlice<T>
Inheritance
Object  →  ValueType  →  MemorySlice<T>
Implements
IStorageSlice<T>, IStorageSlice<T, MemorySlice<T>>

Type Parameters

T
The element type of the array.

Constructors

MemorySlice<T>(T[]) Constructs a new array stride with zero offset and unit stride.
MemorySlice<T>(Int32, Boolean) Constructs a new array slice.
MemorySlice<T>(Memory<T>, Int32) Constructs a new array.
MemorySlice<T>(T[], Int32) Constructs a new array.

Properties

Item Gets or sets the element at the specified position.
SpanSlice 
Stride Gets the step between successive elements in the storage array.
Values Gets the storage array.

Methods

AsMemory2D Constructs a 2D array with the specified leading dimension.
AsSpan Converts an array slice to a span.
BlasOffset Returns the offset according to the BLAS convention for negative strides.
CloneData 
Equals Checks if an object is equal to this instance.
(Overrides ValueType.Equals(Object))
From(Int32) Returns an array slice starting at the specified index.
From(Int32, Int32) Returns an array slice starting at the specified index.
GetHashCode Gets a hash code for this instance.
(Overrides ValueType.GetHashCode())
GetIndex Gets the index in the storage array of the element at the specified position.
GetTypeGets the Type of the current instance.
(Inherited from Object)
ToArray Returns the elements of the array slice in an array.
ToStringReturns the fully qualified type name of this instance.
(Inherited from ValueType)

Operators

Equality(MemorySlice<T>, MemorySlice<T>) Checks whether two array slices are equal.
Implicit(Memory<T> to MemorySlice<T>) Implicitly converts a memory block to a memory slice with unit stride.
Implicit(T[] to MemorySlice<T>) Implicitly converts a .NET array to a memory slice with unit stride.
Inequality(MemorySlice<T>, MemorySlice<T>) Checks whether two array slices are not equal.

Fields

Empty Returns an array slice with no elements.

See Also