zdscal.c
Go to the documentation of this file.
00001 /* zdscal.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 zdscal_(integer *n, doublereal *da, doublecomplex *zx, 
00017         integer *incx)
00018 {
00019     /* System generated locals */
00020     integer i__1, i__2, i__3;
00021     doublecomplex z__1, z__2;
00022 
00023     /* Local variables */
00024     integer i__, ix;
00025 
00026 /*     .. Scalar Arguments .. */
00027 /*     .. */
00028 /*     .. Array Arguments .. */
00029 /*     .. */
00030 
00031 /*  Purpose */
00032 /*  ======= */
00033 
00034 /*     scales a vector by a constant. */
00035 /*     jack dongarra, 3/11/78. */
00036 /*     modified 3/93 to return if incx .le. 0. */
00037 /*     modified 12/3/93, array(1) declarations changed to array(*) */
00038 
00039 
00040 /*     .. Local Scalars .. */
00041 /*     .. */
00042 /*     .. Intrinsic Functions .. */
00043 /*     .. */
00044     /* Parameter adjustments */
00045     --zx;
00046 
00047     /* Function Body */
00048     if (*n <= 0 || *incx <= 0) {
00049         return 0;
00050     }
00051     if (*incx == 1) {
00052         goto L20;
00053     }
00054 
00055 /*        code for increment not equal to 1 */
00056 
00057     ix = 1;
00058     i__1 = *n;
00059     for (i__ = 1; i__ <= i__1; ++i__) {
00060         i__2 = ix;
00061         z__2.r = *da, z__2.i = 0.;
00062         i__3 = ix;
00063         z__1.r = z__2.r * zx[i__3].r - z__2.i * zx[i__3].i, z__1.i = z__2.r * 
00064                 zx[i__3].i + z__2.i * zx[i__3].r;
00065         zx[i__2].r = z__1.r, zx[i__2].i = z__1.i;
00066         ix += *incx;
00067 /* L10: */
00068     }
00069     return 0;
00070 
00071 /*        code for increment equal to 1 */
00072 
00073 L20:
00074     i__1 = *n;
00075     for (i__ = 1; i__ <= i__1; ++i__) {
00076         i__2 = i__;
00077         z__2.r = *da, z__2.i = 0.;
00078         i__3 = i__;
00079         z__1.r = z__2.r * zx[i__3].r - z__2.i * zx[i__3].i, z__1.i = z__2.r * 
00080                 zx[i__3].i + z__2.i * zx[i__3].r;
00081         zx[i__2].r = z__1.r, zx[i__2].i = z__1.i;
00082 /* L30: */
00083     }
00084     return 0;
00085 } /* zdscal_ */


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