~ubuntu-branches/ubuntu/lucid/igraph/lucid

« back to all changes in this revision

Viewing changes to src/blas/dscal.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathieu Malaterre
  • Date: 2009-11-16 18:12:42 UTC
  • Revision ID: james.westby@ubuntu.com-20091116181242-mzv9p5fz9uj57xd1
Tags: upstream-0.5.3
ImportĀ upstreamĀ versionĀ 0.5.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
7
                cc *.o -lf2c -lm
 
8
        Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
 
9
 
 
10
                http://www.netlib.org/f2c/libf2c.zip
 
11
*/
 
12
 
 
13
#include "config.h"
 
14
#include "arpack_internal.h"
 
15
#include "f2c.h"
 
16
 
 
17
/* Subroutine */ int igraphdscal_(integer *n, doublereal *da, doublereal *dx, 
 
18
        integer *incx)
 
19
{
 
20
    /* System generated locals */
 
21
    integer i__1, i__2;
 
22
 
 
23
    /* Local variables */
 
24
    static integer i__, m, mp1, nincx;
 
25
 
 
26
 
 
27
/*     scales a vector by a constant. */
 
28
/*     uses unrolled loops for increment equal to one. */
 
29
/*     jack dongarra, linpack, 3/11/78. */
 
30
/*     modified 3/93 to return if incx .le. 0. */
 
31
/*     modified 12/3/93, array(1) declarations changed to array(*) */
 
32
 
 
33
 
 
34
    /* Parameter adjustments */
 
35
    --dx;
 
36
 
 
37
    /* Function Body */
 
38
    if (*n <= 0 || *incx <= 0) {
 
39
        return 0;
 
40
    }
 
41
    if (*incx == 1) {
 
42
        goto L20;
 
43
    }
 
44
 
 
45
/*        code for increment not equal to 1 */
 
46
 
 
47
    nincx = *n * *incx;
 
48
    i__1 = nincx;
 
49
    i__2 = *incx;
 
50
    for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) {
 
51
        dx[i__] = *da * dx[i__];
 
52
/* L10: */
 
53
    }
 
54
    return 0;
 
55
 
 
56
/*        code for increment equal to 1 */
 
57
 
 
58
 
 
59
/*        clean-up loop */
 
60
 
 
61
L20:
 
62
    m = *n % 5;
 
63
    if (m == 0) {
 
64
        goto L40;
 
65
    }
 
66
    i__2 = m;
 
67
    for (i__ = 1; i__ <= i__2; ++i__) {
 
68
        dx[i__] = *da * dx[i__];
 
69
/* L30: */
 
70
    }
 
71
    if (*n < 5) {
 
72
        return 0;
 
73
    }
 
74
L40:
 
75
    mp1 = m + 1;
 
76
    i__2 = *n;
 
77
    for (i__ = mp1; i__ <= i__2; i__ += 5) {
 
78
        dx[i__] = *da * dx[i__];
 
79
        dx[i__ + 1] = *da * dx[i__ + 1];
 
80
        dx[i__ + 2] = *da * dx[i__ + 2];
 
81
        dx[i__ + 3] = *da * dx[i__ + 3];
 
82
        dx[i__ + 4] = *da * dx[i__ + 4];
 
83
/* L50: */
 
84
    }
 
85
    return 0;
 
86
} /* igraphdscal_ */
 
87