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

« back to all changes in this revision

Viewing changes to src/lapack/dlasy2.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
/* Table of constant values */
 
18
 
 
19
static integer c__4 = 4;
 
20
static integer c__1 = 1;
 
21
static integer c__16 = 16;
 
22
static integer c__0 = 0;
 
23
 
 
24
/* Subroutine */ int igraphdlasy2_(logical *ltranl, logical *ltranr, integer *isgn, 
 
25
        integer *n1, integer *n2, doublereal *tl, integer *ldtl, doublereal *
 
26
        tr, integer *ldtr, doublereal *b, integer *ldb, doublereal *scale, 
 
27
        doublereal *x, integer *ldx, doublereal *xnorm, integer *info)
 
28
{
 
29
    /* Initialized data */
 
30
 
 
31
    static integer locu12[4] = { 3,4,1,2 };
 
32
    static integer locl21[4] = { 2,1,4,3 };
 
33
    static integer locu22[4] = { 4,3,2,1 };
 
34
    static logical xswpiv[4] = { FALSE_,FALSE_,TRUE_,TRUE_ };
 
35
    static logical bswpiv[4] = { FALSE_,TRUE_,FALSE_,TRUE_ };
 
36
 
 
37
    /* System generated locals */
 
38
    integer b_dim1, b_offset, tl_dim1, tl_offset, tr_dim1, tr_offset, x_dim1, 
 
39
            x_offset;
 
40
    doublereal d__1, d__2, d__3, d__4, d__5, d__6, d__7, d__8;
 
41
 
 
42
    /* Local variables */
 
43
    static integer i__, j, k;
 
44
    static doublereal x2[2], l21, u11, u12;
 
45
    static integer ip, jp;
 
46
    static doublereal u22, t16[16]      /* was [4][4] */, gam, bet, eps, sgn, 
 
47
            tmp[4], tau1, btmp[4], smin;
 
48
    static integer ipiv;
 
49
    static doublereal temp;
 
50
    static integer jpiv[4];
 
51
    static doublereal xmax;
 
52
    static integer ipsv, jpsv;
 
53
    static logical bswap;
 
54
    extern /* Subroutine */ int igraphdcopy_(integer *, doublereal *, integer *, 
 
55
            doublereal *, integer *), igraphdswap_(integer *, doublereal *, integer 
 
56
            *, doublereal *, integer *);
 
57
    static logical xswap;
 
58
    extern doublereal igraphdlamch_(char *);
 
59
    extern integer igraphidamax_(integer *, doublereal *, integer *);
 
60
    static doublereal smlnum;
 
61
 
 
62
 
 
63
/*  -- LAPACK auxiliary routine (version 3.0) -- */
 
64
/*     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., */
 
65
/*     Courant Institute, Argonne National Lab, and Rice University */
 
66
/*     October 31, 1992 */
 
67
 
 
68
/*     .. Scalar Arguments .. */
 
69
/*     .. */
 
70
/*     .. Array Arguments .. */
 
71
/*     .. */
 
72
 
 
73
/*  Purpose */
 
74
/*  ======= */
 
75
 
 
76
/*  DLASY2 solves for the N1 by N2 matrix X, 1 <= N1,N2 <= 2, in */
 
77
 
 
78
/*         op(TL)*X + ISGN*X*op(TR) = SCALE*B, */
 
79
 
 
80
/*  where TL is N1 by N1, TR is N2 by N2, B is N1 by N2, and ISGN = 1 or */
 
81
/*  -1.  op(T) = T or T', where T' denotes the transpose of T. */
 
82
 
 
83
/*  Arguments */
 
84
/*  ========= */
 
85
 
 
86
/*  LTRANL  (input) LOGICAL */
 
87
/*          On entry, LTRANL specifies the op(TL): */
 
88
/*             = .FALSE., op(TL) = TL, */
 
89
/*             = .TRUE., op(TL) = TL'. */
 
90
 
 
91
/*  LTRANR  (input) LOGICAL */
 
92
/*          On entry, LTRANR specifies the op(TR): */
 
93
/*            = .FALSE., op(TR) = TR, */
 
94
/*            = .TRUE., op(TR) = TR'. */
 
95
 
 
96
/*  ISGN    (input) INTEGER */
 
97
/*          On entry, ISGN specifies the sign of the equation */
 
98
/*          as described before. ISGN may only be 1 or -1. */
 
99
 
 
100
/*  N1      (input) INTEGER */
 
101
/*          On entry, N1 specifies the order of matrix TL. */
 
102
/*          N1 may only be 0, 1 or 2. */
 
103
 
 
104
/*  N2      (input) INTEGER */
 
105
/*          On entry, N2 specifies the order of matrix TR. */
 
106
/*          N2 may only be 0, 1 or 2. */
 
107
 
 
108
/*  TL      (input) DOUBLE PRECISION array, dimension (LDTL,2) */
 
109
/*          On entry, TL contains an N1 by N1 matrix. */
 
110
 
 
111
/*  LDTL    (input) INTEGER */
 
112
/*          The leading dimension of the matrix TL. LDTL >= max(1,N1). */
 
113
 
 
114
/*  TR      (input) DOUBLE PRECISION array, dimension (LDTR,2) */
 
115
/*          On entry, TR contains an N2 by N2 matrix. */
 
116
 
 
117
/*  LDTR    (input) INTEGER */
 
118
/*          The leading dimension of the matrix TR. LDTR >= max(1,N2). */
 
119
 
 
120
/*  B       (input) DOUBLE PRECISION array, dimension (LDB,2) */
 
121
/*          On entry, the N1 by N2 matrix B contains the right-hand */
 
122
/*          side of the equation. */
 
123
 
 
124
/*  LDB     (input) INTEGER */
 
125
/*          The leading dimension of the matrix B. LDB >= max(1,N1). */
 
126
 
 
127
/*  SCALE   (output) DOUBLE PRECISION */
 
128
/*          On exit, SCALE contains the scale factor. SCALE is chosen */
 
129
/*          less than or equal to 1 to prevent the solution overflowing. */
 
130
 
 
131
/*  X       (output) DOUBLE PRECISION array, dimension (LDX,2) */
 
132
/*          On exit, X contains the N1 by N2 solution. */
 
133
 
 
134
/*  LDX     (input) INTEGER */
 
135
/*          The leading dimension of the matrix X. LDX >= max(1,N1). */
 
136
 
 
137
/*  XNORM   (output) DOUBLE PRECISION */
 
138
/*          On exit, XNORM is the infinity-norm of the solution. */
 
139
 
 
140
/*  INFO    (output) INTEGER */
 
141
/*          On exit, INFO is set to */
 
142
/*             0: successful exit. */
 
143
/*             1: TL and TR have too close eigenvalues, so TL or */
 
144
/*                TR is perturbed to get a nonsingular equation. */
 
145
/*          NOTE: In the interests of speed, this routine does not */
 
146
/*                check the inputs for errors. */
 
147
 
 
148
/* ===================================================================== */
 
149
 
 
150
/*     .. Parameters .. */
 
151
/*     .. */
 
152
/*     .. Local Scalars .. */
 
153
/*     .. */
 
154
/*     .. Local Arrays .. */
 
155
/*     .. */
 
156
/*     .. External Functions .. */
 
157
/*     .. */
 
158
/*     .. External Subroutines .. */
 
159
/*     .. */
 
160
/*     .. Intrinsic Functions .. */
 
161
/*     .. */
 
162
/*     .. Data statements .. */
 
163
    /* Parameter adjustments */
 
164
    tl_dim1 = *ldtl;
 
165
    tl_offset = 1 + tl_dim1;
 
166
    tl -= tl_offset;
 
167
    tr_dim1 = *ldtr;
 
168
    tr_offset = 1 + tr_dim1;
 
169
    tr -= tr_offset;
 
170
    b_dim1 = *ldb;
 
171
    b_offset = 1 + b_dim1;
 
172
    b -= b_offset;
 
173
    x_dim1 = *ldx;
 
174
    x_offset = 1 + x_dim1;
 
175
    x -= x_offset;
 
176
 
 
177
    /* Function Body */
 
178
/*     .. */
 
179
/*     .. Executable Statements .. */
 
180
 
 
181
/*     Do not check the input parameters for errors */
 
182
 
 
183
    *info = 0;
 
184
 
 
185
/*     Quick return if possible */
 
186
 
 
187
    if (*n1 == 0 || *n2 == 0) {
 
188
        return 0;
 
189
    }
 
190
 
 
191
/*     Set constants to control overflow */
 
192
 
 
193
    eps = igraphdlamch_("P");
 
194
    smlnum = igraphdlamch_("S") / eps;
 
195
    sgn = (doublereal) (*isgn);
 
196
 
 
197
    k = *n1 + *n1 + *n2 - 2;
 
198
    switch (k) {
 
199
        case 1:  goto L10;
 
200
        case 2:  goto L20;
 
201
        case 3:  goto L30;
 
202
        case 4:  goto L50;
 
203
    }
 
204
 
 
205
/*     1 by 1: TL11*X + SGN*X*TR11 = B11 */
 
206
 
 
207
L10:
 
208
    tau1 = tl[tl_dim1 + 1] + sgn * tr[tr_dim1 + 1];
 
209
    bet = abs(tau1);
 
210
    if (bet <= smlnum) {
 
211
        tau1 = smlnum;
 
212
        bet = smlnum;
 
213
        *info = 1;
 
214
    }
 
215
 
 
216
    *scale = 1.;
 
217
    gam = (d__1 = b[b_dim1 + 1], abs(d__1));
 
218
    if (smlnum * gam > bet) {
 
219
        *scale = 1. / gam;
 
220
    }
 
221
 
 
222
    x[x_dim1 + 1] = b[b_dim1 + 1] * *scale / tau1;
 
223
    *xnorm = (d__1 = x[x_dim1 + 1], abs(d__1));
 
224
    return 0;
 
225
 
 
226
/*     1 by 2: */
 
227
/*     TL11*[X11 X12] + ISGN*[X11 X12]*op[TR11 TR12]  = [B11 B12] */
 
228
/*                                       [TR21 TR22] */
 
229
 
 
230
L20:
 
231
 
 
232
/* Computing MAX */
 
233
/* Computing MAX */
 
234
    d__7 = (d__1 = tl[tl_dim1 + 1], abs(d__1)), d__8 = (d__2 = tr[tr_dim1 + 1]
 
235
            , abs(d__2)), d__7 = max(d__7,d__8), d__8 = (d__3 = tr[(tr_dim1 <<
 
236
             1) + 1], abs(d__3)), d__7 = max(d__7,d__8), d__8 = (d__4 = tr[
 
237
            tr_dim1 + 2], abs(d__4)), d__7 = max(d__7,d__8), d__8 = (d__5 = 
 
238
            tr[(tr_dim1 << 1) + 2], abs(d__5));
 
239
    d__6 = eps * max(d__7,d__8);
 
240
    smin = max(d__6,smlnum);
 
241
    tmp[0] = tl[tl_dim1 + 1] + sgn * tr[tr_dim1 + 1];
 
242
    tmp[3] = tl[tl_dim1 + 1] + sgn * tr[(tr_dim1 << 1) + 2];
 
243
    if (*ltranr) {
 
244
        tmp[1] = sgn * tr[tr_dim1 + 2];
 
245
        tmp[2] = sgn * tr[(tr_dim1 << 1) + 1];
 
246
    } else {
 
247
        tmp[1] = sgn * tr[(tr_dim1 << 1) + 1];
 
248
        tmp[2] = sgn * tr[tr_dim1 + 2];
 
249
    }
 
250
    btmp[0] = b[b_dim1 + 1];
 
251
    btmp[1] = b[(b_dim1 << 1) + 1];
 
252
    goto L40;
 
253
 
 
254
/*     2 by 1: */
 
255
/*          op[TL11 TL12]*[X11] + ISGN* [X11]*TR11  = [B11] */
 
256
/*            [TL21 TL22] [X21]         [X21]         [B21] */
 
257
 
 
258
L30:
 
259
/* Computing MAX */
 
260
/* Computing MAX */
 
261
    d__7 = (d__1 = tr[tr_dim1 + 1], abs(d__1)), d__8 = (d__2 = tl[tl_dim1 + 1]
 
262
            , abs(d__2)), d__7 = max(d__7,d__8), d__8 = (d__3 = tl[(tl_dim1 <<
 
263
             1) + 1], abs(d__3)), d__7 = max(d__7,d__8), d__8 = (d__4 = tl[
 
264
            tl_dim1 + 2], abs(d__4)), d__7 = max(d__7,d__8), d__8 = (d__5 = 
 
265
            tl[(tl_dim1 << 1) + 2], abs(d__5));
 
266
    d__6 = eps * max(d__7,d__8);
 
267
    smin = max(d__6,smlnum);
 
268
    tmp[0] = tl[tl_dim1 + 1] + sgn * tr[tr_dim1 + 1];
 
269
    tmp[3] = tl[(tl_dim1 << 1) + 2] + sgn * tr[tr_dim1 + 1];
 
270
    if (*ltranl) {
 
271
        tmp[1] = tl[(tl_dim1 << 1) + 1];
 
272
        tmp[2] = tl[tl_dim1 + 2];
 
273
    } else {
 
274
        tmp[1] = tl[tl_dim1 + 2];
 
275
        tmp[2] = tl[(tl_dim1 << 1) + 1];
 
276
    }
 
277
    btmp[0] = b[b_dim1 + 1];
 
278
    btmp[1] = b[b_dim1 + 2];
 
279
L40:
 
280
 
 
281
/*     Solve 2 by 2 system using complete pivoting. */
 
282
/*     Set pivots less than SMIN to SMIN. */
 
283
 
 
284
    ipiv = igraphidamax_(&c__4, tmp, &c__1);
 
285
    u11 = tmp[ipiv - 1];
 
286
    if (abs(u11) <= smin) {
 
287
        *info = 1;
 
288
        u11 = smin;
 
289
    }
 
290
    u12 = tmp[locu12[ipiv - 1] - 1];
 
291
    l21 = tmp[locl21[ipiv - 1] - 1] / u11;
 
292
    u22 = tmp[locu22[ipiv - 1] - 1] - u12 * l21;
 
293
    xswap = xswpiv[ipiv - 1];
 
294
    bswap = bswpiv[ipiv - 1];
 
295
    if (abs(u22) <= smin) {
 
296
        *info = 1;
 
297
        u22 = smin;
 
298
    }
 
299
    if (bswap) {
 
300
        temp = btmp[1];
 
301
        btmp[1] = btmp[0] - l21 * temp;
 
302
        btmp[0] = temp;
 
303
    } else {
 
304
        btmp[1] -= l21 * btmp[0];
 
305
    }
 
306
    *scale = 1.;
 
307
    if (smlnum * 2. * abs(btmp[1]) > abs(u22) || smlnum * 2. * abs(btmp[0]) > 
 
308
            abs(u11)) {
 
309
/* Computing MAX */
 
310
        d__1 = abs(btmp[0]), d__2 = abs(btmp[1]);
 
311
        *scale = .5 / max(d__1,d__2);
 
312
        btmp[0] *= *scale;
 
313
        btmp[1] *= *scale;
 
314
    }
 
315
    x2[1] = btmp[1] / u22;
 
316
    x2[0] = btmp[0] / u11 - u12 / u11 * x2[1];
 
317
    if (xswap) {
 
318
        temp = x2[1];
 
319
        x2[1] = x2[0];
 
320
        x2[0] = temp;
 
321
    }
 
322
    x[x_dim1 + 1] = x2[0];
 
323
    if (*n1 == 1) {
 
324
        x[(x_dim1 << 1) + 1] = x2[1];
 
325
        *xnorm = (d__1 = x[x_dim1 + 1], abs(d__1)) + (d__2 = x[(x_dim1 << 1) 
 
326
                + 1], abs(d__2));
 
327
    } else {
 
328
        x[x_dim1 + 2] = x2[1];
 
329
/* Computing MAX */
 
330
        d__3 = (d__1 = x[x_dim1 + 1], abs(d__1)), d__4 = (d__2 = x[x_dim1 + 2]
 
331
                , abs(d__2));
 
332
        *xnorm = max(d__3,d__4);
 
333
    }
 
334
    return 0;
 
335
 
 
336
/*     2 by 2: */
 
337
/*     op[TL11 TL12]*[X11 X12] +ISGN* [X11 X12]*op[TR11 TR12] = [B11 B12] */
 
338
/*       [TL21 TL22] [X21 X22]        [X21 X22]   [TR21 TR22]   [B21 B22] */
 
339
 
 
340
/*     Solve equivalent 4 by 4 system using complete pivoting. */
 
341
/*     Set pivots less than SMIN to SMIN. */
 
342
 
 
343
L50:
 
344
/* Computing MAX */
 
345
    d__5 = (d__1 = tr[tr_dim1 + 1], abs(d__1)), d__6 = (d__2 = tr[(tr_dim1 << 
 
346
            1) + 1], abs(d__2)), d__5 = max(d__5,d__6), d__6 = (d__3 = tr[
 
347
            tr_dim1 + 2], abs(d__3)), d__5 = max(d__5,d__6), d__6 = (d__4 = 
 
348
            tr[(tr_dim1 << 1) + 2], abs(d__4));
 
349
    smin = max(d__5,d__6);
 
350
/* Computing MAX */
 
351
    d__5 = smin, d__6 = (d__1 = tl[tl_dim1 + 1], abs(d__1)), d__5 = max(d__5,
 
352
            d__6), d__6 = (d__2 = tl[(tl_dim1 << 1) + 1], abs(d__2)), d__5 = 
 
353
            max(d__5,d__6), d__6 = (d__3 = tl[tl_dim1 + 2], abs(d__3)), d__5 =
 
354
             max(d__5,d__6), d__6 = (d__4 = tl[(tl_dim1 << 1) + 2], abs(d__4))
 
355
            ;
 
356
    smin = max(d__5,d__6);
 
357
/* Computing MAX */
 
358
    d__1 = eps * smin;
 
359
    smin = max(d__1,smlnum);
 
360
    btmp[0] = 0.;
 
361
    igraphdcopy_(&c__16, btmp, &c__0, t16, &c__1);
 
362
    t16[0] = tl[tl_dim1 + 1] + sgn * tr[tr_dim1 + 1];
 
363
    t16[5] = tl[(tl_dim1 << 1) + 2] + sgn * tr[tr_dim1 + 1];
 
364
    t16[10] = tl[tl_dim1 + 1] + sgn * tr[(tr_dim1 << 1) + 2];
 
365
    t16[15] = tl[(tl_dim1 << 1) + 2] + sgn * tr[(tr_dim1 << 1) + 2];
 
366
    if (*ltranl) {
 
367
        t16[4] = tl[tl_dim1 + 2];
 
368
        t16[1] = tl[(tl_dim1 << 1) + 1];
 
369
        t16[14] = tl[tl_dim1 + 2];
 
370
        t16[11] = tl[(tl_dim1 << 1) + 1];
 
371
    } else {
 
372
        t16[4] = tl[(tl_dim1 << 1) + 1];
 
373
        t16[1] = tl[tl_dim1 + 2];
 
374
        t16[14] = tl[(tl_dim1 << 1) + 1];
 
375
        t16[11] = tl[tl_dim1 + 2];
 
376
    }
 
377
    if (*ltranr) {
 
378
        t16[8] = sgn * tr[(tr_dim1 << 1) + 1];
 
379
        t16[13] = sgn * tr[(tr_dim1 << 1) + 1];
 
380
        t16[2] = sgn * tr[tr_dim1 + 2];
 
381
        t16[7] = sgn * tr[tr_dim1 + 2];
 
382
    } else {
 
383
        t16[8] = sgn * tr[tr_dim1 + 2];
 
384
        t16[13] = sgn * tr[tr_dim1 + 2];
 
385
        t16[2] = sgn * tr[(tr_dim1 << 1) + 1];
 
386
        t16[7] = sgn * tr[(tr_dim1 << 1) + 1];
 
387
    }
 
388
    btmp[0] = b[b_dim1 + 1];
 
389
    btmp[1] = b[b_dim1 + 2];
 
390
    btmp[2] = b[(b_dim1 << 1) + 1];
 
391
    btmp[3] = b[(b_dim1 << 1) + 2];
 
392
 
 
393
/*     Perform elimination */
 
394
 
 
395
    for (i__ = 1; i__ <= 3; ++i__) {
 
396
        xmax = 0.;
 
397
        for (ip = i__; ip <= 4; ++ip) {
 
398
            for (jp = i__; jp <= 4; ++jp) {
 
399
                if ((d__1 = t16[ip + (jp << 2) - 5], abs(d__1)) >= xmax) {
 
400
                    xmax = (d__1 = t16[ip + (jp << 2) - 5], abs(d__1));
 
401
                    ipsv = ip;
 
402
                    jpsv = jp;
 
403
                }
 
404
/* L60: */
 
405
            }
 
406
/* L70: */
 
407
        }
 
408
        if (ipsv != i__) {
 
409
            igraphdswap_(&c__4, &t16[ipsv - 1], &c__4, &t16[i__ - 1], &c__4);
 
410
            temp = btmp[i__ - 1];
 
411
            btmp[i__ - 1] = btmp[ipsv - 1];
 
412
            btmp[ipsv - 1] = temp;
 
413
        }
 
414
        if (jpsv != i__) {
 
415
            igraphdswap_(&c__4, &t16[(jpsv << 2) - 4], &c__1, &t16[(i__ << 2) - 4], 
 
416
                    &c__1);
 
417
        }
 
418
        jpiv[i__ - 1] = jpsv;
 
419
        if ((d__1 = t16[i__ + (i__ << 2) - 5], abs(d__1)) < smin) {
 
420
            *info = 1;
 
421
            t16[i__ + (i__ << 2) - 5] = smin;
 
422
        }
 
423
        for (j = i__ + 1; j <= 4; ++j) {
 
424
            t16[j + (i__ << 2) - 5] /= t16[i__ + (i__ << 2) - 5];
 
425
            btmp[j - 1] -= t16[j + (i__ << 2) - 5] * btmp[i__ - 1];
 
426
            for (k = i__ + 1; k <= 4; ++k) {
 
427
                t16[j + (k << 2) - 5] -= t16[j + (i__ << 2) - 5] * t16[i__ + (
 
428
                        k << 2) - 5];
 
429
/* L80: */
 
430
            }
 
431
/* L90: */
 
432
        }
 
433
/* L100: */
 
434
    }
 
435
    if (abs(t16[15]) < smin) {
 
436
        t16[15] = smin;
 
437
    }
 
438
    *scale = 1.;
 
439
    if (smlnum * 8. * abs(btmp[0]) > abs(t16[0]) || smlnum * 8. * abs(btmp[1])
 
440
             > abs(t16[5]) || smlnum * 8. * abs(btmp[2]) > abs(t16[10]) || 
 
441
            smlnum * 8. * abs(btmp[3]) > abs(t16[15])) {
 
442
/* Computing MAX */
 
443
        d__1 = abs(btmp[0]), d__2 = abs(btmp[1]), d__1 = max(d__1,d__2), d__2 
 
444
                = abs(btmp[2]), d__1 = max(d__1,d__2), d__2 = abs(btmp[3]);
 
445
        *scale = .125 / max(d__1,d__2);
 
446
        btmp[0] *= *scale;
 
447
        btmp[1] *= *scale;
 
448
        btmp[2] *= *scale;
 
449
        btmp[3] *= *scale;
 
450
    }
 
451
    for (i__ = 1; i__ <= 4; ++i__) {
 
452
        k = 5 - i__;
 
453
        temp = 1. / t16[k + (k << 2) - 5];
 
454
        tmp[k - 1] = btmp[k - 1] * temp;
 
455
        for (j = k + 1; j <= 4; ++j) {
 
456
            tmp[k - 1] -= temp * t16[k + (j << 2) - 5] * tmp[j - 1];
 
457
/* L110: */
 
458
        }
 
459
/* L120: */
 
460
    }
 
461
    for (i__ = 1; i__ <= 3; ++i__) {
 
462
        if (jpiv[4 - i__ - 1] != 4 - i__) {
 
463
            temp = tmp[4 - i__ - 1];
 
464
            tmp[4 - i__ - 1] = tmp[jpiv[4 - i__ - 1] - 1];
 
465
            tmp[jpiv[4 - i__ - 1] - 1] = temp;
 
466
        }
 
467
/* L130: */
 
468
    }
 
469
    x[x_dim1 + 1] = tmp[0];
 
470
    x[x_dim1 + 2] = tmp[1];
 
471
    x[(x_dim1 << 1) + 1] = tmp[2];
 
472
    x[(x_dim1 << 1) + 2] = tmp[3];
 
473
/* Computing MAX */
 
474
    d__1 = abs(tmp[0]) + abs(tmp[2]), d__2 = abs(tmp[1]) + abs(tmp[3]);
 
475
    *xnorm = max(d__1,d__2);
 
476
    return 0;
 
477
 
 
478
/*     End of DLASY2 */
 
479
 
 
480
} /* igraphdlasy2_ */
 
481