使用pso求最小化一函數(shù) matlab程式碼,寫(xiě)的非常簡(jiǎn)潔(不到100行),且還包括了2維的圖形展示,和大家分享參考!!! 一起學(xué)習(xí)matlab和各種optimize methods 最小化:(x-15)^2+(y-20)^2 The swarm matrix is swarm(index, [location, velocity, best position, best value], [x, y components or the value component]) Author: Wesam ELSHAMY (wesamelshamy@yahoo.com) MSc Student, Electrical Enginering Dept., Faculty of Engineering Cairo University, Egypt
上傳時(shí)間: 2013-12-18
上傳用戶(hù):zhaiye
鄰接矩陣類(lèi)的根是A d j a c e n c y W D i g r a p h,因此從這個(gè)類(lèi)開(kāi)始。程序1 2 - 1給出了類(lèi)的描述。程 序中,先用程序1 - 1 3中函數(shù)Make2DArray 為二組數(shù)組a 分配空間,然后對(duì)數(shù)組a 初始化,以描述 一個(gè)n 頂點(diǎn)、沒(méi)有邊的圖的鄰接矩陣,其復(fù)雜性為( n2 )。該代碼沒(méi)有捕獲可能由M a k e 2 D A r r a y 引發(fā)的異常。在析構(gòu)函數(shù)中調(diào)用了程序1 - 1 4中的二維數(shù)組釋放函數(shù)D e l e t e 2 D
標(biāo)簽: 矩陣
上傳時(shí)間: 2013-12-21
上傳用戶(hù):lanjisu111
%BIQPBOX Bisection reflective line search for sqpbox % [nx,nsig,alpha] = BIQPBOX(s,c,strg,x,y,sigma,l,u,... % oval,po,normg,DS,mtxmpy,data,H) % returns the new feasible point nx, the corresponding sign vector nsig, % and the step size of the unreflected step, alpha. % Copyright (c) 1990-98 by The MathWorks, Inc. % $Revision: 1.2 $ $Date:
標(biāo)簽: BIQPBOX reflective Bisection search
上傳時(shí)間: 2013-12-17
上傳用戶(hù):sk5201314
Java 版本的 PHP serialize/unserialize 完整實(shí)現(xiàn)。目前實(shí)現(xiàn)了對(duì)各種基本類(lèi)型、數(shù)組、ArrayList、HashMap、和其它可序列化對(duì)象的序列化。實(shí)現(xiàn)了 PHP 5 中的Serializable 接口的支持。實(shí)現(xiàn)了 PHP 中的 __sleep 和 __wakeup 魔術(shù)方法的支持。實(shí)現(xiàn)了對(duì)所有標(biāo)示(N、b、i、d、s、a、O、R、r、U、C)的反序列化,在對(duì)標(biāo)示 a 反序列化時(shí),可以根據(jù)下標(biāo)和值來(lái)自動(dòng)判斷是 ArrayList 還是 HashMap。并且在反序列化時(shí)可以強(qiáng)制指定反序列化的類(lèi)型。該類(lèi)是靜態(tài)類(lèi),無(wú)需也不能被實(shí)例化。除了包含了 serialize 和 unserialize 方法以外,還增加了一個(gè) cast 方法,用來(lái)進(jìn)行反序列化后的類(lèi)型轉(zhuǎn)換,該方法主要用于將反序列化后的 ArrayList 轉(zhuǎn)化為數(shù)組或者 HashMap。
標(biāo)簽: unserialize ArrayList PHP serialize
上傳時(shí)間: 2016-01-06
上傳用戶(hù):奇奇奔奔
有關(guān)u-boot的文檔,是嵌入式系統(tǒng)中初始化引導(dǎo)的代碼,推薦在做u-boot的人看
上傳時(shí)間: 2014-01-23
上傳用戶(hù):sjyy1001
* first open client.cpp and search for that USER_MSG_INTERCEPT(TeamInfo) over it u add this Code: USER_MSG_INTERCEPT(Health) { BEGIN_READ(pbuf,iSize) me.iHealth = READ_BYTE() return USER_MSG_CALL(Health) } * then we search for int HookUserMsg (char *szMsgName, pfnUserMsgHook pfn) and add this Code: REDIRECT_MESSAGE( Health ) *k now we have the health registered and can read it out i stop this hear know cuz i must thanks panzer and w00t.nl that they helped me with it first time! *ok now we go to int HUD_Redraw (float x, int y) and packing this draw code in it Code:
標(biāo)簽: USER_MSG_INTERCEPT TeamInfo client search
上傳時(shí)間: 2016-01-22
上傳用戶(hù):ynzfm
Floyd-Warshall算法描述 1)適用范圍: a)APSP(All Pairs Shortest Paths) b)稠密圖效果最佳 c)邊權(quán)可正可負(fù) 2)算法描述: a)初始化:dis[u,v]=w[u,v] b)For k:=1 to n For i:=1 to n For j:=1 to n If dis[i,j]>dis[i,k]+dis[k,j] Then Dis[I,j]:=dis[I,k]+dis[k,j] c)算法結(jié)束:dis即為所有點(diǎn)對(duì)的最短路徑矩陣 3)算法小結(jié):此算法簡(jiǎn)單有效,由于三重循環(huán)結(jié)構(gòu)緊湊,對(duì)于稠密圖,效率要高于執(zhí)行|V|次Dijkstra算法。時(shí)間復(fù)雜度O(n^3)。 考慮下列變形:如(I,j)∈E則dis[I,j]初始為1,else初始為0,這樣的Floyd算法最后的最短路徑矩陣即成為一個(gè)判斷I,j是否有通路的矩陣。更簡(jiǎn)單的,我們可以把dis設(shè)成boolean類(lèi)型,則每次可以用“dis[I,j]:=dis[I,j]or(dis[I,k]and dis[k,j])”來(lái)代替算法描述中的藍(lán)色部分,可以更直觀地得到I,j的連通情況。
標(biāo)簽: Floyd-Warshall Shortest Pairs Paths
上傳時(shí)間: 2013-12-01
上傳用戶(hù):dyctj
實(shí)現(xiàn)最優(yōu)二叉樹(shù)的構(gòu)造;在此基礎(chǔ)上完成哈夫曼編碼器與譯碼器。 假設(shè)報(bào)文中只會(huì)出現(xiàn)如下表所示的字符: 字符 A B C D E F G H I J K L M N 頻度 186 64 13 22 32 103 21 15 47 57 1 5 32 20 57 字符 O P Q R S T U V W X Y Z , . 頻度 63 15 1 48 51 80 23 8 18 1 16 1 6 2 要求完成的系統(tǒng)應(yīng)具備如下的功能: 1.初始化。從終端(文件)讀入字符集的數(shù)據(jù)信息,。建立哈夫曼樹(shù)。 2.編碼:利用已建好的哈夫曼樹(shù)對(duì)明文文件進(jìn)行編碼,并存入目標(biāo)文件(哈夫曼碼文件)。 3.譯碼:利用已建好的哈夫曼樹(shù)對(duì)目標(biāo)文件(哈夫曼碼文件)進(jìn)行編碼,并存入指定的明文文件。 4.輸出哈夫曼編碼文件:輸出每一個(gè)字符的哈夫曼編碼。
上傳時(shí)間: 2014-11-23
上傳用戶(hù):shanml
arm946es的cpu初始化源代碼,用在u-boot的初始化階段
上傳時(shí)間: 2016-06-20
上傳用戶(hù):aix008
System.out.print(s) System.out.println(t) System.out.print(u) System.out.println(v) System.out.print(a) System.out.print(b) System.out.print(c) System.out.println(d) x=0x5f20 y=0x5f35 z=0xffff System.out.print(x) System.out.print(y) System.out.println(z)
標(biāo)簽: System out println print
上傳時(shí)間: 2016-07-01
上傳用戶(hù):日光微瀾
蟲(chóng)蟲(chóng)下載站版權(quán)所有 京ICP備2021023401號(hào)-1