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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? linesearchforthewolfeconditions.java

?? 化學圖形處理軟件
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package org.openscience.cdk.modeling.forcefield;import javax.vecmath.GVector;//import org.openscience.cdk.tools.LoggingTool;/** *  * * @author     vlabarta *@cdk.module     forcefield *  */public class LineSearchForTheWolfeConditions {		//initial values	private GVector x = null;	private double linearFunctionInAlpha0;	private GVector dfx = null;	private GVector direction = null;	private double linearFunctionDerivativeInAlpha0;	private IPotentialFunction pf = null;	private double alphaInitialStep;		//line search algorithm	private double[] alpha = new double[3];	private double[] linearFunctionInAlpha = new double[3];	private double[] linearFunctionDerivativeInAlpha = new double[3];	private GVector[] dfInAlpha = new GVector[3];	private double[] brentStep = new double[3];	private final double c1 = 0.0001;	private double c2;		//private double linearFunctionGoldenAlpha;	private double linearFunctionAlphaInterpolation;		public boolean derivativeSmallEnough = true;	public double alphaOptimum;	public double linearFunctionInAlphaOptimum;	public GVector dfOptimum = null;		//zoom	private double alphaj;	private double linearFunctionInAlphaj;	private double linearFunctionDerivativeInAlphaj;	private GVector dfInAlphaj;	private int functionEvaluationNumber;		//energy function evaluation	private GVector xAlpha = null;	//interpolation	private double a;	private double b;		//cubic interpolation	private double alphaTemporal;	private double linearFunctionInAlphaTemporal;	private double linearFunctionDerivativeInAlphaTemporal;	private double d1;	private double d2;	private double alphaiplus1;		//private LoggingTool logger;		public LineSearchForTheWolfeConditions(IPotentialFunction pfUser, String method) {		this.pf = pfUser;		if ((method == "sdm") | (method == "cgm")) {c2 = 0.07;}		else {c2 = 0.9;} 	}		public void initialize(GVector xUser, double fxUser, GVector dfxUser, GVector directionUser, double linearFunctionDerivativeUser, double alphaInitialStepUser) {		this.x = xUser;		this.linearFunctionInAlpha0 = fxUser;		this.dfx = dfxUser;		//logger.debug("derivativeSmallEnough = " + this.derivativeSmallEnough);		this.direction = directionUser;		this.linearFunctionDerivativeInAlpha0 = linearFunctionDerivativeUser;		//logger.debug("linearFunctionDerivativeInAlpha0 = " + linearFunctionDerivativeInAlpha0);		this.alphaOptimum = 0;		this.linearFunctionInAlphaOptimum = linearFunctionInAlpha0;		dfOptimum = this.dfx;		this.alphaInitialStep = alphaInitialStepUser;		this.derivativeSmallEnough = false;		this.xAlpha = new GVector(x.getSize());	}		 /*	Line Search Algorithm for the Wolfe conditions. Jorge Nocedal and Stephen J.Wright. Numerical Optimization. 1999.	 * The algorithm has two stages. This first stage begins with a trial estimate alpha1, 	 * and keeps increasing it until it finds either an acceptable step length or an interval 	 * that brackets the desired step lengths. In the later case, the second stage is invoked 	 * by calling a function called zoom, which successively decreases the size of the interval 	 * until an acceptable step length is identified. 	 * 	 * @param alphaMax				Maximum step length	 */	public void lineSearchAlgorithm (double alphaMax) {				//logger.debug("Line search for the strong wolfe conditions");		alpha[0] = 0.0;		linearFunctionInAlpha[0] = linearFunctionInAlpha0; 		linearFunctionDerivativeInAlpha[0] = linearFunctionDerivativeInAlpha0;	//To Analyse the possibility of eliminate linearFunctionDerivativeInAlpha[0]		dfInAlpha[0] = this.dfx;				alpha[1] = this.alphaInitialStep;				//logger.debug("alpha[1] = this.alphaInitialStep = " + alpha[1]);				brentStep[0] = alpha[0];		brentStep[1] = alpha[1];				int i=1;				this.functionEvaluationNumber = 0;		if (alpha[1] > alphaMax) {			alpha[1] = alphaMax;			//logger.debug("line search algorithm error: alphaInitialStep > alphaMax");		}		//	alpha[1] = alphaMax/2;		//}		try {		do {			if (alpha[1] == 0) {				System.out.println("alpha[1] == 0");				break;			}						//logger.debug("alpha[" + i + "] = " + alpha[i]);			linearFunctionInAlpha[i] = evaluateEnergyFunction(alpha[i]);			//logger.debug("linearFunctionInAlpha[" + i + "] = " + linearFunctionInAlpha[i]);						if ((linearFunctionInAlpha[i] > linearFunctionInAlpha[0] + c1 * alpha[i] * linearFunctionDerivativeInAlpha[0]) | 					((linearFunctionInAlpha[i] >= linearFunctionInAlpha[i-1]) & (i>1))) {			//The interval alpha[i-1] and alpha[i] brackets the desired step lengths.				//logger.debug("zoom(" + alpha[i-1] + ", " + linearFunctionInAlpha[i-1] + ", " + linearFunctionDerivativeInAlpha[i-1] + ", " + dfInAlpha[i-1] + ", " + alpha[i] + ", " + linearFunctionInAlpha[i] + ")");				//dfInAlpha[i] = evaluateEnergyFunctionDerivative(alpha[i]);				//linearFunctionDerivativeInAlpha[i] = dfInAlpha[i].dot(direction);				//zoom(alpha[i-1], linearFunctionInAlpha[i-1], linearFunctionDerivativeInAlpha[i-1], dfInAlpha[i-1], alpha[i], linearFunctionInAlpha[i], linearFunctionDerivativeInAlpha[i], dfInAlpha[i]);				zoom(alpha[i-1], linearFunctionInAlpha[i-1], linearFunctionDerivativeInAlpha[i-1], dfInAlpha[i-1], alpha[i], linearFunctionInAlpha[i]);				break;			} 			//The first strong Wolfe condition is satisfied for alpha[i].			dfInAlpha[i] = evaluateEnergyFunctionDerivative(alpha[i]);			//logger.debug("dfOptimum = " + dfOptimum);			linearFunctionDerivativeInAlpha[i] = dfInAlpha[i].dot(direction);			//logger.debug("linearFunctionDerivativeInAlpha[" + i + "] = " + linearFunctionDerivativeInAlpha[i]);						if (Math.abs(linearFunctionDerivativeInAlpha[i]) <= -c2 * linearFunctionDerivativeInAlpha[0]) { //The second strong Wolfe condition is also satisfied for alpha[i]				//logger.debug("The second strong Wolfe condition is also satisfied for " + alpha[i]);				alphaOptimum = alpha[i];				linearFunctionInAlphaOptimum = linearFunctionInAlpha[i];				dfOptimum = dfInAlpha[i];				//logger.debug("alphaOptimun = " + alphaOptimum);				//logger.debug("linearFunctionInAlphaOptimun = " + linearFunctionInAlphaOptimum);				//logger.debug("dfOptimum = " + dfOptimum);				this.derivativeSmallEnough = true;				break;			}						if (linearFunctionDerivativeInAlpha[i] >= 0) {		//The interval alpha[i-1] and alpha[i] brackets the desired step lengths.				/*System.out.println("zoom(" + alpha[i-1] + ", " + linearFunctionInAlpha[i-1] + ", " + linearFunctionDerivativeInAlpha[i-1] + ", " + dfInAlpha[i-1] + ", " + 						alpha[i] + ", " + linearFunctionInAlpha[i] + ")");*/								/*zoom(alpha[i], linearFunctionInAlpha[i], linearFunctionDerivativeInAlpha[i], dfInAlpha[i], 						alpha[i-1], linearFunctionInAlpha[i-1], linearFunctionDerivativeInAlpha[i], dfInAlpha[i]);*/				zoom(alpha[i-1], linearFunctionInAlpha[i-1], linearFunctionDerivativeInAlpha[i-1], dfInAlpha[i-1], 						alpha[i], linearFunctionInAlpha[i]);				break;			}					if (alpha[i] == alphaMax) {					//logger.debug("LINE SEARCH ALGORITHM WAS TERMINATE EARLIER BECAUSE alpha[i] == alphaMax");				alphaOptimum = alpha[i];				linearFunctionInAlphaOptimum = linearFunctionInAlpha[i];				dfOptimum = dfInAlpha[i];				//logger.debug("alphaOptimun = " + alphaOptimum);				//logger.debug("linearFunctionInAlphaOptimun = " + linearFunctionInAlphaOptimum);				//logger.debug("dfOptimum = " + dfOptimum);				break;			}						functionEvaluationNumber = functionEvaluationNumber + 1;			if (functionEvaluationNumber == 10) {				//logger.debug("LINE SEARCH ALGORITHM WAS TERMINATE EARLIER BECAUSE functionEvaluationNumber == 10");				alphaOptimum = alpha[i];				linearFunctionInAlphaOptimum = linearFunctionInAlpha[i];				dfOptimum = dfInAlpha[i];				//logger.debug("alphaOptimun = " + alphaOptimum);				//logger.debug("linearFunctionInAlphaOptimun = " + linearFunctionInAlphaOptimum);				//logger.debug("dfOptimum = " + dfOptimum);				break;			}						if (i>1) {				brentStep[0] = brentStep[1];				brentStep[1] = brentStep[2];				alpha[1] = alpha[2];				linearFunctionInAlpha[1] = linearFunctionInAlpha[2];				linearFunctionDerivativeInAlpha[1] = linearFunctionDerivativeInAlpha[2];				dfInAlpha[1] = dfInAlpha[2];			} 						brentStep[2] = brentStep[1] + 1.618 * (brentStep[1]-brentStep[0]);			//logger.debug("brentStep[2] = " + brentStep[2]);			if (brentStep[2] > alphaMax) {brentStep[2] = alphaMax;}			/*linearFunctionInBrentStep = this.evaluateEnergyFunction(brentStep[2]);			linearFunctionDerivativeInBrentStep = this.evaluateEnergyFunctionDerivative(brentStep[2]).dot(direction);			*/			alpha[2] = brentStep[2];			/*alpha[2] = this.cubicInterpolation(alpha[1], linearFunctionInAlpha[1], linearFunctionDerivativeInAlpha[1], 					brentStep[2], linearFunctionInBrentStep, linearFunctionDerivativeInBrentStep, alpha[1], brentStep[2]);					*/			i=2;					} while ((alpha[2] <= alphaMax) & (alpha[1] < alpha[2]) & (functionEvaluationNumber < 10));				} catch (Exception exception) {        	System.out.println("Line search for the strong wolfe conditions: " + exception.getMessage());        	System.out.println(exception);        }			}		 /*	Each iteration of zoom generates an iterate alphaj between alphaLow and alphaHigh, 	 * and then replaces one of these endpoints by alphaj in such a way that the properties 	 * (a), (b) and (c) continue to hold.	 * (a)The interval bounded by alphaLow and alphaHigh contains step lengths that satisfy the strong Wolfe conditions.       * (b)alphaLow is, among all step lengths generated so far and satisfying the sufficient decrease condition,      * the one giving the smallest function value.     * (c)alphaHigh is chosen so that linearFunctionDerivativeInAlphaj * (alphaHigh-alphaLow) < 0     *      	 *@param  alphaLow              				Among all step lengths generated so far and satisfying the sufficient decrease condition, the one giving the smallest function value.   	 *@param  linearFunctionInAlphaLow       		Function value at alphaLow.   	 *@param  linearFunctionDerivativeInAlphaLow	Derivative value at alphaLow.   	 *@param  dfInAlphaLow              			Gradient at alphaLow.   	 *@param  alphaHigh              				AlphaHigh is chosen so that linearFunctionDerivativeInAlphaj * (alphaHigh-alphaLow) < 0   	 *@param  linearFunctionInAlphaHigh             Function value at alphaHigh.	 */	private void zoom (double alphaLow, double linearFunctionInAlphaLow, double linearFunctionDerivativeInAlphaLow, GVector dfInAlphaLow, 			double alphaHigh, double linearFunctionInAlphaHigh) {				//logger.debug("zoom");				functionEvaluationNumber = 0;				/*double a;		double b;		if (alphaLow < alphaHigh) {a = alphaLow; b = alphaHigh;}		else {a = alphaHigh; b = alphaLow;}		*/				do {			//Interpolation 						//alphaj = this.cubicInterpolation(alphaLow, linearFunctionInAlphaLow, linearFunctionDerivativeInAlphaLow, alphaHigh, linearFunctionInAlphaHigh, linearFunctionDerivativeInAlphaHigh, a, b);			/*System.out.println("interpolation(" + alphaLow + ", " + linearFunctionInAlphaLow + ", " + linearFunctionDerivativeInAlphaLow + ", "					+ alphaHigh + ", " + linearFunctionInAlphaHigh + ");");*/			alphaj = this.interpolation(alphaLow, linearFunctionInAlphaLow, linearFunctionDerivativeInAlphaLow, alphaHigh, linearFunctionInAlphaHigh);			//logger.debug("alphaj = " + alphaj);			linearFunctionInAlphaj = this.linearFunctionAlphaInterpolation;			//logger.debug("linearFunctionInAlphaj = " + linearFunctionInAlphaj);						if ((linearFunctionInAlphaj > linearFunctionInAlpha0 + c1 * alphaj * linearFunctionDerivativeInAlpha0) | //The interval 0 and alphaj brackets the desired step lengths.					(linearFunctionInAlphaj >= linearFunctionInAlphaLow)) {							//logger.debug("The minimum is between alpha1 and alphaj");				alphaHigh = alphaj;				linearFunctionInAlphaHigh = linearFunctionInAlphaj;				//dfInAlphaHigh = this.evaluateEnergyFunctionDerivative(alphaHigh); 				//linearFunctionDerivativeInAlphaHigh = dfInAlphaHigh.dot(direction);			} 			else {				dfInAlphaj = evaluateEnergyFunctionDerivative(alphaj);				linearFunctionDerivativeInAlphaj = dfInAlphaj.dot(direction);				//logger.debug("linearFunctionDerivativeInAlphaj = " + linearFunctionDerivativeInAlphaj);				if (Math.abs(linearFunctionDerivativeInAlphaj) <= -c2 * linearFunctionDerivativeInAlpha0) { //alphaj satisfied the second strong Wolfe condition.					//logger.debug("Derivative small enough : " + Math.abs(linearFunctionDerivativeInAlphaj) + " <= " + (-c2 * linearFunctionDerivativeInAlpha0));					this.derivativeSmallEnough = true;					alphaOptimum = alphaj;					linearFunctionInAlphaOptimum = linearFunctionInAlphaj;					dfOptimum = dfInAlphaj;					//logger.debug("alphaOptimun = " + alphaOptimum);					//logger.debug("linearFunctionInAlphaOptimun = " + linearFunctionInAlphaOptimum);					break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜精品17c| 亚洲美女电影在线| 美女久久久精品| 欧美一区二区三区视频免费播放| 亚洲人成网站色在线观看| 97国产一区二区| 亚洲综合色噜噜狠狠| 国内久久精品视频| 国产喂奶挤奶一区二区三区| av影院午夜一区| 男女性色大片免费观看一区二区| 久久久高清一区二区三区| 欧美日韩免费高清一区色橹橹| 天天影视涩香欲综合网| 久久久久国色av免费看影院| 国产成人av电影在线播放| 亚洲欧美日韩一区二区三区在线观看| 日本黄色一区二区| 久久精品999| 专区另类欧美日韩| 欧美顶级少妇做爰| 国产精品自拍三区| 亚洲午夜免费电影| 国产精品视频你懂的| 一本一本久久a久久精品综合麻豆| 亚洲国产精品综合小说图片区| 日韩欧美色综合| 666欧美在线视频| 91免费看片在线观看| 久久福利视频一区二区| 亚洲一级在线观看| 18欧美亚洲精品| 欧美成人一级视频| 欧洲一区在线观看| 在线免费观看日本一区| 成人精品高清在线| 91在线一区二区三区| 国产91在线看| 一本大道av一区二区在线播放| 久久99国产精品免费网站| 丝袜亚洲另类欧美| 麻豆精品视频在线观看免费| 亚洲黄色av一区| 最好看的中文字幕久久| 国产欧美日韩精品在线| 中文字幕乱码亚洲精品一区| 亚洲国产精品黑人久久久| 国产精品久久久久久久久免费丝袜| 欧美国产丝袜视频| 日韩一区中文字幕| 日韩av中文字幕一区二区三区 | 国产美女精品人人做人人爽| 国产一区二区三区在线观看免费| jlzzjlzz欧美大全| 色综合久久久久网| 欧美一个色资源| 日韩欧美一区中文| 精品999在线播放| 樱花草国产18久久久久| 亚洲一区二区三区激情| 国产成人免费视频网站高清观看视频 | 欧美中文字幕一区二区三区亚洲| 精品视频一区三区九区| 精品久久久久久久久久久久包黑料 | 在线观看一区二区视频| 国产精品国产三级国产普通话99 | 国产精品网站在线| 麻豆91免费观看| 欧美日韩精品电影| 中文字幕一区二区三区蜜月| 狠狠色丁香九九婷婷综合五月| av资源网一区| 亚洲柠檬福利资源导航| 成人免费视频免费观看| 久久久久久久久伊人| 日韩精品一二三四| 国产一区高清在线| 精品裸体舞一区二区三区| 亚洲国产sm捆绑调教视频| 在线视频观看一区| 亚洲午夜精品网| 欧美大片一区二区| 国产一区二区免费在线| 国产视频视频一区| 成人伦理片在线| 亚洲第一综合色| 精品国产免费一区二区三区四区| 麻豆视频一区二区| 国产精品伦一区| 欧美性感一区二区三区| 午夜欧美一区二区三区在线播放| 在线播放欧美女士性生活| 日韩福利电影在线观看| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 日韩欧美一区电影| 91亚洲精品一区二区乱码| 日韩成人午夜精品| 国产精品网站一区| 欧美一级高清片在线观看| www.欧美.com| 久久国产精品区| 91精品国产乱码| 91麻豆国产福利在线观看| 琪琪久久久久日韩精品| 中文字幕亚洲区| 久久久久久久综合| 欧美电影免费观看完整版| 99久久精品国产网站| 国产成人欧美日韩在线电影| 男女激情视频一区| 日韩精品三区四区| 亚洲另类一区二区| 亚洲欧美综合在线精品| 久久久99久久精品欧美| 精品国产乱码久久久久久图片| 欧美亚洲动漫精品| 欧美性猛交一区二区三区精品| 高清国产一区二区三区| 国产精品99久久久久久有的能看| 日日摸夜夜添夜夜添精品视频| 亚洲一区二区三区在线看| 一区二区三区自拍| 亚洲电影激情视频网站| 一区二区三区四区国产精品| 中文字幕免费一区| 亚洲精品综合在线| 亚洲bt欧美bt精品777| 综合亚洲深深色噜噜狠狠网站| 综合色中文字幕| 亚洲精品美国一| 亚洲国产成人tv| 69堂成人精品免费视频| 欧美图区在线视频| 欧美高清视频在线高清观看mv色露露十八 | 中文字幕不卡在线| 亚洲一区二区三区中文字幕在线| 性做久久久久久久久| 激情综合五月天| 不卡影院免费观看| 91精品国产一区二区三区| 精品国产乱码久久久久久老虎| 国产欧美日韩在线看| 一二三四社区欧美黄| 粉嫩久久99精品久久久久久夜| 色综合久久久久久久久| 久久综合九色欧美综合狠狠| 欧美国产精品专区| 狠狠网亚洲精品| 在线播放国产精品二区一二区四区| 久久久国产一区二区三区四区小说 | 韩国一区二区三区| 91精品欧美久久久久久动漫 | 色综合视频在线观看| xnxx国产精品| 国产精品色一区二区三区| 亚洲日本乱码在线观看| 老司机精品视频在线| 欧美三级在线播放| 亚洲日本丝袜连裤袜办公室| 国产99一区视频免费| 久久久噜噜噜久久中文字幕色伊伊| 午夜久久久久久| 欧美日韩一级片在线观看| 一区二区三区免费在线观看| 成人av在线播放网址| 国产精品色在线| 91免费版在线看| 一区二区欧美国产| 色国产综合视频| 亚洲精品成人a在线观看| 欧洲一区在线观看| 亚洲第一激情av| 欧美不卡一区二区| 91麻豆免费在线观看| 日韩综合一区二区| 久久综合资源网| www.日韩在线| 日韩高清一区在线| 国产欧美日韩亚州综合| 欧洲在线/亚洲| 黑人精品欧美一区二区蜜桃 | 欧美亚洲图片小说| 韩国成人在线视频| 一区二区三区不卡在线观看| 欧美剧情电影在线观看完整版免费励志电影 | 亚洲国产电影在线观看| 91成人免费网站| 国产一区高清在线| 亚洲一区在线观看网站| 久久嫩草精品久久久精品| 99re视频这里只有精品| 日本不卡高清视频| 亚洲大片在线观看| 亚洲欧美在线视频观看| 日韩免费在线观看| 欧美日韩精品一区二区天天拍小说| 久久国产精品色| 秋霞影院一区二区| 青青青爽久久午夜综合久久午夜| 1024精品合集|