Class VectorVectorMult_DDRM
public class VectorVectorMult_DDRM
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description VectorVectorMult_DDRM() -
Method Summary
Modifier and Type Method Description static voidaddOuterProd(double gamma, org.ejml.data.DMatrixD1 x, org.ejml.data.DMatrixD1 y, org.ejml.data.DMatrix1Row A)Adds to A ∈ ℜ m × n the results of an outer product multiplication of the two vectors.static voidhouseholder(double gamma, org.ejml.data.DMatrixD1 u, org.ejml.data.DMatrixD1 x, org.ejml.data.DMatrixD1 y)Multiplies a householder reflection against a vector:
y = (I + γ u uT)xstatic doubleinnerProd(org.ejml.data.DMatrixD1 x, org.ejml.data.DMatrixD1 y)Computes the inner product of the two vectors.static doubleinnerProdA(org.ejml.data.DMatrixD1 x, org.ejml.data.DMatrixD1 A, org.ejml.data.DMatrixD1 y)return = xT*A*ystatic doubleinnerProdTranA(org.ejml.data.DMatrixD1 x, org.ejml.data.DMatrixD1 A, org.ejml.data.DMatrixD1 y)xTATystatic voidouterProd(org.ejml.data.DMatrixD1 x, org.ejml.data.DMatrixD1 y, org.ejml.data.DMatrix1Row A)Sets A ∈ ℜ m × n equal to an outer product multiplication of the two vectors.static voidrank1Update(double gamma, org.ejml.data.DMatrixRMaj A, org.ejml.data.DMatrixRMaj u, org.ejml.data.DMatrixRMaj w)Performs a rank one update on matrix A using vectors u and w.static voidrank1Update(double gamma, org.ejml.data.DMatrixRMaj A, org.ejml.data.DMatrixRMaj u, org.ejml.data.DMatrixRMaj w, org.ejml.data.DMatrixRMaj B)Performs a rank one update on matrix A using vectors u and w.
-
Constructor Details
-
VectorVectorMult_DDRM
public VectorVectorMult_DDRM()
-
-
Method Details
-
innerProd
public static double innerProd(org.ejml.data.DMatrixD1 x, org.ejml.data.DMatrixD1 y)Computes the inner product of the two vectors. In geometry this is known as the dot product.
∑k=1:n xk * yk
where x and y are vectors with n elements.These functions are often used inside of highly optimized code and therefor sanity checks are kept to a minimum. It is not recommended that any of these functions be used directly.
- Parameters:
x- A vector with n elements. Not modified.y- A vector with n elements. Not modified.- Returns:
- The inner product of the two vectors.
-
innerProdA
public static double innerProdA(org.ejml.data.DMatrixD1 x, org.ejml.data.DMatrixD1 A, org.ejml.data.DMatrixD1 y)return = xT*A*y
- Parameters:
x- A vector with n elements. Not modified.A- A matrix with n by m elements. Not modified.y- A vector with m elements. Not modified.- Returns:
- The results.
-
innerProdTranA
public static double innerProdTranA(org.ejml.data.DMatrixD1 x, org.ejml.data.DMatrixD1 A, org.ejml.data.DMatrixD1 y)xTATy
- Parameters:
x- A vector with n elements. Not modified.A- A matrix with n by n elements. Not modified.y- A vector with n elements. Not modified.- Returns:
- The results.
-
outerProd
public static void outerProd(org.ejml.data.DMatrixD1 x, org.ejml.data.DMatrixD1 y, org.ejml.data.DMatrix1Row A)Sets A ∈ ℜ m × n equal to an outer product multiplication of the two vectors. This is also known as a rank-1 operation.
A = x * y' where x ∈ ℜ m and y ∈ ℜ n are vectors.Which is equivalent to: Aij = xi*yj
These functions are often used inside of highly optimized code and therefor sanity checks are kept to a minimum. It is not recommended that any of these functions be used directly.
- Parameters:
x- A vector with m elements. Not modified.y- A vector with n elements. Not modified.A- A Matrix with m by n elements. Modified.
-
addOuterProd
public static void addOuterProd(double gamma, org.ejml.data.DMatrixD1 x, org.ejml.data.DMatrixD1 y, org.ejml.data.DMatrix1Row A)Adds to A ∈ ℜ m × n the results of an outer product multiplication of the two vectors. This is also known as a rank 1 update.
A = A + γ x * yT where x ∈ ℜ m and y ∈ ℜ n are vectors.Which is equivalent to: Aij = Aij + γ xi*yj
These functions are often used inside of highly optimized code and therefor sanity checks are kept to a minimum. It is not recommended that any of these functions be used directly.
- Parameters:
gamma- A multiplication factor for the outer product.x- A vector with m elements. Not modified.y- A vector with n elements. Not modified.A- A Matrix with m by n elements. Modified.
-
householder
public static void householder(double gamma, org.ejml.data.DMatrixD1 u, org.ejml.data.DMatrixD1 x, org.ejml.data.DMatrixD1 y)Multiplies a householder reflection against a vector:
y = (I + γ u uT)x
The Householder reflection is used in some implementations of QR decomposition.
- Parameters:
u- A vector. Not modified.x- a vector. Not modified.y- Vector where the result are written to.
-
rank1Update
public static void rank1Update(double gamma, org.ejml.data.DMatrixRMaj A, org.ejml.data.DMatrixRMaj u, org.ejml.data.DMatrixRMaj w, org.ejml.data.DMatrixRMaj B)Performs a rank one update on matrix A using vectors u and w. The results are stored in B.
B = A + γ u wT
This is called a rank1 update because the matrix u wT has a rank of 1. Both A and B can be the same matrix instance, but there is a special rank1Update for that.
- Parameters:
gamma- A scalar.A- A m by m matrix. Not modified.u- A vector with m elements. Not modified.w- A vector with m elements. Not modified.B- A m by m matrix where the results are stored. Modified.
-
rank1Update
public static void rank1Update(double gamma, org.ejml.data.DMatrixRMaj A, org.ejml.data.DMatrixRMaj u, org.ejml.data.DMatrixRMaj w)Performs a rank one update on matrix A using vectors u and w. The results are stored in A.
A = A + γ u wT
This is called a rank1 update because the matrix u wT has a rank of 1.
- Parameters:
gamma- A scalar.A- A m by m matrix. Modified.u- A vector with m elements. Not modified.
-