00001 /* Euclidean norm of the n-vector stored in sx() 00002 with storage -- row vector version 00003 Ver.1.0, July,1,1988. */ 00004 00005 #include "arith.h" 00006 00007 REAL snrm2r(n,sx,isx,jsx,incx) 00008 int n,isx,jsx,incx; 00009 MATRIX sx; 00010 { 00011 int i; 00012 REAL sum,enorm; 00013 00014 if(n <=0) 00015 return(0.0); 00016 00017 sum=0.0e0; 00018 00019 for(i=0; i<n; i += incx){ 00020 sum += sx[isx][jsx+i]*sx[isx][jsx+i]; 00021 } 00022 00023 enorm= sqrt(fabs(sum)); 00024 00025 if(enorm < EPS) 00026 enorm= 0.0e0; 00027 00028 return(enorm); 00029 }