dggglm: dggglm

View source: R/RcppExports.R

dggglmR Documentation

dggglm

Description

Solve the least square problem

Usage

dggglm(A, B, d, NB = 64L)

Arguments

A

A matrix A (dimension n,m)

B

A matrix B (dimension n,p)

d

A vector d. dimension n

NB

An integer indicating an upper bound for the optimal blocksizes. The default is 64.

Details

Solve the following least square problem:

\min_x || B^{-1} (d - A x) ||_2

WORK

(workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK

(input) INTEGER. The dimension of the array WORK. LWORK >= max(1,N+M+P). For optimum performance, LWORK >= M+min(N,P)+max(N,P)*NB, where NB is an upper bound for the optimal blocksizes for DGEQRF, SGERQF, DORMQR and SORMRQ. If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

INFO

(output) INTEGER.

= 0

successful exit.

< 0

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

= 1

the upper triangular factor R associated with A in the generalized QR factorization of the pair (A, B) is singular, so that rank(A) < M; the least squares solution could not be computed.

= 2

the bottom (N-M) by (N-M) part of the upper trapezoidal factor T associated with B in the generalized QR factorization of the pair (A, B) is singular, so that rank( A B ) < N; the least squares solution could not be computed.

Value

A list with components;

x

A vector m. dimension m

y

A vector p. dimension p

info

A status. See details.


okamumu/msrat documentation built on Jan. 17, 2024, 11:55 a.m.