46 #include "Moocho_Config.h"
49 #if !defined(HAVE_MOOCHO_FORTRAN)
56 void dchud_c(
double r__[],
int *ldr,
int *p,
57 double x[],
double z__[],
int *ldz,
int *nz,
58 double y[],
double *rho,
double c__[],
double s[]
69 int r_dim1, r_offset, z_dim1, z_offset, i__1, i__2;
75 double t, scale, azeta;
82 r_offset = 1 + r_dim1 * 1;
86 z_offset = 1 + z_dim1 * 1;
95 for (j = 1; j <= i__1; ++j) {
105 for (i__ = 1; i__ <= i__2; ++i__) {
106 t = c__[i__] * r__[i__ + j * r_dim1] + s[i__] * xj;
107 xj = c__[i__] * xj - s[i__] * r__[i__ + j * r_dim1];
108 r__[i__ + j * r_dim1] = t;
115 DROTG_F77(&r__[j + j * r_dim1], &xj, &c__[j], &s[j]);
125 for (j = 1; j <= i__1; ++j) {
128 for (i__ = 1; i__ <= i__2; ++i__) {
129 t = c__[i__] * z__[i__ + j * z_dim1] + s[i__] * zeta;
130 zeta = c__[i__] * zeta - s[i__] * z__[i__ + j * z_dim1];
131 z__[i__ + j * z_dim1] = t;
135 if (azeta == 0. || rho[j] < 0.) {
138 scale = azeta + rho[j];
140 d__1 = azeta / scale;
142 d__2 = rho[j] / scale;
143 rho[j] = scale * sqrt(d__1 * d__1 + d__2 * d__2);
155 #endif // !defined(HAVE_MOOCHO_FORTRAN)