亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? lmmin.c

?? Levenberg-Marquardt最小二乘擬合
?? C
?? 第 1 頁 / 共 3 頁
字號:
	}#if BUG>1	/* DEBUG: print the entire matrix */	for (i = 0; i < m; i++) {	    for (j = 0; j < n; j++)		printf("%.5e ", fjac[j * m + i]);	    printf("\n");	}#endif/*** outer: compute the qr factorization of the jacobian. ***/	lm_qrfac(m, n, fjac, 1, ipvt, wa1, wa2, wa3);	if (iter == 1) { /* first iteration */	    if (mode != 2) {                /* diag := norms of the columns of the initial jacobian */		for (j = 0; j < n; j++) {		    diag[j] = wa2[j];		    if (wa2[j] == 0.)			diag[j] = 1.;		}	    }            /* use diag to scale x, then calculate the norm */	    for (j = 0; j < n; j++)		wa3[j] = diag[j] * x[j];	    xnorm = lm_enorm(n, wa3);            /* initialize the step bound delta. */	    delta = factor * xnorm;	    if (delta == 0.)		delta = factor;	}/*** outer: form (q transpose)*fvec and store first n components in qtf. ***/	for (i = 0; i < m; i++)	    wa4[i] = fvec[i];	for (j = 0; j < n; j++) {	    temp3 = fjac[j * m + j];	    if (temp3 != 0.) {		sum = 0;		for (i = j; i < m; i++)		    sum += fjac[j * m + i] * wa4[i];		temp = -sum / temp3;		for (i = j; i < m; i++)		    wa4[i] += fjac[j * m + i] * temp;	    }	    fjac[j * m + j] = wa1[j];	    qtf[j] = wa4[j];	}/** outer: compute norm of scaled gradient and test for convergence. ***/	gnorm = 0;	if (fnorm != 0) {	    for (j = 0; j < n; j++) {		if (wa2[ipvt[j]] == 0)		    continue;		sum = 0.;		for (i = 0; i <= j; i++)		    sum += fjac[j * m + i] * qtf[i] / fnorm;		gnorm = MAX(gnorm, fabs(sum / wa2[ipvt[j]]));	    }	}	if (gnorm <= gtol) {	    *info = 4;	    return;	}/*** outer: rescale if necessary. ***/	if (mode != 2) {	    for (j = 0; j < n; j++)		diag[j] = MAX(diag[j], wa2[j]);	}/*** the inner loop. ***/	do {#if BUG	    printf("lmdif/ inner loop iter=%d nfev=%d\n", iter, *nfev);#endif/*** inner: determine the levenberg-marquardt parameter. ***/	    lm_lmpar(n, fjac, m, ipvt, diag, qtf, delta, &par,		     wa1, wa2, wa3, wa4);/*** inner: store the direction p and x + p; calculate the norm of p. ***/	    for (j = 0; j < n; j++) {		wa1[j] = -wa1[j];		wa2[j] = x[j] + wa1[j];		wa3[j] = diag[j] * wa1[j];	    }	    pnorm = lm_enorm(n, wa3);/*** inner: on the first iteration, adjust the initial step bound. ***/	    if (*nfev <= 1 + n)		delta = MIN(delta, pnorm);            /* evaluate the function at x + p and calculate its norm. */	    *info = 0;	    (*evaluate) (wa2, m, wa4, data, info);	    (*printout) (n, x, m, wa4, data, 2, iter, ++(*nfev));	    if (*info < 0)		return; /* user requested break. */	    fnorm1 = lm_enorm(m, wa4);#if BUG	    printf("lmdif/ pnorm %.10e  fnorm1 %.10e  fnorm %.10e"		   " delta=%.10e par=%.10e\n",		   pnorm, fnorm1, fnorm, delta, par);#endif/*** inner: compute the scaled actual reduction. ***/	    if (p1 * fnorm1 < fnorm)		actred = 1 - SQR(fnorm1 / fnorm);	    else		actred = -1;/*** inner: compute the scaled predicted reduction and      the scaled directional derivative. ***/	    for (j = 0; j < n; j++) {		wa3[j] = 0;		for (i = 0; i <= j; i++)		    wa3[i] += fjac[j * m + i] * wa1[ipvt[j]];	    }	    temp1 = lm_enorm(n, wa3) / fnorm;	    temp2 = sqrt(par) * pnorm / fnorm;	    prered = SQR(temp1) + 2 * SQR(temp2);	    dirder = -(SQR(temp1) + SQR(temp2));/*** inner: compute the ratio of the actual to the predicted reduction. ***/	    ratio = prered != 0 ? actred / prered : 0;#if BUG	    printf("lmdif/ actred=%.10e prered=%.10e ratio=%.10e"		   " sq(1)=%.10e sq(2)=%.10e dd=%.10e\n",		   actred, prered, prered != 0 ? ratio : 0.,		   SQR(temp1), SQR(temp2), dirder);#endif/*** inner: update the step bound. ***/	    if (ratio <= p25) {		if (actred >= 0.)		    temp = p5;		else		    temp = p5 * dirder / (dirder + p5 * actred);		if (p1 * fnorm1 >= fnorm || temp < p1)		    temp = p1;		delta = temp * MIN(delta, pnorm / p1);		par /= temp;	    } else if (par == 0. || ratio >= p75) {		delta = pnorm / p5;		par *= p5;	    }/*** inner: test for successful iteration. ***/	    if (ratio >= p0001) {                /* yes, success: update x, fvec, and their norms. */		for (j = 0; j < n; j++) {		    x[j] = wa2[j];		    wa2[j] = diag[j] * x[j];		}		for (i = 0; i < m; i++)		    fvec[i] = wa4[i];		xnorm = lm_enorm(n, wa2);		fnorm = fnorm1;		iter++;	    }#if BUG	    else {		printf("ATTN: iteration considered unsuccessful\n");	    }#endif/*** inner: tests for convergence ( otherwise *info = 1, 2, or 3 ). ***/	    *info = 0; /* do not terminate (unless overwritten by nonzero) */	    if (fabs(actred) <= ftol && prered <= ftol && p5 * ratio <= 1)		*info = 1;	    if (delta <= xtol * xnorm)		*info += 2;	    if (*info != 0)		return;/*** inner: tests for termination and stringent tolerances. ***/	    if (*nfev >= maxfev)		*info = 5;	    if (fabs(actred) <= LM_MACHEP &&		prered <= LM_MACHEP && p5 * ratio <= 1)		*info = 6;	    if (delta <= LM_MACHEP * xnorm)		*info = 7;	    if (gnorm <= LM_MACHEP)		*info = 8;	    if (*info != 0)		return;/*** inner: end of the loop. repeat if iteration unsuccessful. ***/	} while (ratio < p0001);/*** outer: end of the loop. ***/    } while (1);} /*** lm_lmdif. ***/void lm_lmpar(int n, double *r, int ldr, int *ipvt, double *diag,	      double *qtb, double delta, double *par, double *x,	      double *sdiag, double *wa1, double *wa2){/*     Given an m by n matrix a, an n by n nonsingular diagonal *     matrix d, an m-vector b, and a positive number delta, *     the problem is to determine a value for the parameter *     par such that if x solves the system * *	    a*x = b  and  sqrt(par)*d*x = 0 * *     in the least squares sense, and dxnorm is the euclidean *     norm of d*x, then either par=0 and (dxnorm-delta) < 0.1*delta, *     or par>0 and abs(dxnorm-delta) < 0.1*delta. * *     This subroutine completes the solution of the problem *     if it is provided with the necessary information from the *     qr factorization, with column pivoting, of a. That is, if *     a*p = q*r, where p is a permutation matrix, q has orthogonal *     columns, and r is an upper triangular matrix with diagonal *     elements of nonincreasing magnitude, then lmpar expects *     the full upper triangle of r, the permutation matrix p, *     and the first n components of (q transpose)*b. On output *     lmpar also provides an upper triangular matrix s such that * *	     t	 t		     t *	    p *(a *a + par*d*d)*p = s *s. * *     s is employed within lmpar and may be of separate interest. * *     Only a few iterations are generally needed for convergence *     of the algorithm. If, however, the limit of 10 iterations *     is reached, then the output par will contain the best *     value obtained so far. * *     parameters: * *	n is a positive integer input variable set to the order of r. * *	r is an n by n array. on input the full upper triangle *	  must contain the full upper triangle of the matrix r. *	  on output the full upper triangle is unaltered, and the *	  strict lower triangle contains the strict upper triangle *	  (transposed) of the upper triangular matrix s. * *	ldr is a positive integer input variable not less than n *	  which specifies the leading dimension of the array r. * *	ipvt is an integer input array of length n which defines the *	  permutation matrix p such that a*p = q*r. column j of p *	  is column ipvt(j) of the identity matrix. * *	diag is an input array of length n which must contain the *	  diagonal elements of the matrix d. * *	qtb is an input array of length n which must contain the first *	  n elements of the vector (q transpose)*b. * *	delta is a positive input variable which specifies an upper *	  bound on the euclidean norm of d*x. * *	par is a nonnegative variable. on input par contains an *	  initial estimate of the levenberg-marquardt parameter. *	  on output par contains the final estimate. * *	x is an output array of length n which contains the least *	  squares solution of the system a*x = b, sqrt(par)*d*x = 0, *	  for the output par. * *	sdiag is an output array of length n which contains the *	  diagonal elements of the upper triangular matrix s. * *	wa1 and wa2 are work arrays of length n. * */    int i, iter, j, nsing;    double dxnorm, fp, fp_old, gnorm, parc, parl, paru;    double sum, temp;    static double p1 = 0.1;    static double p001 = 0.001;#if BUG    printf("lmpar\n");#endif/*** lmpar: compute and store in x the gauss-newton direction. if the     jacobian is rank-deficient, obtain a least squares solution. ***/    nsing = n;    for (j = 0; j < n; j++) {	wa1[j] = qtb[j];	if (r[j * ldr + j] == 0 && nsing == n)	    nsing = j;	if (nsing < n)	    wa1[j] = 0;    }#if BUG    printf("nsing %d ", nsing);#endif    for (j = nsing - 1; j >= 0; j--) {	wa1[j] = wa1[j] / r[j + ldr * j];	temp = wa1[j];	for (i = 0; i < j; i++)	    wa1[i] -= r[j * ldr + i] * temp;    }    for (j = 0; j < n; j++)	x[ipvt[j]] = wa1[j];/*** lmpar: initialize the iteration counter, evaluate the function at the     origin, and test for acceptance of the gauss-newton direction. ***/    iter = 0;    for (j = 0; j < n; j++)	wa2[j] = diag[j] * x[j];    dxnorm = lm_enorm(n, wa2);    fp = dxnorm - delta;    if (fp <= p1 * delta) {#if BUG	printf("lmpar/ terminate (fp<p1*delta)\n");#endif	*par = 0;	return;    }/*** lmpar: if the jacobian is not rank deficient, the newton     step provides a lower bound, parl, for the 0. of     the function. otherwise set this bound to 0.. ***/    parl = 0;    if (nsing >= n) {	for (j = 0; j < n; j++)	    wa1[j] = diag[ipvt[j]] * wa2[ipvt[j]] / dxnorm;	for (j = 0; j < n; j++) {	    sum = 0.;	    for (i = 0; i < j; i++)		sum += r[j * ldr + i] * wa1[i];	    wa1[j] = (wa1[j] - sum) / r[j + ldr * j];	}	temp = lm_enorm(n, wa1);	parl = fp / delta / temp / temp;    }/*** lmpar: calculate an upper bound, paru, for the 0. of the function. ***/    for (j = 0; j < n; j++) {	sum = 0;	for (i = 0; i <= j; i++)	    sum += r[j * ldr + i] * qtb[i];	wa1[j] = sum / diag[ipvt[j]];    }    gnorm = lm_enorm(n, wa1);    paru = gnorm / delta;    if (paru == 0.)	paru = LM_DWARF / MIN(delta, p1);/*** lmpar: if the input par lies outside of the interval (parl,paru),     set par to the closer endpoint. ***/    *par = MAX(*par, parl);    *par = MIN(*par, paru);    if (*par == 0.)	*par = gnorm / dxnorm;#if BUG    printf("lmpar/ parl %.4e  par %.4e  paru %.4e\n", parl, *par, paru);#endif/*** lmpar: iterate. ***/    for (;; iter++) {        /** evaluate the function at the current value of par. **/	if (*par == 0.)	    *par = MAX(LM_DWARF, p001 * paru);	temp = sqrt(*par);	for (j = 0; j < n; j++)	    wa1[j] = temp * diag[j];	lm_qrsolv(n, r, ldr, ipvt, wa1, qtb, x, sdiag, wa2);	for (j = 0; j < n; j++)	    wa2[j] = diag[j] * x[j];	dxnorm = lm_enorm(n, wa2);	fp_old = fp;	fp = dxnorm - delta;                /** if the function is small enough, accept the current value            of par. Also test for the exceptional cases where parl            is zero or the number of iterations has reached 10. **/	if (fabs(fp) <= p1 * delta	    || (parl == 0. && fp <= fp_old && fp_old < 0.)	    || iter == 10)	    break; /* the only exit from the iteration. */                /** compute the Newton correction. **/	for (j = 0; j < n; j++)	    wa1[j] = diag[ipvt[j]] * wa2[ipvt[j]] / dxnorm;	for (j = 0; j < n; j++) {	    wa1[j] = wa1[j] / sdiag[j];	    for (i = j + 1; i < n; i++)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区资源| 国产乱码精品一区二区三| 亚洲欧美日韩系列| 亚洲国产高清在线观看视频| 久久久久久97三级| 久久久精品人体av艺术| 久久久99久久| 久久你懂得1024| 久久久.com| 国产精品美女www爽爽爽| 中文字幕的久久| 一区在线播放视频| 亚洲精品高清视频在线观看| 伊人一区二区三区| 亚洲国产另类av| 秋霞电影网一区二区| 久久福利视频一区二区| 韩国理伦片一区二区三区在线播放 | 精品99999| 久久久久久日产精品| 国产欧美日韩在线看| 亚洲欧美一区二区不卡| 亚洲国产日韩a在线播放性色| 香蕉久久一区二区不卡无毒影院 | 九一九一国产精品| 国产另类ts人妖一区二区| 国产精品一区二区三区99| 国产精品亚洲第一区在线暖暖韩国| 国产在线视频不卡二| 亚洲观看高清完整版在线观看| 午夜在线成人av| 日本最新不卡在线| 国精产品一区一区三区mba桃花| 国产一区二区三区免费观看| 激情综合色播激情啊| 国产福利不卡视频| av一区二区三区在线| 色视频成人在线观看免| 欧美少妇xxx| 91精品国产综合久久福利 | 国产欧美日韩三级| 亚洲欧洲国产日韩| 亚洲综合在线视频| 视频在线观看一区二区三区| 精品一区二区三区免费| 国产91露脸合集magnet| 色综合一个色综合亚洲| 欧美高清www午色夜在线视频| 日韩精品专区在线影院观看| 久久先锋影音av鲁色资源| 中文字幕亚洲成人| 偷拍自拍另类欧美| 美女任你摸久久| 丁香一区二区三区| 高清久久久久久| 91麻豆成人久久精品二区三区| 欧美系列日韩一区| 欧美zozozo| 国产亚洲精品久| 亚洲小少妇裸体bbw| 精彩视频一区二区三区| 91麻豆成人久久精品二区三区| 欧美精品高清视频| 久久精品亚洲一区二区三区浴池| 亚洲欧美另类综合偷拍| 亚洲第一二三四区| 久久se精品一区精品二区| 91美女片黄在线观看| 精品久久国产字幕高潮| 综合在线观看色| 久久精品国产一区二区| 99久久精品久久久久久清纯| 欧美一区二区三区色| 亚洲天堂免费看| 九九在线精品视频| 欧洲国内综合视频| 久久久夜色精品亚洲| 亚洲午夜精品久久久久久久久| 国产真实乱子伦精品视频| 91激情五月电影| 国产日韩三级在线| 日本va欧美va精品发布| av不卡在线播放| 精品国产污网站| 日欧美一区二区| 成人福利视频在线| 精品日韩一区二区| 亚洲激情自拍视频| 国产精品原创巨作av| 91精品婷婷国产综合久久性色| 最新高清无码专区| 国模一区二区三区白浆| 欧美亚洲禁片免费| 国产精品国产三级国产aⅴ无密码| 免费欧美高清视频| 欧美日韩在线播放| 怡红院av一区二区三区| 成人黄色电影在线| 精品国精品国产| 日韩电影在线看| 色哟哟一区二区在线观看| 91精品欧美综合在线观看最新| 久久精品人人做| 一区二区免费视频| 91热门视频在线观看| 国产精品成人在线观看| 国产精品66部| 久久香蕉国产线看观看99| 亚洲午夜久久久久中文字幕久| 国产成人av影院| 亚洲国产高清在线| 成人国产一区二区三区精品| 久久先锋资源网| 国产九九视频一区二区三区| 久久亚洲影视婷婷| 国产美女主播视频一区| 久久久99精品久久| 国产91精品久久久久久久网曝门| 久久久久久久久免费| 国产精品自拍一区| 久久久一区二区三区| 精品一区二区三区香蕉蜜桃 | 日韩欧美激情四射| 轻轻草成人在线| 日韩欧美亚洲另类制服综合在线| 日韩精品国产欧美| 欧美成人在线直播| 国产成人午夜视频| 国产精品久久久久一区二区三区| av电影在线不卡| 亚洲欧洲日韩综合一区二区| 懂色av中文一区二区三区| 综合亚洲深深色噜噜狠狠网站| 91看片淫黄大片一级在线观看| 亚洲天堂成人在线观看| 在线视频你懂得一区| 亚洲1区2区3区4区| 91麻豆精品国产自产在线观看一区 | 亚洲午夜久久久久久久久电影院 | 椎名由奈av一区二区三区| 91高清视频免费看| 肉肉av福利一精品导航| 精品国产人成亚洲区| 国产aⅴ综合色| 亚洲另类春色国产| 欧美一卡二卡三卡四卡| 精品一区二区三区免费毛片爱| 国产午夜亚洲精品午夜鲁丝片| 99re在线视频这里只有精品| 国产精品久久久一本精品| 91精品91久久久中77777| 亚洲777理论| 久久色在线观看| 99久久夜色精品国产网站| 亚洲国产视频一区二区| 精品捆绑美女sm三区| jizz一区二区| 日韩毛片高清在线播放| 欧美三级午夜理伦三级中视频| 九九在线精品视频| 亚洲四区在线观看| 欧美一级片免费看| 成人久久18免费网站麻豆| 亚洲午夜激情av| 国产亚洲精品aa| 欧美日韩中文另类| 国精产品一区一区三区mba桃花 | 欧美日韩国产一区二区三区地区| 国产一区啦啦啦在线观看| 亚洲天堂免费在线观看视频| 日韩午夜精品电影| 9l国产精品久久久久麻豆| 日本一不卡视频| 18成人在线观看| 精品国产乱码久久久久久闺蜜 | 青青草97国产精品免费观看无弹窗版| 久久伊人中文字幕| 欧美色男人天堂| 激情欧美日韩一区二区| 亚洲精品国产一区二区三区四区在线| 日韩一区二区视频| 91国偷自产一区二区三区观看| 精品亚洲欧美一区| 午夜精品久久一牛影视| 欧美精品丝袜中出| 久久超碰97人人做人人爱| 一区二区三区加勒比av| 久久精品视频一区二区三区| 制服视频三区第一页精品| 色哟哟精品一区| 国产精品1024久久| 美女一区二区久久| 亚洲一线二线三线视频| 中文在线资源观看网站视频免费不卡| 制服丝袜亚洲网站| 欧美亚洲国产bt| 99精品国产一区二区三区不卡| 福利一区二区在线| 美女一区二区三区在线观看| 午夜影视日本亚洲欧洲精品|