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

« back to all changes in this revision

Viewing changes to src/blas/dcopy.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 igraphdcopy_(integer *n, doublereal *dx, integer *incx, 
 
18
        doublereal *dy, integer *incy)
 
19
{
 
20
    /* System generated locals */
 
21
    integer i__1;
 
22
 
 
23
    /* Local variables */
 
24
    static integer i__, m, ix, iy, mp1;
 
25
 
 
26
 
 
27
/*     copies a vector, x, to a vector, y. */
 
28
/*     uses unrolled loops for increments equal to one. */
 
29
/*     jack dongarra, linpack, 3/11/78. */
 
30
/*     modified 12/3/93, array(1) declarations changed to array(*) */
 
31
 
 
32
 
 
33
    /* Parameter adjustments */
 
34
    --dy;
 
35
    --dx;
 
36
 
 
37
    /* Function Body */
 
38
    if (*n <= 0) {
 
39
        return 0;
 
40
    }
 
41
    if (*incx == 1 && *incy == 1) {
 
42
        goto L20;
 
43
    }
 
44
 
 
45
/*        code for unequal increments or equal increments */
 
46
/*          not equal to 1 */
 
47
 
 
48
    ix = 1;
 
49
    iy = 1;
 
50
    if (*incx < 0) {
 
51
        ix = (-(*n) + 1) * *incx + 1;
 
52
    }
 
53
    if (*incy < 0) {
 
54
        iy = (-(*n) + 1) * *incy + 1;
 
55
    }
 
56
    i__1 = *n;
 
57
    for (i__ = 1; i__ <= i__1; ++i__) {
 
58
        dy[iy] = dx[ix];
 
59
        ix += *incx;
 
60
        iy += *incy;
 
61
/* L10: */
 
62
    }
 
63
    return 0;
 
64
 
 
65
/*        code for both increments equal to 1 */
 
66
 
 
67
 
 
68
/*        clean-up loop */
 
69
 
 
70
L20:
 
71
    m = *n % 7;
 
72
    if (m == 0) {
 
73
        goto L40;
 
74
    }
 
75
    i__1 = m;
 
76
    for (i__ = 1; i__ <= i__1; ++i__) {
 
77
        dy[i__] = dx[i__];
 
78
/* L30: */
 
79
    }
 
80
    if (*n < 7) {
 
81
        return 0;
 
82
    }
 
83
L40:
 
84
    mp1 = m + 1;
 
85
    i__1 = *n;
 
86
    for (i__ = mp1; i__ <= i__1; i__ += 7) {
 
87
        dy[i__] = dx[i__];
 
88
        dy[i__ + 1] = dx[i__ + 1];
 
89
        dy[i__ + 2] = dx[i__ + 2];
 
90
        dy[i__ + 3] = dx[i__ + 3];
 
91
        dy[i__ + 4] = dx[i__ + 4];
 
92
        dy[i__ + 5] = dx[i__ + 5];
 
93
        dy[i__ + 6] = dx[i__ + 6];
 
94
/* L50: */
 
95
    }
 
96
    return 0;
 
97
} /* igraphdcopy_ */
 
98