Class VecExtensionMethods
Utility functions and operations for treating arrays as mathetmatical vectors
Inherited Members
Namespace: TimeSeriesAnalysis
Assembly: TimeSeriesAnalysis.dll
Syntax
public static class VecExtensionMethods
Methods
| Edit this page View SourceAdd(double[], double, double)
Add a scalar to vector
Declaration
public static double[] Add(this double[] array, double scalar, double nanValue = -9999)
Parameters
Type | Name | Description |
---|---|---|
double[] | array | |
double | scalar | |
double | nanValue |
Returns
Type | Description |
---|---|
double[] |
Mult(double[], double, double)
Multiply vector by a scalar
Declaration
public static double[] Mult(this double[] array, double scalar, double nanValue = -9999)
Parameters
Type | Name | Description |
---|---|---|
double[] | array | |
double | scalar | |
double | nanValue |
Returns
Type | Description |
---|---|
double[] |
Sub(double[], double[], double)
Elementwise subtraction of two arrays of same size
Declaration
public static double[] Sub(this double[] array1, double[] array2, double nanValue = -9999)
Parameters
Type | Name | Description |
---|---|---|
double[] | array1 | |
double[] | array2 | |
double | nanValue |
Returns
Type | Description |
---|---|
double[] |
SubArray(double[], int, int)
Returns the portion of array1 starting and indStart, and ending at indEnd(or at the end if third paramter is omitted)
Declaration
public static double[] SubArray(this double[] array1, int indStart, int indEnd = -9999)
Parameters
Type | Name | Description |
---|---|---|
double[] | array1 | array to get subarray from |
int | indStart | starting index |
int | indEnd | ending index(or to the end if omitted) |
Returns
Type | Description |
---|---|
double[] | null if indStart and indEnd are the same, otherwise the subarray |
ToString(double[], int, string)
Create a compact string of vector with a certain number of significant digits and a chosen divider
Declaration
public static string ToString(this double[] array, int nSignificantDigits, string dividerStr = ";")
Parameters
Type | Name | Description |
---|---|---|
double[] | array | |
int | nSignificantDigits | |
string | dividerStr |
Returns
Type | Description |
---|---|
string |