3 #include "gromacs/utility/real.h"
5 #include "../gmx_lapack.h"
6 #include "lapack_limits.h"
10 F77_FUNC(slagts
,SLAGTS
)(int *job
,
22 float d__1
, d__2
, d__4
, d__5
;
25 float ak
, eps
, temp
, pert
, absak
, sfmin
;
35 if (abs(*job
) > 2 || *job
== 0) {
49 minval
= GMX_FLOAT_MIN
;
60 d__1
= (d__1
>d__2
) ? d__1
: d__2
;
62 *tol
= (d__1
>d__2
) ? d__1
: d__2
;
65 for (k
= 3; k
<= i__1
; ++k
) {
68 d__4
= (d__4
>d__5
) ? d__4
: d__5
;
69 d__5
= fabs(b
[k
- 1]);
70 d__4
= (d__4
>d__5
) ? d__4
: d__5
;
71 d__5
= fabs(d__
[k
- 2]);
72 *tol
= (d__4
>d__5
) ? d__4
: d__5
;
75 if (fabs(*tol
)<GMX_FLOAT_MIN
) {
83 for (k
= 2; k
<= i__1
; ++k
) {
85 y
[k
] -= c__
[k
- 1] * y
[k
- 1];
89 y
[k
] = temp
- c__
[k
- 1] * y
[k
];
93 for (k
= *n
; k
>= 1; --k
) {
95 temp
= y
[k
] - b
[k
] * y
[k
+ 1] - d__
[k
] * y
[k
+ 2];
96 } else if (k
== *n
- 1) {
97 temp
= y
[k
] - b
[k
] * y
[k
+ 1];
105 if (fabs(absak
)<GMX_FLOAT_MIN
|| fabs(temp
) * sfmin
> absak
) {
112 } else if (fabs(temp
) > absak
* bignum
) {
120 for (k
= *n
; k
>= 1; --k
) {
122 temp
= y
[k
] - b
[k
] * y
[k
+ 1] - d__
[k
] * y
[k
+ 2];
123 } else if (k
== *n
- 1) {
124 temp
= y
[k
] - b
[k
] * y
[k
+ 1];
137 if (fabs(absak
)<GMX_FLOAT_MIN
|| fabs(temp
) * sfmin
> absak
) {
145 } else if (fabs(temp
) > absak
* bignum
) {
158 for (k
= 1; k
<= i__1
; ++k
) {
160 temp
= y
[k
] - b
[k
- 1] * y
[k
- 1] - d__
[k
- 2] * y
[k
- 2];
162 temp
= y
[k
] - b
[k
- 1] * y
[k
- 1];
170 if (fabs(absak
)<GMX_FLOAT_MIN
|| fabs(temp
) * sfmin
> absak
) {
177 } else if (fabs(temp
) > absak
* bignum
) {
186 for (k
= 1; k
<= i__1
; ++k
) {
188 temp
= y
[k
] - b
[k
- 1] * y
[k
- 1] - d__
[k
- 2] * y
[k
- 2];
190 temp
= y
[k
] - b
[k
- 1] * y
[k
- 1];
204 if (fabs(absak
)<GMX_FLOAT_MIN
|| fabs(temp
) * sfmin
> absak
) {
212 } else if (fabs(temp
) > absak
* bignum
) {
222 for (k
= *n
; k
>= 2; --k
) {
223 if (in
[k
- 1] == 0) {
224 y
[k
- 1] -= c__
[k
- 1] * y
[k
];
228 y
[k
] = temp
- c__
[k
- 1] * y
[k
];