Static Public Member Functions | |
static Scalar | Euclidean (const af::array &a) |
Gets the Euclidean norm for a vector. More... | |
static af::array | Euclidean (const af::array &a, const af::array &b) |
Gets the Euclidean norm for two vectors. More... | |
static Scalar | SquareEuclidean (const af::array &a) |
Gets the Square Euclidean norm for two vectors. More... | |
static af::array | SquareEuclidean (const af::array &a, const af::array &b) |
Gets the Square Euclidean norm for a vector. More... | |
static Scalar | Max (Scalar a, Scalar b, Scalar c) |
Gets the maximum value among three values. More... | |
static af::array | Covariance (const af::array &M) |
Covariance. More... | |
static af::array | CorrelationCoefficients (const af::array &inX, const af::array &inY=af::array()) |
Correlation coefficients. More... | |
static af::array | SquareDistance (const af::array &inX1, const af::array &inX2) |
Gets standardized Square Euclidean distance. More... | |
static af::array | UnscaledDistance (const af::array &inX1, const af::array &inX2) |
Unscaled distance. More... | |
static af::array | ScaledDistance (const af::array &inX1, const af::array &inX2, const af::array &inLengtScale) |
Scaled distance. More... | |
static af::array | NormalPDF (const af::array &inX, const af::array &inMu=af::array(), const af::array &inSigma=af::array()) |
Normal probability density function. More... | |
static af::array | LogNormalPDF (const af::array &inX, const af::array &inMu=af::array(), const af::array &inSigma=af::array()) |
Log normal probability density function. More... | |
static af::array | NormalCDF (const af::array &inX, const af::array &inMu=af::array(), const af::array &inSigma=af::array()) |
Normal cumulative distribution function.. More... | |
static af::array | LogNormalCDF (const af::array &inX, const af::array &inMu=af::array(), const af::array &inSigma=af::array()) |
Log normal cumulative distribution function. More... | |
static af::array | TriUpperIdx (int size, int dimension=0) |
Computes indexes of upper triangular matrix. More... | |
static af::array | TriLowerIdx (int size) |
Computes indexes of lower triangular matrix. More... | |
static af::array | DiagIdx (int size) |
Indexes of matrix diagonal. More... | |
static af::array | LinSpace (Scalar start, Scalar stop, int num, bool endpoint=true) |
Implementation of NumPy's Linspace. More... | |
static af::array | JitChol (const af::array &inA) |
Cholesky decomposition. More... | |
static Scalar | LogDet (af::array inA) |
Log determinant of the input matrix. More... | |
static void | MergeMaps (std::map< std::string, af::array > &lhs, const std::map< std::string, af::array > &rhs) |
static af::array | SortRows (af::array inA) |
Sort rows. More... | |
static af::array | Join (const af::array &inA, const af::array &inB, int dimension=0) |
Joins matrices and vectors along specific dimension. More... | |
static af::array | SolveQR (const af::array &A, const af::array &b) |
Linear solve usingQR decomposition. More... | |
static af::array | PDInverse (const af::array &inA) |
Computes the pseudo inverse of a matrix. More... | |
static af::array | ReadTXT (std::string filename, char delimiter=' ') |
Loads an array from a text file. More... | |
static bool | WriteTXT (const af::array &data, std::string filename, char delimiter=' ') |
Writes an array to a text file. More... | |
static bool | IsEqual (const af::array &a, const af::array &b) |
Query if 'a' is equal to 'b'. More... | |
static af::dtype | CheckDType () |
Checks af::array precision flag. More... | |
Definition at line 36 of file CommonUtil.h.
|
static |
Gets the Euclidean norm for a vector.
Admin, 3/27/2017.
a | [in,out] The af::array to process. |
|
static |
Gets the Euclidean norm for two vectors.
Hmetal T, 29/03/2018.
a | [in,out] The af::array to process. |
b | [in,out] The af::array to process. |
|
static |
Gets the Square Euclidean norm for two vectors.
Admin, 3/28/2017.
a | [in,out] The af::array to process. |
|
static |
Gets the Square Euclidean norm for a vector.
Hmetal T, 29/03/2018.
a | [in,out] The af::array to process. |
b | [in,out] The af::array to process. |
|
static |
Gets the maximum value among three values.
Hmetal T, 03.04.2017.
a | The first value a . |
b | The second value b . |
c | The third value c . |
|
static |
Covariance.
Hmetal T, 14.04.2017.
a | [in,out] Data matrix with row observation vectors. |
|
static |
Correlation coefficients.
calculates a matrix R of correlation coefficients for an array X, in which each row is an observation and each column is a variable.
inX | [in,out] The in x coordinate. |
inY | [in,out] (Optional) the in y coordinate. |
|
static |
Gets standardized Square Euclidean distance.
Computation has the form of,
\|\mathbf{x1}-\mathbf{x2}\|^2.
Admin, 5/24/2017.
inX1 | [in,out] The first x coordinate. |
inX2 | [in,out] The second x coordinate. |
|
static |
Unscaled distance.
Computation has the form of,
\sqrt{\|\mathbf{x1}-\mathbf{x2}\|^2}.
Admin, 5/24/2017.
inX1 | [in,out] The first x coordinate. |
inX2 | [in,out] The second x coordinate. |
|
static |
Scaled distance.
Computation has the form of,
\sqrt{\sum_{d=1}^D{(x1_d-x2_d)^2/v_d}}.
Admin, 5/24/2017.
inX1 | The first x coordinate. |
inX2 | The second x coordinate. |
inLengtScale | The lengt scale. |
|
static |
Normal probability density function.
Normal PDF is defined as follows:
$$f(x;mu,sigma)=\frac{1}{x\sqrt{2\pi\sigma^2}}\exp{-\frac{(x-mu)^2}{2\sigma^2}}.$$
Hmetal T, 22/11/2019.
inX | The in x coordinate. |
inMu | (Optional) The in mu. |
inSigma | (Optional) The in sigma. |
|
static |
Log normal probability density function.
Log normal PDF is defined as follows:
$$f(x;mu,sigma)=\frac{1}{x\sqrt{2\pi\sigma^2}}\exp{-\frac{(\log(x)-mu)^2}{2\sigma^2}}.$$
Hmetal T, 22/11/2019.
inX | The in x coordinate. |
inMu | (Optional) The in mu. |
inSigma | (Optional) The in sigma. |
|
static |
Normal cumulative distribution function..
Normal CDF is defined as follows:
$$f(x;mu,sigma)=\frac{1}{2}\left[1 + erf\left(\frac{x-mu}{\sigma\sqrt{2}}\right)\right].$$
Hmetal T, 22/11/2019.
inX | The in x coordinate. |
inMu | (Optional) The in mu. |
inSigma | (Optional) The in sigma. |
|
static |
Log normal cumulative distribution function.
Log normal CDF is defined as follows:
$$f(x;mu,sigma)=\frac{1}{2}\left[1 + erf\left(\frac{\ln{x}-mu}{\sigma\sqrt{2}}\right)\right].$$
Hmetal T, 22/11/2019.
inX | The in x coordinate. |
inMu | (Optional) The in mu. |
inSigma | (Optional) The in sigma. |
|
static |
Computes indexes of upper triangular matrix.
Hmetal T, 03/07/2018.
size | Size of the matrix. |
|
static |
Computes indexes of lower triangular matrix.
Hmetal T, 03/07/2018.
size | Size of the matrix. |
|
static |
Indexes of matrix diagonal.
Hmetal T, 23/04/2019.
size | Size of the matrix. |
|
static |
Implementation of NumPy's Linspace.
Hmetal T, 05/07/2018.
start | The start value. |
stop | The stop vale. |
num | Number of steps. |
endpoint | (Optional) true to endpoint. |
|
static |
Cholesky decomposition.
If needed, adds jitter to the diagonal to ensure semipositive definitness.
Hmetal T, 05/07/2018.
inA | [in,out] The in a. |
|
static |
Log determinant of the input matrix.
Hmetal T, 05/07/2018.
inA | The in a. |
|
static |
Sort rows.
Hmetal T, 03.05.2019.
inA | The in a. |
|
static |
Joins matrices and vectors along specific dimension.
Hmetal T, 06.05.2019.
inA | The in a. |
inB | The in b. |
|
static |
Linear solve usingQR decomposition.
Equivalent of Matlabs mldivide x = A.
Hmetal T, 27/05/2019.
A | [in,out] The af::array to process. |
b | [in,out] The af::array to process. |
|
static |
Computes the pseudo inverse of a matrix.
Hmetal T, 06/01/2020.
inA | [in,out] The in symetric matrix. |
|
static |
Loads an array from a text file.
Hmetal T, 20/12/2019.
filename | Filename of the file. |
|
static |
Writes an array to a text file.
Hmetal T, 20/12/2019.
data | The data array to write. |
filename | Filename of the file. |
delimiter | (Optional) The delimiter. |
|
static |
Query if 'a' is equal to 'b'.
Hmetal T, 29/04/2021.
a | An af::array to process. |
b | An af::array to process. |
|
static |
Checks af::array precision flag.
Hmetal T, 17/06/2019.