dpotrf: Cholesky factorization

View source: R/bigalgebra.R

dpotrfR Documentation

Cholesky factorization

Description

DPOTRF computes the Cholesky factorization of a real symmetric positive definite matrix A.

The factorization has the form

A =

U**T * U, if UPLO = 'U', or

A =

L * L**T, if UPLO = 'L',

where U is an upper triangular matrix and L is lower triangular.

This is the block version of the algorithm, calling Level 3 BLAS.

Usage

dpotrf(UPLO = "U", N = NULL, A, LDA = NULL)

Arguments

UPLO

a character.

'U':

Upper triangle of A is stored;

'L':

Lower triangle of A is stored.

N

an integer. The order of the matrix A. N >= 0.

A

a big.matrix, dimension (LDA,N).

LDA

an integer. Dimension of the array A. LDA >= max(1,N).

Value

updates the big matrix A with the result, INFO is an integer

= 0:

successful exit

< 0:

if INFO = -i, the i-th argument had an illegal value

> 0:

if INFO = i, the leading minor of order i is not positive definite, and the factorization could not be completed.

Terms laying out of the computed triangle should be discarded.

Examples

set.seed(4669)
A = matrix(rnorm(16),4)
B = as.big.matrix(A %*% t(A))
C = A %*% t(A)
chol(C)
dpotrf(UPLO='U', N=4, A=B, LDA=4)
D <- B[,]
D[lower.tri(D)]<-0
D
D-chol(C)
t(D)%*%D-C

#' # The big.matrix file backings will be deleted when garbage collected.
rm(A,B,C,D)
gc()

bigalgebra documentation built on Sept. 30, 2024, 9:42 a.m.