00001 /* dlascl2.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 dlascl2_(integer *m, integer *n, doublereal *d__, 00017 doublereal *x, integer *ldx) 00018 { 00019 /* System generated locals */ 00020 integer x_dim1, x_offset, i__1, i__2; 00021 00022 /* Local variables */ 00023 integer i__, j; 00024 00025 00026 /* -- LAPACK routine (version 3.2.1) -- */ 00027 /* -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- */ 00028 /* -- Jason Riedy of Univ. of California Berkeley. -- */ 00029 /* -- April 2009 -- */ 00030 00031 /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */ 00032 /* -- Univ. of California Berkeley and NAG Ltd. -- */ 00033 00034 /* .. */ 00035 /* .. Scalar Arguments .. */ 00036 /* .. */ 00037 /* .. Array Arguments .. */ 00038 /* .. */ 00039 00040 /* Purpose */ 00041 /* ======= */ 00042 00043 /* DLASCL2 performs a diagonal scaling on a vector: */ 00044 /* x <-- D * x */ 00045 /* where the diagonal matrix D is stored as a vector. */ 00046 00047 /* Eventually to be replaced by BLAS_dge_diag_scale in the new BLAS */ 00048 /* standard. */ 00049 00050 /* Arguments */ 00051 /* ========= */ 00052 00053 /* M (input) INTEGER */ 00054 /* The number of rows of D and X. M >= 0. */ 00055 00056 /* N (input) INTEGER */ 00057 /* The number of columns of D and X. N >= 0. */ 00058 00059 /* D (input) DOUBLE PRECISION array, length M */ 00060 /* Diagonal matrix D, stored as a vector of length M. */ 00061 00062 /* X (input/output) DOUBLE PRECISION array, dimension (LDX,N) */ 00063 /* On entry, the vector X to be scaled by D. */ 00064 /* On exit, the scaled vector. */ 00065 00066 /* LDX (input) INTEGER */ 00067 /* The leading dimension of the vector X. LDX >= 0. */ 00068 00069 /* ===================================================================== */ 00070 00071 /* .. Local Scalars .. */ 00072 /* .. */ 00073 /* .. Executable Statements .. */ 00074 00075 /* Parameter adjustments */ 00076 --d__; 00077 x_dim1 = *ldx; 00078 x_offset = 1 + x_dim1; 00079 x -= x_offset; 00080 00081 /* Function Body */ 00082 i__1 = *n; 00083 for (j = 1; j <= i__1; ++j) { 00084 i__2 = *m; 00085 for (i__ = 1; i__ <= i__2; ++i__) { 00086 x[i__ + j * x_dim1] *= d__[i__]; 00087 } 00088 } 00089 return 0; 00090 } /* dlascl2_ */