Learn R Programming

rcdd (version 1.6)

qgram: GMP Rational Gram-Schmidt

Description

Find Orthogonal Basis

Usage

qgram(x, remove.zero.vectors = TRUE)

Value

If remove.zero.vectors == FALSE, a matrix of the same dimensions as x whose columns are orthogonal and span the same vector subspace as the columns of x. Since making the columns unit vectors in the L2 sense could require irrational numbers, the columns are made unit vectors in the L1 sense unless they are zero vectors (which, of course, cannot be normalized).

If remove.zero.vectors == TRUE, then the result is the same except zero vectors are removed, so the columns of the result form a basis of the subspace.

Arguments

x

matrix of type "numeric" or "character". If "numeric" are converted to rational using d2q. Columns are considered vectors in space of dimension nrow(x).

remove.zero.vectors

logical.

See Also

ConvertGMP

Examples

Run this code
foo <- cbind(c("1", "1", "0", "0", "0"),
             c("2", "1", "0", "0", "0"),
             c("3", "1", "0", "0", "0"),
             c("1", "2", "3", "4", "5"))
qgram(foo)
qgram(foo, remo = FALSE)

Run the code above in your browser using DataLab