Learn R Programming

JacobiEigen (version 0.3-4)

Jacobi: The Jacobi Algorithm using Rcpp

Description

The Classical Jacobi Algorithm

Usage

Jacobi(x, symmetric = TRUE, only.values = FALSE, eps = 0)

Arguments

x

A real symmetric matrix

symmetric

a logical value. Is the matrix symmetric? (Only symmetric matrices are allowed.)

only.values

A logical value: do you want only the eigenvalues?

eps

an error tolerance. 0.0 implies .Machine$double.eps and sqrt(.Machine$double.eps) if only.values = TRUE

Value

a list of two components as for base::eigen

Details

Eigenvalues and optionally, eigenvectore, of a real symmetric matrix using the classical Jacobi algorithm, (Jacobi, 1854)

Examples

Run this code
# NOT RUN {
V <- crossprod(matrix(runif(40, -1, 1), 8))
Jacobi(V)
identical(Jacobi(V), JacobiR(V))
all.equal(Jacobi(V)$values, base::eigen(V)$values)
# }

Run the code above in your browser using DataLab