00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016
00017
00018 static integer c__1 = 1;
00019
00020 doublereal dlansf_(char *norm, char *transr, char *uplo, integer *n,
00021 doublereal *a, doublereal *work)
00022 {
00023
00024 integer i__1, i__2;
00025 doublereal ret_val, d__1, d__2, d__3;
00026
00027
00028 double sqrt(doublereal);
00029
00030
00031 integer i__, j, k, l;
00032 doublereal s;
00033 integer n1;
00034 doublereal aa;
00035 integer lda, ifm, noe, ilu;
00036 doublereal scale;
00037 extern logical lsame_(char *, char *);
00038 doublereal value;
00039 extern integer idamax_(integer *, doublereal *, integer *);
00040 extern int dlassq_(integer *, doublereal *, integer *,
00041 doublereal *, doublereal *);
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216 if (*n == 0) {
00217 ret_val = 0.;
00218 return ret_val;
00219 }
00220
00221
00222
00223 noe = 1;
00224 if (*n % 2 == 0) {
00225 noe = 0;
00226 }
00227
00228
00229
00230 ifm = 1;
00231 if (lsame_(transr, "T")) {
00232 ifm = 0;
00233 }
00234
00235
00236
00237 ilu = 1;
00238 if (lsame_(uplo, "U")) {
00239 ilu = 0;
00240 }
00241
00242
00243
00244
00245
00246 if (ifm == 1) {
00247 if (noe == 1) {
00248 lda = *n;
00249 } else {
00250
00251 lda = *n + 1;
00252 }
00253 } else {
00254
00255 lda = (*n + 1) / 2;
00256 }
00257
00258 if (lsame_(norm, "M")) {
00259
00260
00261
00262 k = (*n + 1) / 2;
00263 value = 0.;
00264 if (noe == 1) {
00265
00266 if (ifm == 1) {
00267
00268 i__1 = k - 1;
00269 for (j = 0; j <= i__1; ++j) {
00270 i__2 = *n - 1;
00271 for (i__ = 0; i__ <= i__2; ++i__) {
00272
00273 d__2 = value, d__3 = (d__1 = a[i__ + j * lda], abs(
00274 d__1));
00275 value = max(d__2,d__3);
00276 }
00277 }
00278 } else {
00279
00280 i__1 = *n - 1;
00281 for (j = 0; j <= i__1; ++j) {
00282 i__2 = k - 1;
00283 for (i__ = 0; i__ <= i__2; ++i__) {
00284
00285 d__2 = value, d__3 = (d__1 = a[i__ + j * lda], abs(
00286 d__1));
00287 value = max(d__2,d__3);
00288 }
00289 }
00290 }
00291 } else {
00292
00293 if (ifm == 1) {
00294
00295 i__1 = k - 1;
00296 for (j = 0; j <= i__1; ++j) {
00297 i__2 = *n;
00298 for (i__ = 0; i__ <= i__2; ++i__) {
00299
00300 d__2 = value, d__3 = (d__1 = a[i__ + j * lda], abs(
00301 d__1));
00302 value = max(d__2,d__3);
00303 }
00304 }
00305 } else {
00306
00307 i__1 = *n;
00308 for (j = 0; j <= i__1; ++j) {
00309 i__2 = k - 1;
00310 for (i__ = 0; i__ <= i__2; ++i__) {
00311
00312 d__2 = value, d__3 = (d__1 = a[i__ + j * lda], abs(
00313 d__1));
00314 value = max(d__2,d__3);
00315 }
00316 }
00317 }
00318 }
00319 } else if (lsame_(norm, "I") || lsame_(norm, "O") || *(unsigned char *)norm == '1') {
00320
00321
00322
00323 if (ifm == 1) {
00324 k = *n / 2;
00325 if (noe == 1) {
00326
00327 if (ilu == 0) {
00328 i__1 = k - 1;
00329 for (i__ = 0; i__ <= i__1; ++i__) {
00330 work[i__] = 0.;
00331 }
00332 i__1 = k;
00333 for (j = 0; j <= i__1; ++j) {
00334 s = 0.;
00335 i__2 = k + j - 1;
00336 for (i__ = 0; i__ <= i__2; ++i__) {
00337 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00338
00339 s += aa;
00340 work[i__] += aa;
00341 }
00342 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00343
00344 work[j + k] = s + aa;
00345 if (i__ == k + k) {
00346 goto L10;
00347 }
00348 ++i__;
00349 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00350
00351 work[j] += aa;
00352 s = 0.;
00353 i__2 = k - 1;
00354 for (l = j + 1; l <= i__2; ++l) {
00355 ++i__;
00356 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00357
00358 s += aa;
00359 work[l] += aa;
00360 }
00361 work[j] += s;
00362 }
00363 L10:
00364 i__ = idamax_(n, work, &c__1);
00365 value = work[i__ - 1];
00366 } else {
00367
00368 ++k;
00369
00370 i__1 = *n - 1;
00371 for (i__ = k; i__ <= i__1; ++i__) {
00372 work[i__] = 0.;
00373 }
00374 for (j = k - 1; j >= 0; --j) {
00375 s = 0.;
00376 i__1 = j - 2;
00377 for (i__ = 0; i__ <= i__1; ++i__) {
00378 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00379
00380 s += aa;
00381 work[i__ + k] += aa;
00382 }
00383 if (j > 0) {
00384 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00385
00386 s += aa;
00387 work[i__ + k] += s;
00388
00389 ++i__;
00390 }
00391 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00392
00393 work[j] = aa;
00394 s = 0.;
00395 i__1 = *n - 1;
00396 for (l = j + 1; l <= i__1; ++l) {
00397 ++i__;
00398 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00399
00400 s += aa;
00401 work[l] += aa;
00402 }
00403 work[j] += s;
00404 }
00405 i__ = idamax_(n, work, &c__1);
00406 value = work[i__ - 1];
00407 }
00408 } else {
00409
00410 if (ilu == 0) {
00411 i__1 = k - 1;
00412 for (i__ = 0; i__ <= i__1; ++i__) {
00413 work[i__] = 0.;
00414 }
00415 i__1 = k - 1;
00416 for (j = 0; j <= i__1; ++j) {
00417 s = 0.;
00418 i__2 = k + j - 1;
00419 for (i__ = 0; i__ <= i__2; ++i__) {
00420 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00421
00422 s += aa;
00423 work[i__] += aa;
00424 }
00425 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00426
00427 work[j + k] = s + aa;
00428 ++i__;
00429 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00430
00431 work[j] += aa;
00432 s = 0.;
00433 i__2 = k - 1;
00434 for (l = j + 1; l <= i__2; ++l) {
00435 ++i__;
00436 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00437
00438 s += aa;
00439 work[l] += aa;
00440 }
00441 work[j] += s;
00442 }
00443 i__ = idamax_(n, work, &c__1);
00444 value = work[i__ - 1];
00445 } else {
00446
00447 i__1 = *n - 1;
00448 for (i__ = k; i__ <= i__1; ++i__) {
00449 work[i__] = 0.;
00450 }
00451 for (j = k - 1; j >= 0; --j) {
00452 s = 0.;
00453 i__1 = j - 1;
00454 for (i__ = 0; i__ <= i__1; ++i__) {
00455 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00456
00457 s += aa;
00458 work[i__ + k] += aa;
00459 }
00460 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00461
00462 s += aa;
00463 work[i__ + k] += s;
00464
00465 ++i__;
00466 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00467
00468 work[j] = aa;
00469 s = 0.;
00470 i__1 = *n - 1;
00471 for (l = j + 1; l <= i__1; ++l) {
00472 ++i__;
00473 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00474
00475 s += aa;
00476 work[l] += aa;
00477 }
00478 work[j] += s;
00479 }
00480 i__ = idamax_(n, work, &c__1);
00481 value = work[i__ - 1];
00482 }
00483 }
00484 } else {
00485
00486 k = *n / 2;
00487 if (noe == 1) {
00488
00489 if (ilu == 0) {
00490 n1 = k;
00491
00492 ++k;
00493
00494 i__1 = *n - 1;
00495 for (i__ = n1; i__ <= i__1; ++i__) {
00496 work[i__] = 0.;
00497 }
00498 i__1 = n1 - 1;
00499 for (j = 0; j <= i__1; ++j) {
00500 s = 0.;
00501 i__2 = k - 1;
00502 for (i__ = 0; i__ <= i__2; ++i__) {
00503 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00504
00505 work[i__ + n1] += aa;
00506 s += aa;
00507 }
00508 work[j] = s;
00509 }
00510
00511 s = (d__1 = a[j * lda], abs(d__1));
00512
00513 i__1 = k - 1;
00514 for (i__ = 1; i__ <= i__1; ++i__) {
00515 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00516
00517 work[i__ + n1] += aa;
00518 s += aa;
00519 }
00520 work[j] += s;
00521 i__1 = *n - 1;
00522 for (j = k; j <= i__1; ++j) {
00523 s = 0.;
00524 i__2 = j - k - 1;
00525 for (i__ = 0; i__ <= i__2; ++i__) {
00526 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00527
00528 work[i__] += aa;
00529 s += aa;
00530 }
00531
00532 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00533
00534 s += aa;
00535 work[j - k] += s;
00536 ++i__;
00537 s = (d__1 = a[i__ + j * lda], abs(d__1));
00538
00539 i__2 = *n - 1;
00540 for (l = j + 1; l <= i__2; ++l) {
00541 ++i__;
00542 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00543
00544 work[l] += aa;
00545 s += aa;
00546 }
00547 work[j] += s;
00548 }
00549 i__ = idamax_(n, work, &c__1);
00550 value = work[i__ - 1];
00551 } else {
00552
00553 ++k;
00554
00555 i__1 = *n - 1;
00556 for (i__ = k; i__ <= i__1; ++i__) {
00557 work[i__] = 0.;
00558 }
00559 i__1 = k - 2;
00560 for (j = 0; j <= i__1; ++j) {
00561
00562 s = 0.;
00563 i__2 = j - 1;
00564 for (i__ = 0; i__ <= i__2; ++i__) {
00565 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00566
00567 work[i__] += aa;
00568 s += aa;
00569 }
00570 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00571
00572 s += aa;
00573 work[j] = s;
00574
00575 ++i__;
00576
00577 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00578 s = aa;
00579 i__2 = *n - 1;
00580 for (l = k + j + 1; l <= i__2; ++l) {
00581 ++i__;
00582 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00583
00584 s += aa;
00585 work[l] += aa;
00586 }
00587 work[k + j] += s;
00588 }
00589
00590 s = 0.;
00591 i__1 = k - 2;
00592 for (i__ = 0; i__ <= i__1; ++i__) {
00593 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00594
00595 work[i__] += aa;
00596 s += aa;
00597 }
00598
00599 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00600
00601 s += aa;
00602 work[i__] = s;
00603
00604 i__1 = *n - 1;
00605 for (j = k; j <= i__1; ++j) {
00606
00607 s = 0.;
00608 i__2 = k - 1;
00609 for (i__ = 0; i__ <= i__2; ++i__) {
00610 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00611
00612 work[i__] += aa;
00613 s += aa;
00614 }
00615 work[j] += s;
00616 }
00617 i__ = idamax_(n, work, &c__1);
00618 value = work[i__ - 1];
00619 }
00620 } else {
00621
00622 if (ilu == 0) {
00623 i__1 = *n - 1;
00624 for (i__ = k; i__ <= i__1; ++i__) {
00625 work[i__] = 0.;
00626 }
00627 i__1 = k - 1;
00628 for (j = 0; j <= i__1; ++j) {
00629 s = 0.;
00630 i__2 = k - 1;
00631 for (i__ = 0; i__ <= i__2; ++i__) {
00632 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00633
00634 work[i__ + k] += aa;
00635 s += aa;
00636 }
00637 work[j] = s;
00638 }
00639
00640 aa = (d__1 = a[j * lda], abs(d__1));
00641
00642 s = aa;
00643 i__1 = k - 1;
00644 for (i__ = 1; i__ <= i__1; ++i__) {
00645 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00646
00647 work[i__ + k] += aa;
00648 s += aa;
00649 }
00650 work[j] += s;
00651 i__1 = *n - 1;
00652 for (j = k + 1; j <= i__1; ++j) {
00653 s = 0.;
00654 i__2 = j - 2 - k;
00655 for (i__ = 0; i__ <= i__2; ++i__) {
00656 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00657
00658 work[i__] += aa;
00659 s += aa;
00660 }
00661
00662 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00663
00664 s += aa;
00665 work[j - k - 1] += s;
00666 ++i__;
00667 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00668
00669 s = aa;
00670 i__2 = *n - 1;
00671 for (l = j + 1; l <= i__2; ++l) {
00672 ++i__;
00673 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00674
00675 work[l] += aa;
00676 s += aa;
00677 }
00678 work[j] += s;
00679 }
00680
00681 s = 0.;
00682 i__1 = k - 2;
00683 for (i__ = 0; i__ <= i__1; ++i__) {
00684 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00685
00686 work[i__] += aa;
00687 s += aa;
00688 }
00689
00690 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00691
00692 s += aa;
00693 work[i__] += s;
00694 i__ = idamax_(n, work, &c__1);
00695 value = work[i__ - 1];
00696 } else {
00697
00698 i__1 = *n - 1;
00699 for (i__ = k; i__ <= i__1; ++i__) {
00700 work[i__] = 0.;
00701 }
00702
00703 s = abs(a[0]);
00704
00705 i__1 = k - 1;
00706 for (i__ = 1; i__ <= i__1; ++i__) {
00707 aa = (d__1 = a[i__], abs(d__1));
00708
00709 work[i__ + k] += aa;
00710 s += aa;
00711 }
00712 work[k] += s;
00713 i__1 = k - 1;
00714 for (j = 1; j <= i__1; ++j) {
00715
00716 s = 0.;
00717 i__2 = j - 2;
00718 for (i__ = 0; i__ <= i__2; ++i__) {
00719 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00720
00721 work[i__] += aa;
00722 s += aa;
00723 }
00724 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00725
00726 s += aa;
00727 work[j - 1] = s;
00728
00729 ++i__;
00730
00731 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00732 s = aa;
00733 i__2 = *n - 1;
00734 for (l = k + j + 1; l <= i__2; ++l) {
00735 ++i__;
00736 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00737
00738 s += aa;
00739 work[l] += aa;
00740 }
00741 work[k + j] += s;
00742 }
00743
00744 s = 0.;
00745 i__1 = k - 2;
00746 for (i__ = 0; i__ <= i__1; ++i__) {
00747 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00748
00749 work[i__] += aa;
00750 s += aa;
00751 }
00752
00753 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00754
00755 s += aa;
00756 work[i__] = s;
00757
00758 i__1 = *n;
00759 for (j = k + 1; j <= i__1; ++j) {
00760
00761 s = 0.;
00762 i__2 = k - 1;
00763 for (i__ = 0; i__ <= i__2; ++i__) {
00764 aa = (d__1 = a[i__ + j * lda], abs(d__1));
00765
00766 work[i__] += aa;
00767 s += aa;
00768 }
00769 work[j - 1] += s;
00770 }
00771 i__ = idamax_(n, work, &c__1);
00772 value = work[i__ - 1];
00773 }
00774 }
00775 }
00776 } else if (lsame_(norm, "F") || lsame_(norm, "E")) {
00777
00778
00779
00780 k = (*n + 1) / 2;
00781 scale = 0.;
00782 s = 1.;
00783 if (noe == 1) {
00784
00785 if (ifm == 1) {
00786
00787 if (ilu == 0) {
00788
00789 i__1 = k - 3;
00790 for (j = 0; j <= i__1; ++j) {
00791 i__2 = k - j - 2;
00792 dlassq_(&i__2, &a[k + j + 1 + j * lda], &c__1, &scale,
00793 &s);
00794
00795 }
00796 i__1 = k - 1;
00797 for (j = 0; j <= i__1; ++j) {
00798 i__2 = k + j - 1;
00799 dlassq_(&i__2, &a[j * lda], &c__1, &scale, &s);
00800
00801 }
00802 s += s;
00803
00804 i__1 = k - 1;
00805 i__2 = lda + 1;
00806 dlassq_(&i__1, &a[k], &i__2, &scale, &s);
00807
00808 i__1 = lda + 1;
00809 dlassq_(&k, &a[k - 1], &i__1, &scale, &s);
00810
00811 } else {
00812
00813 i__1 = k - 1;
00814 for (j = 0; j <= i__1; ++j) {
00815 i__2 = *n - j - 1;
00816 dlassq_(&i__2, &a[j + 1 + j * lda], &c__1, &scale, &s)
00817 ;
00818
00819 }
00820 i__1 = k - 2;
00821 for (j = 0; j <= i__1; ++j) {
00822 dlassq_(&j, &a[(j + 1) * lda], &c__1, &scale, &s);
00823
00824 }
00825 s += s;
00826
00827 i__1 = lda + 1;
00828 dlassq_(&k, a, &i__1, &scale, &s);
00829
00830 i__1 = k - 1;
00831 i__2 = lda + 1;
00832 dlassq_(&i__1, &a[lda], &i__2, &scale, &s);
00833
00834 }
00835 } else {
00836
00837 if (ilu == 0) {
00838
00839 i__1 = k - 2;
00840 for (j = 1; j <= i__1; ++j) {
00841 dlassq_(&j, &a[(k + j) * lda], &c__1, &scale, &s);
00842
00843 }
00844 i__1 = k - 2;
00845 for (j = 0; j <= i__1; ++j) {
00846 dlassq_(&k, &a[j * lda], &c__1, &scale, &s);
00847
00848 }
00849 i__1 = k - 2;
00850 for (j = 0; j <= i__1; ++j) {
00851 i__2 = k - j - 1;
00852 dlassq_(&i__2, &a[j + 1 + (j + k - 1) * lda], &c__1, &
00853 scale, &s);
00854
00855 }
00856 s += s;
00857
00858 i__1 = k - 1;
00859 i__2 = lda + 1;
00860 dlassq_(&i__1, &a[k * lda], &i__2, &scale, &s);
00861
00862 i__1 = lda + 1;
00863 dlassq_(&k, &a[(k - 1) * lda], &i__1, &scale, &s);
00864
00865 } else {
00866
00867 i__1 = k - 1;
00868 for (j = 1; j <= i__1; ++j) {
00869 dlassq_(&j, &a[j * lda], &c__1, &scale, &s);
00870
00871 }
00872 i__1 = *n - 1;
00873 for (j = k; j <= i__1; ++j) {
00874 dlassq_(&k, &a[j * lda], &c__1, &scale, &s);
00875
00876 }
00877 i__1 = k - 3;
00878 for (j = 0; j <= i__1; ++j) {
00879 i__2 = k - j - 2;
00880 dlassq_(&i__2, &a[j + 2 + j * lda], &c__1, &scale, &s)
00881 ;
00882
00883 }
00884 s += s;
00885
00886 i__1 = lda + 1;
00887 dlassq_(&k, a, &i__1, &scale, &s);
00888
00889 i__1 = k - 1;
00890 i__2 = lda + 1;
00891 dlassq_(&i__1, &a[1], &i__2, &scale, &s);
00892
00893 }
00894 }
00895 } else {
00896
00897 if (ifm == 1) {
00898
00899 if (ilu == 0) {
00900
00901 i__1 = k - 2;
00902 for (j = 0; j <= i__1; ++j) {
00903 i__2 = k - j - 1;
00904 dlassq_(&i__2, &a[k + j + 2 + j * lda], &c__1, &scale,
00905 &s);
00906
00907 }
00908 i__1 = k - 1;
00909 for (j = 0; j <= i__1; ++j) {
00910 i__2 = k + j;
00911 dlassq_(&i__2, &a[j * lda], &c__1, &scale, &s);
00912
00913 }
00914 s += s;
00915
00916 i__1 = lda + 1;
00917 dlassq_(&k, &a[k + 1], &i__1, &scale, &s);
00918
00919 i__1 = lda + 1;
00920 dlassq_(&k, &a[k], &i__1, &scale, &s);
00921
00922 } else {
00923
00924 i__1 = k - 1;
00925 for (j = 0; j <= i__1; ++j) {
00926 i__2 = *n - j - 1;
00927 dlassq_(&i__2, &a[j + 2 + j * lda], &c__1, &scale, &s)
00928 ;
00929
00930 }
00931 i__1 = k - 1;
00932 for (j = 1; j <= i__1; ++j) {
00933 dlassq_(&j, &a[j * lda], &c__1, &scale, &s);
00934
00935 }
00936 s += s;
00937
00938 i__1 = lda + 1;
00939 dlassq_(&k, &a[1], &i__1, &scale, &s);
00940
00941 i__1 = lda + 1;
00942 dlassq_(&k, a, &i__1, &scale, &s);
00943
00944 }
00945 } else {
00946
00947 if (ilu == 0) {
00948
00949 i__1 = k - 1;
00950 for (j = 1; j <= i__1; ++j) {
00951 dlassq_(&j, &a[(k + 1 + j) * lda], &c__1, &scale, &s);
00952
00953 }
00954 i__1 = k - 1;
00955 for (j = 0; j <= i__1; ++j) {
00956 dlassq_(&k, &a[j * lda], &c__1, &scale, &s);
00957
00958 }
00959 i__1 = k - 2;
00960 for (j = 0; j <= i__1; ++j) {
00961 i__2 = k - j - 1;
00962 dlassq_(&i__2, &a[j + 1 + (j + k) * lda], &c__1, &
00963 scale, &s);
00964
00965 }
00966 s += s;
00967
00968 i__1 = lda + 1;
00969 dlassq_(&k, &a[(k + 1) * lda], &i__1, &scale, &s);
00970
00971 i__1 = lda + 1;
00972 dlassq_(&k, &a[k * lda], &i__1, &scale, &s);
00973
00974 } else {
00975
00976 i__1 = k - 1;
00977 for (j = 1; j <= i__1; ++j) {
00978 dlassq_(&j, &a[(j + 1) * lda], &c__1, &scale, &s);
00979
00980 }
00981 i__1 = *n;
00982 for (j = k + 1; j <= i__1; ++j) {
00983 dlassq_(&k, &a[j * lda], &c__1, &scale, &s);
00984
00985 }
00986 i__1 = k - 2;
00987 for (j = 0; j <= i__1; ++j) {
00988 i__2 = k - j - 1;
00989 dlassq_(&i__2, &a[j + 1 + j * lda], &c__1, &scale, &s)
00990 ;
00991
00992 }
00993 s += s;
00994
00995 i__1 = lda + 1;
00996 dlassq_(&k, &a[lda], &i__1, &scale, &s);
00997
00998 i__1 = lda + 1;
00999 dlassq_(&k, a, &i__1, &scale, &s);
01000
01001 }
01002 }
01003 }
01004 value = scale * sqrt(s);
01005 }
01006
01007 ret_val = value;
01008 return ret_val;
01009
01010
01011
01012 }