Matrix Related Functions (version 0.4.x.BETA)

In this section:

 

vxMatMulMbyMT()

vxMatMulM1byM2T()

vxMatMulM1TbyM2()

vxMatMulMTbyVector()

vxMatrixTrace()

vxPseudoInverseMat()

vxLinearEqSolver()

 

 

DESCRIPTION

ViXL3D.DLL

ViXL3D.XLL

Multiple a Matrix by its Transpose

Multiply the matrix Mat_1 by the transpose of itself. Populates the vector Product, with the result of the multiplication, as

P[m][m] = M[m][n] * MT[n][m]

 

ViXL_DLL_API int _vxMatMulMbyMT(

   const vector<vector<<double>> &Matrix,

   vector<vector<<double>> &Product

);

 

Populates the vector Product, with Matrix multiplied by its transpose, as P[m][m].

 

vxMatMulMbyMT(const Matrix &_Matrix

);

 

Matrix = m rows x n columns

 

Returns product of Matrix multiplied by its transpose, as m rows x m columns (square).

Multiple Matrices, M1 by Transpose M2

Multiply the matrix Mat_1 by the transpose of the matrix Mat_2. The number of columns in Mat_1 must be equal to the number of columns in Mat_2. Populates the vector Product, with the result of the multiplication, as

P[m][j] = M1[m][n] * M2T[j][n]

 

ViXL_DLL_API int _vxMatMulM1byM2T(

   const vector<vector<<double>> &Mat_1,

   const vector<vector<<double>> &Mat_2,

   vector<vector<<double>> &Product

);

 

Populates the vector Product, with the result of matrix Mat_1 multiplied by the transpose of matrix Mat_2, as P[m][j].

vxMatMulM1byM2T(const Matrix &_Mat_1,

   const Matrix &_Mat_2

);

 

Mat_1 = m rows x n columns

Mat_2 = j rows x n columns

 

Returns product of Mat_1 multiplied by the transpose of Mat_2, as m rows x j columns.

 

Multiple Matrices, Transpose M1 by M2

Multiply the transpose of the matrix Mat_1 by the matrix Mat_2. The number of rows in Mat_1 must be equal to the number of rows in Mat_2. Populates the vector Product, with the result of the multiplication, as

P[n][j] = M1 T[m][n] * M2[m][j]

 

ViXL_DLL_API int _vxMatMulM1TbyM2(

   const vector<vector<<double>> &Mat_1,

   const vector<vector<<double>> &Mat_2,

   vector<vector<<double>> &Product

);

 

Populates the vector Product, with the result of the transpose of matrix Mat_1 multiplied by matrix Mat_2, as P[n][j].

vxMatMulM1TbyM2(const Matrix &_Mat_1,

   const Matrix &_Mat_2

);

 

Mat_1 = m rows x n columns

Mat_2 = m rows x j columns

 

Returns product of the transpose of Mat_1 multiplied by Mat_2, as m rows x j columns.

 

Multiple Transpose of Matrix by Vector

Multiply the transpose the [m x n] array Matrix, by the vector Vector, of a length equal to the length m (rows) of Matrix. Populates the vector Product, of length equal to Matrix n (columns).

P[n] = MT[m][n] * V[m]

 

ViXL_DLL_API int _vxMatMulMTbyVector(

   const vector<vector<<double>> &Matrix,

   const vector<double> &Vector,

   vector<<double> &Product

);

 

Populates vector Product, of length equal to Matrix columns; or NULL on error.

 

vxMatMulMTbyVector(const Matrix &_ Matrix,

   const Matrix &_ Vector

);

 

Mat_1 = m rows x n columns

Vector = m rows x 1 columns

 

Returns product of the transpose of Matrix multiplied by Vector, as n rows x 1 column.

 

Compute the Trace of a Matrix

Determine the trace of the [n x n] array Matrix, which must be square. Returns the sum of the diagonal elements of Matrix.

ViXL_DLL_API double _vxMatrixTrace(

   const vector<vector<<double>> &Matrix

);

 

Returns the sum of the diagonal elements.

 

vxMatrixTrace(const Matrix &_Matrix

);

 

Matrix = m rows x n columns

 

Returns the sum of the diagonal elements.

 

Pseudo-Inverse Matrix Solver

Find the best solution vector for an over-constrained system of linear equations, given array Matrix, and vector Constraints. Length of Constraints must equal the length m (rows) of Matrix. Populates vector Solution, A-1, for x = A-1 * w, of length equal to Matrix n (columns).

 

ViXL_DLL_API int _vxPseudoInverseMat(

   const vector<vector<<double>> &Matrix,

   const vector<double> &Constraints,

   vector<double> &Solution

);

 

Populates vector Solution, of length equal to Matrix n (columns), x = A-1 * w

 

 

vxPseudoInverseMat(const Matrix &_Matrix,

   const Matrix &_Constraints

);

 

Matrix = m rows x n columns

Constraint = m rows x 1 column

 

Returns solution vector, n rows x 1 column, for x = A-1 * w

Simultaneous Linear Equations Solver

Calculates the solution vector for [m x m] array Matrix, and vector Constraints. The number of equations must be equal to the number of unknowns, and the length of Constraints must be equal the length m (rows) of Matrix. Populates vector Solution, of length equal to Matrix n (columns). V[m] = M[m][m] * X[m]

 

ViXL_DLL_API int _vxLinearEqSolver(

   const vector<vector<<double>> &Matrix,

   const vector<double> &Constraints,

   vector<double> &Solution

);

 

Populates vector Solution, of length equal to Matrix m (columns), as

V[m] = M[m][m] * X[m]

 

 

vxLinearEqSolver(const Matrix &_Matrix,

   const Matrix &_Constraints

);

 

Matrix = m rows x m columns

Constraint = m rows x 1 column

 

Returns solution vector, m rows x 1 column, as V[m] = M[m][m] * X[m]

Expected to be available in version v.0.4.x and later.

 

 

Return to Function Reference

 

Return to Viewer Controls Overview