01:       SUBROUTINE CLARSCL2 ( M, N, D, X, LDX )
02: *
03: *     -- LAPACK routine (version 3.2.1)                               --
04: *     -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and --
05: *     -- Jason Riedy of Univ. of California Berkeley.                 --
06: *     -- April 2009                                                   --
07: *
08: *     -- LAPACK is a software package provided by Univ. of Tennessee, --
09: *     -- Univ. of California Berkeley and NAG Ltd.                    --
10: *
11:       IMPLICIT NONE
12: *     ..
13: *     .. Scalar Arguments ..
14:       INTEGER            M, N, LDX
15: *     ..
16: *     .. Array Arguments ..
17:       COMPLEX            X( LDX, * )
18:       REAL               D( * )
19: *     ..
20: *
21: *  Purpose
22: *  =======
23: *
24: *  CLARSCL2 performs a reciprocal diagonal scaling on an vector:
25: *    x <-- inv(D) * x
26: *  where the REAL diagonal matrix D is stored as a vector.
27: *
28: *  Eventually to be replaced by BLAS_cge_diag_scale in the new BLAS
29: *  standard.
30: *
31: *  Arguments
32: *  =========
33: *
34: *     M       (input) INTEGER
35: *     The number of rows of D and X. M >= 0.
36: *
37: *     N       (input) INTEGER
38: *     The number of columns of D and X. N >= 0.
39: *
40: *     D       (input) REAL array, length M
41: *     Diagonal matrix D, stored as a vector of length M.
42: *
43: *     X       (input/output) COMPLEX array, dimension (LDX,N)
44: *     On entry, the vector X to be scaled by D.
45: *     On exit, the scaled vector.
46: *
47: *     LDX     (input) INTEGER
48: *     The leading dimension of the vector X. LDX >= 0.
49: *
50: *  =====================================================================
51: *
52: *     .. Local Scalars ..
53:       INTEGER            I, J
54: *     ..
55: *     .. Executable Statements ..
56: *
57:       DO J = 1, N
58:          DO I = 1, M
59:             X( I, J ) = X( I, J ) / D( I )
60:          END DO
61:       END DO
62: 
63:       RETURN
64:       END
65: 
66: