Class Array2D<T>
- Namespace
- TimeSeriesAnalysis
- Assembly
- TimeSeriesAnalysis.dll
Generic array operations that can be done on arrays of any type, for operators specific to numerical arrays(matrices) see Matrix.cs
public class Array2D<T>
Type Parameters
T
- Inheritance
-
Array2D<T>
- Inherited Members
Methods
Append(T[][], T[])
Combine two arrays into a single array(increasing the number of rows)
public static T[][] Append(T[][] array1, T[] vector)
Parameters
array1T[][]vectorT[]a vector
Returns
- T[][]
null if unsuccessful
Combine(T[][], T[][])
Combine two arrays into a single array(increasing the number of rows)
public static T[][] Combine(T[][] array1, T[][] array2)
Parameters
array1T[][]array2T[][]
Returns
- T[][]
null if unsuccessful
Create(T[])
Create 2d-array with only a single column
public static T[,] Create(T[] columnArray)
Parameters
columnArrayT[]
Returns
- T[,]
CreateFromList(List<T[]>)
Initializes a 2D array from a list of arrays representing each column in the array
public static T[,] CreateFromList(List<T[]> columnList)
Parameters
columnListList<T[]>
Returns
- T[,]
null if list columnList dimensions do not match
CreateJaggedFrom2D(T[,])
Convert a 2D array into a jagged array
public static T[][] CreateJaggedFrom2D(T[,] matrix)
Parameters
matrixT[,]
Returns
- T[][]
CreateJaggedFromList(List<T[]>, List<int>)
Convert a list of 1D arrays to a jagged array
public static T[][] CreateJaggedFromList(List<T[]> listOfArrays, List<int> indicesToIgnore = null)
Parameters
Returns
- T[][]
null if unsuccessful
Created2DFromJagged(T[][])
Convert a jagged array to a 2d-array
public static T[,] Created2DFromJagged(T[][] matrix)
Parameters
matrixT[][]
Returns
- T[,]
Downsample(T[,], int, int)
Downsample a matrix where times are rows and variables are columns
public static T[,] Downsample(T[,] matrix, int downsampleFactor, int keyindex = 0)
Parameters
Returns
- T[,]
GetColumn(T[,], int)
returns the column of the matrix with the given index
public static T[] GetColumn(T[,] matrix, int columnNumber)
Parameters
matrixT[,]columnNumberint
Returns
- T[]
GetColumn(T[][], int)
returns the column of the matrix with the given index
public static T[] GetColumn(T[][] matrix, int columnNumber)
Parameters
matrixT[][]columnNumberint
Returns
- T[]
GetColumns(T[,], int[])
returns all the columns correspoding to columnNumbers in a 2d-array
public static T[,] GetColumns(T[,] matrix, int[] columnNumbers = null)
Parameters
matrixT[,]columnNumbersint[]
Returns
- T[,]
GetRow(T[,], int)
returns the row of the matrix with the given index as an vector
public static T[] GetRow(T[,] matrix, int rowNumber)
Parameters
matrixT[,]rowNumberint
Returns
- T[]
Transpose(T[,])
transposes a 2d-array (rows are turned into columns and vice versa)
public static T[,] Transpose(T[,] matrix)
Parameters
matrixT[,]
Returns
- T[,]