Lines Matching refs:j
127 int j, i; in lmmin() local
226 for (j = 0; j < n; j++) in lmmin()
227 diag[j] = 1; in lmmin()
259 for (j = 0; j < n; j++) { in lmmin()
260 temp = x[j]; in lmmin()
262 x[j] += step; /* replace temporarily */ in lmmin()
268 fjac[j*m+i] = (wf[i] - fvec[i]) / step; in lmmin()
269 x[j] = temp; /* restore */ in lmmin()
276 for (j = 0; j < n; j++) in lmmin()
277 printf("%.5e ", fjac[j*m+i]); in lmmin()
311 for (j = 0; j < n; j++) { in lmmin()
312 temp3 = fjac[j*m+j]; in lmmin()
315 for (i = j; i < m; i++) in lmmin()
316 sum += fjac[j*m+i] * wf[i]; in lmmin()
318 for (i = j; i < m; i++) in lmmin()
319 wf[i] += fjac[j*m+i] * temp; in lmmin()
321 fjac[j*m+j] = wa1[j]; in lmmin()
322 qtf[j] = wf[j]; in lmmin()
327 for (j = 0; j < n; j++) { in lmmin()
328 if (wa2[Pivot[j]] == 0) in lmmin()
331 for (i = 0; i <= j; i++) in lmmin()
332 sum += fjac[j*m+i] * qtf[i]; in lmmin()
333 gnorm = MAX(gnorm, fabs(sum / wa2[Pivot[j]] / fnorm)); in lmmin()
345 for (j = 0; j < n; j++) in lmmin()
346 diag[j] = wa2[j] ? wa2[j] : 1; in lmmin()
348 for (j = 0; j < n; j++) in lmmin()
349 wa3[j] = diag[j] * x[j]; in lmmin()
379 for (j = 0; j < n; j++) in lmmin()
380 diag[j] = MAX(diag[j], wa2[j]); in lmmin()
400 for (j = 0; j < n; j++) { in lmmin()
401 wa3[j] = 0; in lmmin()
402 for (i = 0; i <= j; i++) in lmmin()
403 wa3[i] -= fjac[j*m+i] * wa1[Pivot[j]]; in lmmin()
418 for (j = 0; j < n; j++) in lmmin()
419 wa2[j] = x[j] - wa1[j]; in lmmin()
475 for (j = 0; j < n; j++) { in lmmin()
476 x[j] = wa2[j]; in lmmin()
477 wa2[j] = diag[j] * x[j]; in lmmin()
480 for (j = 0; j < n; j++) in lmmin()
481 x[j] = wa2[j]; in lmmin()
624 int i, iter, j, nsing; in lm_lmpar() local
633 for (j = 0; j < n; j++) { in lm_lmpar()
634 aux[j] = qtb[j]; in lm_lmpar()
635 if (r[j*ldr+j] == 0 && nsing == n) in lm_lmpar()
636 nsing = j; in lm_lmpar()
638 aux[j] = 0; in lm_lmpar()
640 for (j = nsing-1; j >= 0; j--) { in lm_lmpar()
641 aux[j] = aux[j] / r[j+ldr*j]; in lm_lmpar()
642 temp = aux[j]; in lm_lmpar()
643 for (i = 0; i < j; i++) in lm_lmpar()
644 aux[i] -= r[j*ldr+i] * temp; in lm_lmpar()
647 for (j = 0; j < n; j++) in lm_lmpar()
648 x[Pivot[j]] = aux[j]; in lm_lmpar()
653 for (j = 0; j < n; j++) in lm_lmpar()
654 xdi[j] = diag[j] * x[j]; in lm_lmpar()
671 for (j = 0; j < n; j++) in lm_lmpar()
672 aux[j] = diag[Pivot[j]] * xdi[Pivot[j]] / dxnorm; in lm_lmpar()
674 for (j = 0; j < n; j++) { in lm_lmpar()
676 for (i = 0; i < j; i++) in lm_lmpar()
677 sum += r[j*ldr+i] * aux[i]; in lm_lmpar()
678 aux[j] = (aux[j] - sum) / r[j+ldr*j]; in lm_lmpar()
686 for (j = 0; j < n; j++) { in lm_lmpar()
688 for (i = 0; i <= j; i++) in lm_lmpar()
689 sum += r[j*ldr+i] * qtb[i]; in lm_lmpar()
690 aux[j] = sum / diag[Pivot[j]]; in lm_lmpar()
713 for (j = 0; j < n; j++) in lm_lmpar()
714 aux[j] = temp * diag[j]; in lm_lmpar()
719 for (j = 0; j < n; j++) in lm_lmpar()
720 xdi[j] = diag[j] * x[j]; /* used as output */ in lm_lmpar()
739 for (j = 0; j < n; j++) in lm_lmpar()
740 aux[j] = diag[Pivot[j]] * xdi[Pivot[j]] / dxnorm; in lm_lmpar()
742 for (j = 0; j < n; j++) { in lm_lmpar()
743 aux[j] = aux[j] / Sdiag[j]; in lm_lmpar()
744 for (i = j+1; i < n; i++) in lm_lmpar()
745 aux[i] -= r[j*ldr+i] * aux[j]; in lm_lmpar()
807 int i, j, k, kmax; in lm_qrfac() local
816 for (j = 0; j < n; j++) { in lm_qrfac()
817 W[j] = Rdiag[j] = Acnorm[j] = lm_enorm(m, &A[j*m]); in lm_qrfac()
818 Pivot[j] = j; in lm_qrfac()
823 for (j = 0; j < n; j++) { in lm_qrfac()
826 kmax = j; in lm_qrfac()
827 for (k = j+1; k < n; k++) in lm_qrfac()
831 if (kmax != j) { in lm_qrfac()
833 k = Pivot[j]; in lm_qrfac()
834 Pivot[j] = Pivot[kmax]; in lm_qrfac()
837 temp = A[j*m+i]; in lm_qrfac()
838 A[j*m+i] = A[kmax*m+i]; in lm_qrfac()
842 Rdiag[kmax] = Rdiag[j]; in lm_qrfac()
843 W[kmax] = W[j]; in lm_qrfac()
848 ajnorm = lm_enorm(m-j, &A[j*m+j]); in lm_qrfac()
850 Rdiag[j] = 0; in lm_qrfac()
856 if (A[j*m+j] < 0) in lm_qrfac()
858 for (i = j; i < m; i++) in lm_qrfac()
859 A[j*m+i] /= ajnorm; in lm_qrfac()
860 A[j*m+j] += 1; in lm_qrfac()
864 for (k = j+1; k < n; k++) { in lm_qrfac()
867 for (i = j; i < m; i++) in lm_qrfac()
868 sum += A[j*m+i] * A[k*m+i]; in lm_qrfac()
871 temp = sum / A[j*m+j]; in lm_qrfac()
874 for (i = j; i < m; i++) in lm_qrfac()
875 A[k*m+i] -= temp * A[j*m+i]; in lm_qrfac()
879 temp = A[m*k+j] / Rdiag[k]; in lm_qrfac()
886 Rdiag[k] = lm_enorm(m-j-1, &A[m*k+j+1]); in lm_qrfac()
892 Rdiag[j] = -ajnorm; in lm_qrfac()
963 int i, kk, j, k, nsing; in lm_qrsolv() local
970 for (j = 0; j < n; j++) { in lm_qrsolv()
971 for (i = j; i < n; i++) in lm_qrsolv()
972 r[j*ldr+i] = r[i*ldr+j]; in lm_qrsolv()
973 x[j] = r[j*ldr+j]; in lm_qrsolv()
974 W[j] = qtb[j]; in lm_qrsolv()
979 for (j = 0; j < n; j++) { in lm_qrsolv()
984 if (diag[Pivot[j]] != 0) { in lm_qrsolv()
985 for (k = j; k < n; k++) in lm_qrsolv()
987 Sdiag[j] = diag[Pivot[j]]; in lm_qrsolv()
994 for (k = j; k < n; k++) { in lm_qrsolv()
1029 Sdiag[j] = r[j*ldr+j]; in lm_qrsolv()
1030 r[j*ldr+j] = x[j]; in lm_qrsolv()
1037 for (j = 0; j < n; j++) { in lm_qrsolv()
1038 if (Sdiag[j] == 0 && nsing == n) in lm_qrsolv()
1039 nsing = j; in lm_qrsolv()
1041 W[j] = 0; in lm_qrsolv()
1044 for (j = nsing-1; j >= 0; j--) { in lm_qrsolv()
1046 for (i = j+1; i < nsing; i++) in lm_qrsolv()
1047 sum += r[j*ldr+i] * W[i]; in lm_qrsolv()
1048 W[j] = (W[j] - sum) / Sdiag[j]; in lm_qrsolv()
1053 for (j = 0; j < n; j++) in lm_qrsolv()
1054 x[Pivot[j]] = W[j]; in lm_qrsolv()