saxpy.c
Go to the documentation of this file.
00001 /* constant times a vector plus a vector.
00002    uses unrolled loop for increments equal to one.
00003    Ver.1.0, May,26,1988.                          */
00004 
00005 #include "arith.h"
00006 
00007 saxpy(n,sa,sx,isx,jsx,incx,sy,isy,jsy,incy)
00008 int n,isx,jsx,incx,isy,jsy,incy;
00009 REAL sa;
00010 MATRIX sx,sy;
00011 {
00012     int i,m;
00013 
00014     if(n <= 0)
00015         return;
00016     if(sa == 0.0e0)
00017         return;
00018 
00019     /* code for both increments equal to 1 */
00020 
00021     /* clean-up loop */
00022 
00023     m=n%4;
00024     if(m != 0){
00025         for(i=0; i<m; i++)
00026             sy[isy+i][jsy] += sa*sx[isx+i][jsx];
00027         if(n < 4)
00028             return;
00029     }
00030 
00031     for(i=m; i<n; i += 4){
00032         sy[isy+i][jsy] += sa*sx[isx+i][jsx];
00033         sy[isy+i+1][jsy] += sa*sx[isx+i+1][jsx];
00034         sy[isy+i+2][jsy] += sa*sx[isx+i+2][jsx];
00035         sy[isy+i+3][jsy] += sa*sx[isx+i+3][jsx];
00036     }
00037 }
00038 
00039 
00040 
00041 


euslisp
Author(s): Toshihiro Matsui
autogenerated on Thu Mar 9 2017 04:57:50