1
/* -- translated by f2c (version 20050501).
2
You must link the resulting object file with libf2c:
3
on Microsoft Windows system, link with libf2c.lib;
4
on Linux or Unix systems, link with .../path/to/libf2c.a -lm
5
or, if you install libf2c.a in a standard place, with -lf2c -lm
6
-- in that order, at the end of the command line, as in
8
Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
10
http://www.netlib.org/f2c/libf2c.zip
14
#include "arpack_internal.h"
17
doublereal igraphdnrm2_(integer *n, doublereal *x, integer *incx)
19
/* System generated locals */
21
doublereal ret_val, d__1;
23
/* Builtin functions */
24
double sqrt(doublereal);
28
static doublereal ssq, norm, scale, absxi;
30
/* .. Scalar Arguments .. */
31
/* .. Array Arguments .. */
34
/* DNRM2 returns the euclidean norm of a vector via the function */
37
/* DNRM2 := sqrt( x'*x ) */
41
/* -- This version written on 25-October-1982. */
42
/* Modified on 14-October-1993 to inline the call to DLASSQ. */
43
/* Sven Hammarling, Nag Ltd. */
46
/* .. Parameters .. */
47
/* .. Local Scalars .. */
48
/* .. Intrinsic Functions .. */
50
/* .. Executable Statements .. */
51
/* Parameter adjustments */
55
if (*n < 1 || *incx < 1) {
62
/* The following loop is equivalent to this call to the LAPACK */
63
/* auxiliary routine: */
64
/* CALL DLASSQ( N, X, INCX, SCALE, SSQ ) */
66
i__1 = (*n - 1) * *incx + 1;
68
for (ix = 1; i__2 < 0 ? ix >= i__1 : ix <= i__1; ix += i__2) {
70
absxi = (d__1 = x[ix], abs(d__1));
72
/* Computing 2nd power */
74
ssq = ssq * (d__1 * d__1) + 1.;
77
/* Computing 2nd power */
84
norm = scale * sqrt(ssq);