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


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:34