3 #include "gromacs/utility/real.h"
5 #include "../gmx_blas.h"
6 #include "../gmx_lapack.h"
7 #include "lapack_limits.h"
11 F77_FUNC(slarrfx
,SLARRFX
)(int *n
,
30 float s
, eps
, tmp
, dmax1
, dmax2
, delta
;
46 dplus
[1] = d__
[1] + s
;
47 dmax1
= fabs(dplus
[1]);
49 for (i__
= 1; i__
<= i__1
; ++i__
) {
50 lplus
[i__
] = ld
[i__
] / dplus
[i__
];
51 s
= s
* lplus
[i__
] * l
[i__
] - *sigma
;
52 dplus
[i__
+ 1] = d__
[i__
+ 1] + s
;
53 d__2
= dmax1
, d__3
= fabs(dplus
[i__
+ 1]);
54 dmax1
= (d__2
>d__3
) ? d__2
: d__3
;
56 if (! (dmax1
> 0. || dmax1
< 1.)) {
57 *sigma
-= fabs(*sigma
) * delta
;
67 dmax2
= fabs(work
[1]);
69 for (i__
= 1; i__
<= i__1
; ++i__
) {
70 work
[*n
+ i__
] = ld
[i__
] / work
[i__
];
71 s
= s
* work
[*n
+ i__
] * l
[i__
] - tmp
;
72 work
[i__
+ 1] = d__
[i__
+ 1] + s
;
73 d__2
= dmax2
, d__3
= fabs(work
[i__
+ 1]);
74 dmax2
= (d__2
>d__3
) ? d__2
: d__3
;
76 if (! (dmax2
> 0. || dmax2
< 1.)) {
77 tmp
+= fabs(tmp
) * delta
;
83 F77_FUNC(scopy
,SCOPY
)(n
, &work
[1], &i1
, &dplus
[1], &i1
);
85 F77_FUNC(scopy
,SCOPY
)(&i__1
, &work
[*n
+ 1], &i1
, &lplus
[1], &i1
);