contrib
contact
clib
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
}
arith.h
EPS
#define EPS
Definition:
arith.h:15
sqrt
double sqrt()
REAL
double REAL
Definition:
arith.h:25
MATRIX
VECTOR MATRIX[MAX]
Definition:
arith.h:27
snrm2r
REAL snrm2r(int n, MATRIX sx, int isx, int jsx, int incx)
Definition:
snrm2r.c:7
n
GLfloat n[6][3]
Definition:
cube.c:15
euslisp
Author(s): Toshihiro Matsui
autogenerated on Thu Jun 15 2023 02:06:43