01:       SUBROUTINE DLARSCL2 ( M, N, D, X, LDX )
02: *
03: *     -- LAPACK routine (version 3.2)                                 --
04: *     -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and --
05: *     -- Jason Riedy of Univ. of California Berkeley.                 --
06: *     -- November 2008                                                --
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:       DOUBLE PRECISION   D( * ), X( LDX, * )
18: *     ..
19: *
20: *  Purpose
21: *  =======
22: *
23: *  DLARSCL2 performs a reciprocal diagonal scaling on an vector:
24: *    x <-- inv(D) * x
25: *  where the diagonal matrix D is stored as a vector.
26: *
27: *  Eventually to be replaced by BLAS_sge_diag_scale in the new BLAS
28: *  standard.
29: *
30: *  Arguments
31: *  =========
32: *
33: *  N      (input) INTEGER
34: *         The size of the vectors X and D.
35: *
36: *  D      (input) DOUBLE PRECISION array, length N
37: *         Diagonal matrix D, stored as a vector of length N.
38: *
39: *  X      (input/output) DOUBLE PRECISION array, length N
40: *         On entry, the vector X to be scaled by D.
41: *         On exit, the scaled vector.
42: *     ..
43: *     .. Local Scalars ..
44:       INTEGER            I, J
45: *     ..
46: *     .. Executable Statements ..
47: *
48:       DO J = 1, N
49:          DO I = 1, M
50:             X(I,J) = X(I,J) / D(I)
51:          END DO
52:       END DO
53: *
54:       RETURN
55:       END
56: