3
* \brief Computes row and column scalings
4
6
* -- SuperLU routine (version 2.0) --
5
7
* Univ. of California Berkeley, Xerox Palo Alto Research Center,
6
8
* and Lawrence Berkeley National Lab.
11
* Modified from LAPACK routine SGEEQU
11
15
* File name: sgsequ.c
12
16
* History: Modified from LAPACK routine SGEEQU
19
#include "slu_sdefs.h"
29
* SGSEQU computes row and column scalings intended to equilibrate an
30
* M-by-N sparse matrix A and reduce its condition number. R returns the row
31
* scale factors and C the column scale factors, chosen to try to make
32
* the largest element in each row and column of the matrix B with
33
* elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.
35
* R(i) and C(j) are restricted to be between SMLNUM = smallest safe
36
* number and BIGNUM = largest safe number. Use of these scaling
37
* factors is not guaranteed to reduce the condition number of A but
38
* works well in practice.
40
* See supermatrix.h for the definition of 'SuperMatrix' structure.
45
* A (input) SuperMatrix*
46
* The matrix of dimension (A->nrow, A->ncol) whose equilibration
47
* factors are to be computed. The type of A can be:
48
* Stype = SLU_NC; Dtype = SLU_S; Mtype = SLU_GE.
50
* R (output) float*, size A->nrow
51
* If INFO = 0 or INFO > M, R contains the row scale factors
54
* C (output) float*, size A->ncol
55
* If INFO = 0, C contains the column scale factors for A.
57
* ROWCND (output) float*
58
* If INFO = 0 or INFO > M, ROWCND contains the ratio of the
59
* smallest R(i) to the largest R(i). If ROWCND >= 0.1 and
60
* AMAX is neither too large nor too small, it is not worth
63
* COLCND (output) float*
64
* If INFO = 0, COLCND contains the ratio of the smallest
65
* C(i) to the largest C(i). If COLCND >= 0.1, it is not
68
* AMAX (output) float*
69
* Absolute value of largest matrix element. If AMAX is very
70
* close to overflow or very close to underflow, the matrix
74
* = 0: successful exit
75
* < 0: if INFO = -i, the i-th argument had an illegal value
76
* > 0: if INFO = i, and i is
77
* <= A->nrow: the i-th row of A is exactly zero
78
* > A->ncol: the (i-M)-th column of A is exactly zero
80
* =====================================================================
19
84
sgsequ(SuperMatrix *A, float *r, float *c, float *rowcnd,
20
85
float *colcnd, float *amax, int *info)
26
SGSEQU computes row and column scalings intended to equilibrate an
27
M-by-N sparse matrix A and reduce its condition number. R returns the row
28
scale factors and C the column scale factors, chosen to try to make
29
the largest element in each row and column of the matrix B with
30
elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.
32
R(i) and C(j) are restricted to be between SMLNUM = smallest safe
33
number and BIGNUM = largest safe number. Use of these scaling
34
factors is not guaranteed to reduce the condition number of A but
35
works well in practice.
37
See supermatrix.h for the definition of 'SuperMatrix' structure.
42
A (input) SuperMatrix*
43
The matrix of dimension (A->nrow, A->ncol) whose equilibration
44
factors are to be computed. The type of A can be:
45
Stype = SLU_NC; Dtype = SLU_S; Mtype = SLU_GE.
47
R (output) float*, size A->nrow
48
If INFO = 0 or INFO > M, R contains the row scale factors
51
C (output) float*, size A->ncol
52
If INFO = 0, C contains the column scale factors for A.
54
ROWCND (output) float*
55
If INFO = 0 or INFO > M, ROWCND contains the ratio of the
56
smallest R(i) to the largest R(i). If ROWCND >= 0.1 and
57
AMAX is neither too large nor too small, it is not worth
60
COLCND (output) float*
61
If INFO = 0, COLCND contains the ratio of the smallest
62
C(i) to the largest C(i). If COLCND >= 0.1, it is not
66
Absolute value of largest matrix element. If AMAX is very
67
close to overflow or very close to underflow, the matrix
72
< 0: if INFO = -i, the i-th argument had an illegal value
73
> 0: if INFO = i, and i is
74
<= A->nrow: the i-th row of A is exactly zero
75
> A->ncol: the (i-M)-th column of A is exactly zero
77
=====================================================================
80
89
/* Local variables */