Learn R Programming

psvd (version 1.0-0)

mGSc: Modified Gram-Schmidt orthogonalization of a matrix

Description

This is an internal function which uses a C code to calculate an orthogonalization of a matrix. This function is used in the power method allowing to compute an eigendecomposition of a symmetric square.

Usage

mGSc(amat, m, n)

Value

This function returns a data frame containing 1 component

wp

Eigenvectors matrix.

Arguments

amat

Matrix in vector form.

m

Number of rows of the matrix amat.

n

Number of columns of the matrix amat.

Examples

Run this code
d <- 3
r <- 2
amat <- c(rnorm(d*r,0,1))
res <- mGSc(amat, d, r)
wp <- matrix(res$wp, nrow=d, ncol=r)
t(wp) 

Run the code above in your browser using DataLab