1
SUBROUTINE MB01SD( JOBS, M, N, A, LDA, R, C )
3
C RELEASE 3.0, WGS COPYRIGHT 1998.
7
C To scale a general M-by-N matrix A using the row and column
8
C scaling factors in the vectors R and C.
15
C Specifies the scaling operation to be done, as follows:
16
C = 'R': row scaling, i.e., A will be premultiplied
18
C = 'C': column scaling, i.e., A will be postmultiplied
20
C = 'B': both row and column scaling, i.e., A will be
21
C replaced by diag(R) * A * diag(C).
23
C Input/Output Parameters
26
C The number of rows of the matrix A. M >= 0.
29
C The number of columns of the matrix A. N >= 0.
31
C A (input/output) DOUBLE PRECISION array, dimension (LDA,N)
32
C On entry, the M-by-N matrix A.
33
C On exit, the scaled matrix. See JOBS for the form of the
37
C The leading dimension of the array A. LDA >= max(1,M).
39
C R (input) DOUBLE PRECISION array, dimension (M)
40
C The row scale factors for A.
41
C R is not referenced if JOBS = 'C'.
43
C C (input) DOUBLE PRECISION array, dimension (N)
44
C The column scale factors for A.
45
C C is not referenced if JOBS = 'R'.
50
C A. Varga, German Aerospace Center,
51
C DLR Oberpfaffenhofen, April 1998.
52
C Based on the RASP routine DMSCAL.
54
C ******************************************************************
56
C .. Scalar Arguments ..
59
C .. Array Arguments ..
60
DOUBLE PRECISION A(LDA,*), C(*), R(*)
64
C .. External Functions ..
67
C .. Executable Statements ..
69
C Quick return if possible.
71
IF( M.EQ.0 .OR. N.EQ.0 )
74
IF( LSAME( JOBS, 'C' ) ) THEN
76
C Column scaling, no row scaling.
84
ELSE IF( LSAME( JOBS, 'R' ) ) THEN
86
C Row scaling, no column scaling.
93
ELSE IF( LSAME( JOBS, 'B' ) ) THEN
95
C Row and column scaling.
100
A(I,J) = CJ*R(I)*A(I,J)
106
C *** Last line of MB01SD ***