Table of Contents

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

array1 T[][]
vector T[]

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

array1 T[][]
array2 T[][]

Returns

T[][]

null if unsuccessful

Create(T[])

Create 2d-array with only a single column

public static T[,] Create(T[] columnArray)

Parameters

columnArray T[]

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

columnList List<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

matrix T[,]

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

listOfArrays List<T[]>
indicesToIgnore List<int>

optionally, indices in each variable to ignore

Returns

T[][]

null if unsuccessful

Created2DFromJagged(T[][])

Convert a jagged array to a 2d-array

public static T[,] Created2DFromJagged(T[][] matrix)

Parameters

matrix T[][]

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

matrix T[,]
downsampleFactor int
keyindex int

Returns

T[,]

GetColumn(T[,], int)

returns the column of the matrix with the given index

public static T[] GetColumn(T[,] matrix, int columnNumber)

Parameters

matrix T[,]
columnNumber int

Returns

T[]

GetColumn(T[][], int)

returns the column of the matrix with the given index

public static T[] GetColumn(T[][] matrix, int columnNumber)

Parameters

matrix T[][]
columnNumber int

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

matrix T[,]
columnNumbers int[]

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

matrix T[,]
rowNumber int

Returns

T[]

Transpose(T[,])

transposes a 2d-array (rows are turned into columns and vice versa)

public static T[,] Transpose(T[,] matrix)

Parameters

matrix T[,]

Returns

T[,]