Array1D<T> Structure

Represents an array starting at an offset in an existing array.

Definition

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

Type Parameters

T
The element type of the array.

Constructors

Array1D<T>(Int32) Constructs a new array of the specified length with offset zero.
Array1D<T>(T[], Int32) Constructs a new array.
Array1D<T>(Int32, Boolean) Constructs a new array of the specified length with offset zero.

Properties

Item Gets or sets the element at the specified index.
Offset Gets the offset of the first element in the array.
SpanSlice Returns a span slice over the storage.
Stride Gets the step between successive elements in the storage array.
Values Gets the storage array.

Methods

AsArray2DFrom Returns a 2D array with first element at the specified index and the specified leading dimension.
AsSpan(Int32) Returns a span of the specified length from the beginning of the array.
AsSpan(Int32, Int32) Returns a span of the specified length from the specified start index.
Clear Sets the specified number of elements to their default value.
EqualsIndicates whether this instance and a specified object are equal.
(Inherited from ValueType)
From(Int32) Returns an array that starts at the specified index in the current array.
From(Int32, Int32) Returns an array slice that starts at the specified index in the current array.
GetHashCodeReturns the hash code for this instance.
(Inherited from ValueType)
GetIndex Gets the index of an element into the storage array.
GetTypeGets the Type of the current instance.
(Inherited from Object)
ReadOnlySpan Gets a read-only span of the specified length over the array.
Span Gets a span of the specified length over the array.
ToArray Copies the specified number of elements to a .NET array.
ToStringReturns the fully qualified type name of this instance.
(Inherited from ValueType)

Operators

Implicit(T[] to Array1D<T>) Implicitly converts a .NET array to an array with zero offset.
Implicit(Array1D<T> to ArraySlice<T>) Converts an array to an array slice with unit stride.
Implicit(Array1D<T> to ReadOnlySpan<T>) Implicitly converts a 1D array to a read-only span.
Implicit(Array1D<T> to Span<T>) Implicitly converts a 1D array to a (writable) span.

Fields

Empty Represents an empty array.

See Also