snrm2r.c
Go to the documentation of this file.
1 /* Euclidean norm of the n-vector stored in sx()
2  with storage -- row vector version
3  Ver.1.0, July,1,1988. */
4 
5 #include "arith.h"
6 
7 REAL snrm2r(n,sx,isx,jsx,incx)
8 int n,isx,jsx,incx;
9 MATRIX sx;
10 {
11  int i;
12  REAL sum,enorm;
13 
14  if(n <=0)
15  return(0.0);
16 
17  sum=0.0e0;
18 
19  for(i=0; i<n; i += incx){
20  sum += sx[isx][jsx+i]*sx[isx][jsx+i];
21  }
22 
23  enorm= sqrt(fabs(sum));
24 
25  if(enorm < EPS)
26  enorm= 0.0e0;
27 
28  return(enorm);
29 }
GLfloat n[6][3]
Definition: cube.c:15
double REAL
Definition: arith.h:25
REAL snrm2r(int n, MATRIX sx, int isx, int jsx, int incx)
Definition: snrm2r.c:7
double sqrt()
VECTOR MATRIX[MAX]
Definition: arith.h:27
#define EPS
Definition: arith.h:15


euslisp
Author(s): Toshihiro Matsui
autogenerated on Thu Jun 6 2019 20:00:44