LAPACK 3.3.0

dlarscl2.f

Go to the documentation of this file.
00001       SUBROUTINE DLARSCL2 ( M, N, D, X, LDX )
00002 *
00003 *     -- LAPACK routine (version 3.2.2)                               --
00004 *     -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and --
00005 *     -- Jason Riedy of Univ. of California Berkeley.                 --
00006 *     -- June 2010                                                    --
00007 *
00008 *     -- LAPACK is a software package provided by Univ. of Tennessee, --
00009 *     -- Univ. of California Berkeley and NAG Ltd.                    --
00010 *
00011       IMPLICIT NONE
00012 *     ..
00013 *     .. Scalar Arguments ..
00014       INTEGER            M, N, LDX
00015 *     ..
00016 *     .. Array Arguments ..
00017       DOUBLE PRECISION   D( * ), X( LDX, * )
00018 *     ..
00019 *
00020 *  Purpose
00021 *  =======
00022 *
00023 *  DLARSCL2 performs a reciprocal diagonal scaling on an vector:
00024 *    x <-- inv(D) * x
00025 *  where the diagonal matrix D is stored as a vector.
00026 *
00027 *  Eventually to be replaced by BLAS_dge_diag_scale in the new BLAS
00028 *  standard.
00029 *
00030 *  Arguments
00031 *  =========
00032 *
00033 *     M       (input) INTEGER
00034 *     The number of rows of D and X. M >= 0.
00035 *
00036 *     N       (input) INTEGER
00037 *     The number of columns of D and X. N >= 0.
00038 *
00039 *     D       (input) DOUBLE PRECISION array, dimension (M)
00040 *     Diagonal matrix D, stored as a vector of length M.
00041 *
00042 *     X       (input/output) DOUBLE PRECISION array, dimension (LDX,N)
00043 *     On entry, the vector X to be scaled by D.
00044 *     On exit, the scaled vector.
00045 *
00046 *     LDX     (input) INTEGER
00047 *     The leading dimension of the vector X. LDX >= 0.
00048 *
00049 *  =====================================================================
00050 *
00051 *     .. Local Scalars ..
00052       INTEGER            I, J
00053 *     ..
00054 *     .. Executable Statements ..
00055 *
00056       DO J = 1, N
00057          DO I = 1, M
00058             X( I, J ) = X( I, J ) / D( I )
00059          END DO
00060       END DO
00061 
00062       RETURN
00063       END
 All Files Functions