public class MatrixVectorOperations
extends java.lang.Object
Constructor and Description |
---|
MatrixVectorOperations() |
Modifier and Type | Method and Description |
---|---|
static double[][] |
addXXTrans(double[][] C,
double[] x)
Adds the tensor product of a vector to a matrix (usefull for covariance matrices)
|
static double[][] |
outer(double[] x,
double[] y)
Computes the tensor (outer) product of two vectors
|
static double[] |
rMul(double[][] A,
double[] x)
Performs a matrix*vector multiplication
|
static double[] |
rMuli(double[] C,
double[][] A,
double[] x)
Performs a matrix*vector multiplication in place
|
public static double[] rMul(double[][] A, double[] x)
A
- input matrix of size m*nx
- input vector of dimension npublic static double[] rMuli(double[] C, double[][] A, double[] x)
A
- input matrix of size m*nx
- input vector of dimension npublic static double[][] addXXTrans(double[][] C, double[] x)
C
- output matrix, C = C +x*x'x
- input vectorpublic static double[][] outer(double[] x, double[] y)
x
- first vectory
- second vector