Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

dscal.c

Go to the documentation of this file.
00001 /* DSCAL.F -- translated by f2c (version 19941215).
00002    You must link the resulting object file with the libraries:
00003         -lf2c -lm   (in that order)
00004 */
00005 
00006 #include "f2c.h"
00007 #include "cblasimpexp.h"
00008 
00009 /* Subroutine */ int __IMPEXP__ dscal_(n, da, dx, incx)
00010 integer *n;
00011 doublereal *da, *dx;
00012 integer *incx;
00013 {
00014     /* System generated locals */
00015     integer i__1, i__2;
00016 
00017     /* Local variables */
00018     static integer i, m, nincx, mp1;
00019 
00020 
00021 /*     scales a vector by a constant. */
00022 /*     uses unrolled loops for increment equal to one. */
00023 /*     jack dongarra, linpack, 3/11/78. */
00024 
00025 
00026     /* Parameter adjustments */
00027     --dx;
00028 
00029     /* Function Body */
00030     if (*n <= 0) {
00031         return 0;
00032     }
00033     if (*incx == 1) {
00034         goto L20;
00035     }
00036 
00037 /*        code for increment not equal to 1 */
00038 
00039     nincx = *n * *incx;
00040     i__1 = nincx;
00041     i__2 = *incx;
00042     for (i = 1; i__2 < 0 ? i >= i__1 : i <= i__1; i += i__2) {
00043         dx[i] = *da * dx[i];
00044 /* L10: */
00045     }
00046     return 0;
00047 
00048 /*        code for increment equal to 1 */
00049 
00050 
00051 /*        clean-up loop */
00052 
00053 L20:
00054     m = *n % 5;
00055     if (m == 0) {
00056         goto L40;
00057     }
00058     i__2 = m;
00059     for (i = 1; i <= i__2; ++i) {
00060         dx[i] = *da * dx[i];
00061 /* L30: */
00062     }
00063     if (*n < 5) {
00064         return 0;
00065     }
00066 L40:
00067     mp1 = m + 1;
00068     i__2 = *n;
00069     for (i = mp1; i <= i__2; i += 5) {
00070         dx[i] = *da * dx[i];
00071         dx[i + 1] = *da * dx[i + 1];
00072         dx[i + 2] = *da * dx[i + 2];
00073         dx[i + 3] = *da * dx[i + 3];
00074         dx[i + 4] = *da * dx[i + 4];
00075 /* L50: */
00076     }
00077     return 0;
00078 } /* dscal_ */
00079 

Generated on Wed Sep 5 12:54:20 2007 for DSACSS Operational Code by  doxygen 1.3.9.1