Class Arrays
public static class Arrays
- Inheritance
-
Arrays
- Inherited Members
Methods
AppendAt<T>(T[], int, T)
Inserts item into a specific index.
public static T[] AppendAt<T>(T[] source, int index, T value)
Parameters
sourceT[]The array to insert copy and insert value to.
indexintThe index to insert to.
valueT
Returns
- T[]
a copy of source with the appended value.
Type Parameters
T
Concat<T>(T[], T[])
Performs fast concatenation of multiple arrays
public static T[] Concat<T>(T[] left, T[] right)
Parameters
leftT[]rightT[]
Returns
- T[]
Type Parameters
T
Concat<T>(params T[][])
Performs fast concatenation of multiple arrays
public static T[] Concat<T>(params T[][] arrays)
Parameters
arraysT[][]
Returns
- T[]
Type Parameters
T
CopyToExceptAt<T>(T[], int, int, T[], int)
Copies an array contents except for a specific index.
public static void CopyToExceptAt<T>(this T[] source, int sourceOffset, int index, T[] destinition, int destOffset = 0)
Parameters
sourceT[]The array to copy from.
sourceOffsetintindexintThe index to ignore.
destinitionT[]The copying destinition
destOffsetintThe
destinition's offset
Type Parameters
T
CopyToExceptAt<T>(T[], int, T[], int)
Copies an array contents except for a specific index.
public static void CopyToExceptAt<T>(this T[] source, int index, T[] destinition, int destOffset = 0)
Parameters
sourceT[]The array to copy from.
indexintThe index to ignore.
destinitionT[]The copying destinition
destOffsetintThe
destinition's offset
Type Parameters
T
Create(NPTypeCode, int)
Creates an array of 1D of type typeCode.
public static Array Create(NPTypeCode typeCode, int length)
Parameters
typeCodeNPTypeCodeThe type to create this array.
lengthintThe length of the array
Returns
Remarks
Do not use this if you are trying to create jagged or multidimensional array.
Create(Type, IEnumerable)
Creates an array of 1D of type type.
public static Array Create(Type type, IEnumerable enumerable)
Parameters
typeTypeThe type to create this array.
enumerableIEnumerable
Returns
Remarks
Do not use this if you are trying to create jagged or multidimensional array.
Create(Type, int)
Creates an array of 1D of type type.
public static Array Create(Type type, int length)
Parameters
Returns
Remarks
Do not use this if you are trying to create jagged or multidimensional array.
Create(Type, int[])
Creates an array of specific length of type type.
public static Array Create(Type type, int[] length)
Parameters
Returns
Create<T>(int)
Creates an array 1D of type T.
public static T[] Create<T>(int length)
Parameters
lengthintThe length of the array
Returns
- T[]
Type Parameters
TThe type of the array
ExtractStructure(Array)
Extracts shape and type from given array.
public static (Shape Shape, Type DType) ExtractStructure(Array array)
Parameters
Returns
ExtractStructure<T>(T[])
Extracts shape and type from given array.
public static (Shape Shape, Type DType) ExtractStructure<T>(T[] array)
Parameters
Returns
Type Parameters
T
Flatten(Array)
Flattens any type of Array.
public static Array Flatten(Array array)
Parameters
arrayArray
Returns
Remarks
Supports both jagged array and multi-dim arrays.
Insert<T>(T[], int, T)
Inserts item into a specific index.
public static T[] Insert<T>(T[] source, int index, T value) where T : unmanaged
Parameters
sourceT[]The array to insert the value to.
indexintThe index to insert to.
valueT
Returns
- T[]
Type Parameters
T
Insert<T>(ref T[], int, T)
Inserts item into a specific index.
public static void Insert<T>(ref T[] source, int index, T value)
Parameters
sourceT[]The array to insert the value to.
indexintThe index to insert to.
valueT
Type Parameters
T
RemoveAt<T>(T[], int)
Removes a specific index from given array.
public static T[] RemoveAt<T>(this T[] source, int index)
Parameters
sourceT[]The array to remove
indexfrom.indexintThe index to remove.
Returns
- T[]
A copy of source without given
index
Type Parameters
T
ResolveElementType(Array)
Resolves Array element type recusivly.
public static Type ResolveElementType(this Array arr)
Parameters
arrArray
Returns
ResolveRank(Array)
Resolves Array's rank, supports both jagged array and multidim array.
public static int ResolveRank(this Array arr)
Parameters
arrArray
Returns
- int
The number of ranks
arrhas
ResolveShape(Array)
Resolves the shape of this given array.
public static Shape ResolveShape(this Array array)
Parameters
arrayArray
Returns
Remarks
Supports multi-dim and jagged arrays.
ResolveShapeAndType(Array)
Resolves the shape of this given array.
public static (Shape Shape, Type Type) ResolveShapeAndType(this Array array)
Parameters
arrayArray
Returns
Remarks
Supports multi-dim and jagged arrays.
Slice<T>(T[], int, int)
Slice an array.
public static T[] Slice<T>(this T[] source, int start, int end)
Parameters
Returns
- T[]
Type Parameters
T
Remarks
Supports negative end index
Slice<T>(T[], long, long)
Slice an array.
public static T[] Slice<T>(this T[] source, long start, long end)
Parameters
Returns
- T[]
Type Parameters
T
Remarks
Supports negative end index
Wrap(NPTypeCode, object)
Creates an array of 1D of type typeCode with length of 1 and a single value inside.
public static Array Wrap(NPTypeCode typeCode, object value)
Parameters
typeCodeNPTypeCodeThe type to create this array.
valueobjectThe value to insert
Returns
Remarks
Do not use this if you are trying to create jagged or multidimensional array.