ArraySlice<T> Constructor

Definition

Namespace: Extreme.Collections
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23

Overload List

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

ArraySlice<T>(T[])

Constructs a new array stride with zero offset and unit stride.
C#
public ArraySlice(
	T[] values
)

Parameters

values  T[]
The storage array.

ArraySlice<T>(Int32)

Constructs a new array slice.
C#
public ArraySlice(
	int length
)

Parameters

length  Int32
The capacity of the slice.

Remarks

Use this constructor to create an array slice that wraps a standard .NET array of the specified length. The offset is zero and the stride is 1.

ArraySlice<T>(T[], Int32)

Constructs a new array slice with unit stride.
C#
public ArraySlice(
	T[] values,
	int offset
)

Parameters

values  T[]
The storage array.
offset  Int32
The offset of the first element in the storage array.

Remarks

The values array is re-used. Modifying elements in the array slice will modify the elements in the original array. Conversely, if elements in the original array that correspond to elements in the array slice are modified, the elements of the array slice are modified as well.

ArraySlice<T>(Int32, Boolean)

Constructs a new array slice.
C#
public ArraySlice(
	int length,
	bool initializeToZero = true
)

Parameters

length  Int32
The capacity of the slice.
initializeToZero  Boolean  (Optional)
Indicates whether the elements should be explicitly set to zero.

Remarks

Use this constructor to create an array slice that wraps a standard .NET array of the specified length. The offset is zero and the stride is 1.

ArraySlice<T>(T[], Int32, Int32)

Constructs a new array.
C#
public ArraySlice(
	T[] values,
	int offset,
	int stride
)

Parameters

values  T[]
The storage array.
offset  Int32
The offset of the first element in the storage array.
stride  Int32
The step between elements in the storage array.

Remarks

The values array is re-used. Modifying elements in the array slice will modify the elements in the original array. Conversely, if elements in the original array that correspond to elements in the array slice are modified, the elements of the array slice are modified as well.

See Also