Show / Hide Table of Contents

Class ArrayExtensions

Contains extensions to simplify the conversion of a 1-dimensional array to an up 6-simensional array.

Inheritance
System.Object
ArrayExtensions
Namespace: HDF5.NET
Assembly: HDF5.NET.dll
Syntax
public static class ArrayExtensions

Methods

| Improve this Doc View Source

ToArray2D<T>(T[], Int64, Int64)

Converts the 1-dimensional input array into a 2-dimensional output array by coping the data. See also HDF5.NET for a copy-free version.

Declaration
public static T[, ] ToArray2D<T>(this T[] data, long dim0, long dim1)
    where T : struct
Parameters
Type Name Description
T[] data

The array to convert.

System.Int64 dim0

The size of dimension 0.

System.Int64 dim1

The size of dimension 1.

Returns
Type Description
T[,]

A 2-dimensional array.

Type Parameters
Name Description
T

The base type of the array to convert.

| Improve this Doc View Source

ToArray3D<T>(T[], Int64, Int64, Int64)

Converts the 1-dimensional input array into a 3-dimensional output array by coping the data.

Declaration
public static T[,, ] ToArray3D<T>(this T[] data, long dim0, long dim1, long dim2)
    where T : struct
Parameters
Type Name Description
T[] data

The array to convert.

System.Int64 dim0

The size of dimension 0.

System.Int64 dim1

The size of dimension 1.

System.Int64 dim2

The size of dimension 2.

Returns
Type Description
T[,,]

A 3-dimensional array.

Type Parameters
Name Description
T

The base type of the array to convert.

| Improve this Doc View Source

ToArray4D<T>(T[], Int64, Int64, Int64, Int64)

Converts the 1-dimensional input array into a 4-dimensional output array by coping the data.

Declaration
public static T[,,, ] ToArray4D<T>(this T[] data, long dim0, long dim1, long dim2, long dim3)
    where T : struct
Parameters
Type Name Description
T[] data

The array to convert.

System.Int64 dim0

The size of dimension 0.

System.Int64 dim1

The size of dimension 1.

System.Int64 dim2

The size of dimension 2.

System.Int64 dim3

The size of dimension 3.

Returns
Type Description
T[,,,]

A 4-dimensional array.

Type Parameters
Name Description
T

The base type of the array to convert.

| Improve this Doc View Source

ToArray5D<T>(T[], Int64, Int64, Int64, Int64, Int64)

Converts the 1-dimensional input array into a 5-dimensional output array by coping the data.

Declaration
public static T[,,,, ] ToArray5D<T>(this T[] data, long dim0, long dim1, long dim2, long dim3, long dim4)
    where T : struct
Parameters
Type Name Description
T[] data

The array to convert.

System.Int64 dim0

The size of dimension 0.

System.Int64 dim1

The size of dimension 1.

System.Int64 dim2

The size of dimension 2.

System.Int64 dim3

The size of dimension 3.

System.Int64 dim4

The size of dimension 4.

Returns
Type Description
T[,,,,]

A 5-dimensional array.

Type Parameters
Name Description
T

The base type of the array to convert.

| Improve this Doc View Source

ToArray6D<T>(T[], Int64, Int64, Int64, Int64, Int64, Int64)

Converts the 1-dimensional input array into a 6-dimensional output array by coping the data.

Declaration
public static T[,,,,, ] ToArray6D<T>(this T[] data, long dim0, long dim1, long dim2, long dim3, long dim4, long dim5)
    where T : struct
Parameters
Type Name Description
T[] data

The array to convert.

System.Int64 dim0

The size of dimension 0.

System.Int64 dim1

The size of dimension 1.

System.Int64 dim2

The size of dimension 2.

System.Int64 dim3

The size of dimension 3.

System.Int64 dim4

The size of dimension 4.

System.Int64 dim5

The size of dimension 5.

Returns
Type Description
T[,,,,,]

A 6-dimensional array.

Type Parameters
Name Description
T

The base type of the array to convert.

  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2023 Vincent Wilms