zlarscl2.c
Go to the documentation of this file.
00001 /* zlarscl2.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Subroutine */ int zlarscl2_(integer *m, integer *n, doublereal *d__, 
00017         doublecomplex *x, integer *ldx)
00018 {
00019     /* System generated locals */
00020     integer x_dim1, x_offset, i__1, i__2, i__3, i__4, i__5;
00021     doublecomplex z__1;
00022 
00023     /* Local variables */
00024     integer i__, j;
00025 
00026 
00027 /*     -- LAPACK routine (version 3.2.1)                               -- */
00028 /*     -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- */
00029 /*     -- Jason Riedy of Univ. of California Berkeley.                 -- */
00030 /*     -- April 2009                                                   -- */
00031 
00032 /*     -- LAPACK is a software package provided by Univ. of Tennessee, -- */
00033 /*     -- Univ. of California Berkeley and NAG Ltd.                    -- */
00034 
00035 /*     .. */
00036 /*     .. Scalar Arguments .. */
00037 /*     .. */
00038 /*     .. Array Arguments .. */
00039 /*     .. */
00040 
00041 /*  Purpose */
00042 /*  ======= */
00043 
00044 /*  ZLARSCL2 performs a reciprocal diagonal scaling on an vector: */
00045 /*    x <-- inv(D) * x */
00046 /*  where the DOUBLE PRECISION diagonal matrix D is stored as a vector. */
00047 
00048 /*  Eventually to be replaced by BLAS_zge_diag_scale in the new BLAS */
00049 /*  standard. */
00050 
00051 /*  Arguments */
00052 /*  ========= */
00053 
00054 /*     M       (input) INTEGER */
00055 /*     The number of rows of D and X. M >= 0. */
00056 
00057 /*     N       (input) INTEGER */
00058 /*     The number of columns of D and X. N >= 0. */
00059 
00060 /*     D       (input) DOUBLE PRECISION array, length M */
00061 /*     Diagonal matrix D, stored as a vector of length M. */
00062 
00063 /*     X       (input/output) COMPLEX*16 array, dimension (LDX,N) */
00064 /*     On entry, the vector X to be scaled by D. */
00065 /*     On exit, the scaled vector. */
00066 
00067 /*     LDX     (input) INTEGER */
00068 /*     The leading dimension of the vector X. LDX >= 0. */
00069 
00070 /*  ===================================================================== */
00071 
00072 /*     .. Local Scalars .. */
00073 /*     .. */
00074 /*     .. Executable Statements .. */
00075 
00076     /* Parameter adjustments */
00077     --d__;
00078     x_dim1 = *ldx;
00079     x_offset = 1 + x_dim1;
00080     x -= x_offset;
00081 
00082     /* Function Body */
00083     i__1 = *n;
00084     for (j = 1; j <= i__1; ++j) {
00085         i__2 = *m;
00086         for (i__ = 1; i__ <= i__2; ++i__) {
00087             i__3 = i__ + j * x_dim1;
00088             i__4 = i__ + j * x_dim1;
00089             i__5 = i__;
00090             z__1.r = x[i__4].r / d__[i__5], z__1.i = x[i__4].i / d__[i__5];
00091             x[i__3].r = z__1.r, x[i__3].i = z__1.i;
00092         }
00093     }
00094     return 0;
00095 } /* zlarscl2_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:41