qgram: GMP Rational Gram-Schmidt

View source: R/qgram.R

qgramR Documentation

GMP Rational Gram-Schmidt

Description

Find Orthogonal Basis

Usage

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

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.

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.

See Also

ConvertGMP

Examples

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)

rcdd documentation built on April 25, 2023, 1:09 a.m.