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

dasum.c

Go to the documentation of this file.
00001 /* DASUM.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 doublereal __IMPEXP__ dasum_(n, dx, incx)
00009 integer *n;
00010 doublereal *dx;
00011 integer *incx;
00012 {
00013     /* System generated locals */
00014     integer i__1, i__2;
00015     doublereal ret_val, d__1, d__2, d__3, d__4, d__5, d__6;
00016 
00017     /* Local variables */
00018     static integer i, m;
00019     static doublereal dtemp;
00020     static integer nincx, mp1;
00021 
00022 
00023 /*     takes the sum of the absolute values. */
00024 /*     jack dongarra, linpack, 3/11/78. */
00025 
00026 
00027     /* Parameter adjustments */
00028     --dx;
00029 
00030     /* Function Body */
00031     ret_val = 0.;
00032     dtemp = 0.;
00033     if (*n <= 0) {
00034         return ret_val;
00035     }
00036     if (*incx == 1) {
00037         goto L20;
00038     }
00039 
00040 /*        code for increment not equal to 1 */
00041 
00042     nincx = *n * *incx;
00043     i__1 = nincx;
00044     i__2 = *incx;
00045     for (i = 1; i__2 < 0 ? i >= i__1 : i <= i__1; i += i__2) {
00046         dtemp += (d__1 = dx[i], abs(d__1));
00047 /* L10: */
00048     }
00049     ret_val = dtemp;
00050     return ret_val;
00051 
00052 /*        code for increment equal to 1 */
00053 
00054 
00055 /*        clean-up loop */
00056 
00057 L20:
00058     m = *n % 6;
00059     if (m == 0) {
00060         goto L40;
00061     }
00062     i__2 = m;
00063     for (i = 1; i <= i__2; ++i) {
00064         dtemp += (d__1 = dx[i], abs(d__1));
00065 /* L30: */
00066     }
00067     if (*n < 6) {
00068         goto L60;
00069     }
00070 L40:
00071     mp1 = m + 1;
00072     i__2 = *n;
00073     for (i = mp1; i <= i__2; i += 6) {
00074         dtemp = dtemp + (d__1 = dx[i], abs(d__1)) + (d__2 = dx[i + 1], abs(
00075                 d__2)) + (d__3 = dx[i + 2], abs(d__3)) + (d__4 = dx[i + 3], 
00076                 abs(d__4)) + (d__5 = dx[i + 4], abs(d__5)) + (d__6 = dx[i + 5]
00077                 , abs(d__6));
00078 /* L50: */
00079     }
00080 L60:
00081     ret_val = dtemp;
00082     return ret_val;
00083 } /* dasum_ */
00084 

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