{Matrix} R# Documentation

Matrix


require(R);

#' The numeric matrix
imports "Matrix" from "Rlapack";

The numeric matrix

The numeric matrix

.NET clr type export
LA_mat: Double[]

.NET GeneralMatrix class.

The .NET GeneralMatrix Class provides the fundamental operations of numerical linear algebra. Various constructors create Matrices from two dimensional arrays of double precision floating point numbers. Various "gets" and "sets" provide access to submatrices and matrix elements. Several methods implement basic matrix arithmetic, including matrix addition and multiplication, matrix norms, and element-by-element array operations. Methods for reading and printing matrices are also included. All the operations in this version of the GeneralMatrix Class involve real matrices. Complex matrices may be handled in a future version. Five fundamental matrix decompositions, which consist of pairs or triples of matrices, permutation vectors, and the like, produce results in five decomposition classes. These decompositions are accessed by the GeneralMatrix class to compute solutions of simultaneous linear equations, determinants, inverses and other matrix functions. The five decompositions are: + CholeskyDecomposition of symmetric, positive definite matrices. + LUDecomposition of rectangular matrices. + QRDecomposition of rectangular matrices. + SingularValueDecomposition of rectangular matrices. + EigenvalueDecomposition of both symmetric and nonsymmetric square matrices. Example of use: Solve a linear system A x = b and compute the residual norm, ||b - A x||.

 double[][] vals;
 GeneralMatrix A = New NumericMatrix(vals);
 GeneralMatrix b = GeneralMatrix.Random(3,1);
 GeneralMatrix x = A.Solve(b);
 GeneralMatrix r = A.Multiply(x).Subtract(b);
 double rnorm = r.NormInf();



.NET clr function exports
fromGraph

create matrix from a graph

matrix

Matrices

matrix creates a matrix from the given set of values.

nmf

NMF Model fitting function

Fit a non-negative matrix factorization model to a given target matrix. The function allows for different update rules and initialization methods, and can fit different NMF variants.

as.matrix

as.matrix attempts to turn its argument into a matrix.

row_pack

matrix to vector by extract from the row dimensions

sum_all

sum all matrix

eigen

Spectral Decomposition of a Matrix

Computes eigenvalues and eigenvectors of numeric (double, integer, logical) or complex matrices.

gauss_solve

Gaussian elimination

In mathematics, Gaussian elimination, also known as row reduction, is an algorithm for solving systems of linear equations. It consists of a sequence of row-wise operations performed on the corresponding matrix of coefficients. This method can also be used to compute the rank of a matrix, the determinant of a square matrix, and the inverse of an invertible matrix. The method is named after Carl Friedrich Gauss (1777–1855). To perform row reduction on a matrix, one uses a sequence of elementary row operations to modify the matrix until the lower left-hand corner of the matrix is filled with zeros, as much as possible. There are three types of elementary row operations: + Swapping two rows, + Multiplying a row by a nonzero number, + Adding a multiple Of one row To another row. Using these operations, a matrix can always be transformed into an upper triangular matrix, And In fact one that Is In row echelon form. Once all Of the leading coefficients (the leftmost nonzero entry In Each row) are 1, And every column containing a leading coefficient has zeros elsewhere, the matrix Is said To be In reduced row echelon form. This final form Is unique; In other words, it Is independent Of the sequence Of row operations used. For example, In the following sequence Of row operations (where two elementary operations On different rows are done at the first And third steps), the third And fourth matrices are the ones In row echelon form, And the final matrix Is the unique reduced row echelon form.

dot

[Document Index]