1.功能 利用廣義逆求解無(wú)約束條件下的優(yōu)化問(wèn)題(C語(yǔ)言) 2.參數(shù)說(shuō)明 int m : 非線性方程組中方程個(gè)數(shù) int n : 非線性方程組中未知數(shù)個(gè)數(shù) double eps1 : 控制最小二乘解的精度要求 double eps2 : 用于奇異值分解中的控制精度要求 double x[n] : 存放非線性方程組解的初始近似值X(0),要求各分量不全為0 int ka : Ka=max{m,n}+1 Void (*f)() : 指向計(jì)算非線性方程組中各方程左端函數(shù)值的函數(shù)名(用戶(hù)自編) Void (*s)() : 指向計(jì)算雅可比矩陣的函數(shù)名 int ngin() : 函數(shù)返回一個(gè)標(biāo)志值 3.文件說(shuō)明 ngin.c函數(shù)文件 ngin0.c主函數(shù)文件
上傳時(shí)間: 2013-12-23
上傳用戶(hù):大三三
自定義一個(gè)簡(jiǎn)單的日期類(lèi)DateType,它具有數(shù)據(jù)成員y、m、d,用來(lái)表示當(dāng)前日期的年、月、日。而后設(shè)計(jì)該類(lèi)欲實(shí)現(xiàn)(完成)的功能,進(jìn)而設(shè)計(jì)出相應(yīng)的類(lèi)成員函數(shù)。 例如,下面給出的“雛形”可用來(lái)實(shí)現(xiàn)對(duì)天的增加,比較兩個(gè)日期是否相等,以及對(duì)日期的輸出等操作。請(qǐng)完成各類(lèi)成員函數(shù),并編制主函數(shù),說(shuō)明DateType類(lèi)對(duì)象,對(duì)定義的各成員函數(shù)進(jìn)行調(diào)用,以驗(yàn)證它們的正確性。 class DateType { //自定義的日期類(lèi)DateType int y,m,d //數(shù)據(jù)成員,表示當(dāng)前日期的年、月、日 public: DateType(int y0=1, int m0=1, int d0=1) //構(gòu)造函數(shù),設(shè)定年、月、日;并設(shè)置參數(shù)默認(rèn)值 Void incrementDay() //增加1天 bool equal(DateType dt2) //判斷二日期是否相等 Void printDate() //屏幕輸出日期對(duì)象的有關(guān)數(shù)據(jù)(年、月、日) }
上傳時(shí)間: 2013-12-22
上傳用戶(hù):songyue1991
sd2003芯片資料及源碼,C51下的,可以直接使用,不是廠方提供的測(cè)試程序, 相應(yīng)子程序: extern Void ini_SD2003(Void) extern bit mend_scl_SD2003(Void) extern bit start_bit_SD2003(Void) extern Void stop_bit_SD2003(Void) extern Void ack_SD2003(Void) extern Void no_ack_SD2003(Void) extern Void mast_ack_SD2003(Void) extern Void write_8bit_SD2003(UCHAR ch) extern UCHAR Read_8bit_SD2003(Void) extern Void write_8bit_SD2003_R(UCHAR ch) extern UCHAR Read_8bit_SD2003_R(Void) extern bit Readblock_SD2003(UCHAR ucommand,UCHAR *p) extern bit Writeblock_SD2003(UCHAR ucommand,UCHAR *p)
上傳時(shí)間: 2015-09-14
上傳用戶(hù):zl5712176
創(chuàng)建一棵二叉排序樹(shù),并采用中序遍歷和層次遍歷法輸出其頂點(diǎn)序列,主要實(shí)驗(yàn)內(nèi)容如下: 1. 定義二叉排序樹(shù)的結(jié)構(gòu)BiTree; 2. 編制二叉排序樹(shù)的插入算法:Void Insert_SortTree (BiTree ST, ElemType x); 3. 編制中序遍歷函數(shù); 4. 在main()函數(shù)中完成二叉排序樹(shù)的建立,以及中序遍歷的輸出。(二叉排序樹(shù)的各個(gè)元素從鍵盤(pán)輸入,并利用Insert_SortTree()函數(shù)進(jìn)行插入建立); 5. 編制層次遍歷函數(shù),并在main()函數(shù)中完成層次遍歷的輸出。層次遍歷法要利用“隊(duì)列”來(lái)實(shí)現(xiàn);為此需要定義一個(gè)隊(duì)列結(jié)構(gòu)(可以采用鏈隊(duì)列,也可以采用循環(huán)順序隊(duì)列),并實(shí)現(xiàn)相關(guān)的隊(duì)列函數(shù)。
上傳時(shí)間: 2013-12-25
上傳用戶(hù):kikye
實(shí)現(xiàn)直接插入排序 要求:封裝成一個(gè)函數(shù),形式如下: Void DirectInsertSort(bool bOrder, bool bPrintEveryStep, int * array) 其中,參數(shù)bOrder是布爾類(lèi)型變量,true表示升序,false表示降序 bPrintEveryStep表示是否把每一步的排序結(jié)果打印出來(lái),true表示打印,false表示不打印 array是待排序的數(shù)組
上傳時(shí)間: 2014-01-15
上傳用戶(hù):wsf950131
哈夫曼樹(shù)和哈夫曼編碼: 從終端輸入若干個(gè)字符及其對(duì)應(yīng)的整數(shù),將整數(shù)作為結(jié)點(diǎn)的權(quán)值,建立哈夫曼樹(shù),然后對(duì)各字符進(jìn)行哈夫曼編碼。最后打印哈夫曼樹(shù)和對(duì)應(yīng)的哈夫曼編碼。 設(shè)計(jì)要求: ⑴ 哈夫曼殊和哈夫曼編碼的存儲(chǔ)表示參考教材事例 ⑵ 在程序中構(gòu)造四個(gè)子程序?yàn)? ① int createhtree(HTree *t) /*根據(jù)輸入的字符及其權(quán)值建立哈夫曼樹(shù)*/ ② Void coding(HTree *t, char *code) /*對(duì)哈夫曼樹(shù)進(jìn)行編碼*/ ③ Void printhtree(HTree *t, int* path) /*中序打印樹(shù)*/ ④ Void printcode(HTree *t) /*輸出個(gè)字符的哈夫曼編碼*/
標(biāo)簽: 樹(shù) 字符 整數(shù) 編碼
上傳時(shí)間: 2013-12-17
上傳用戶(hù):二驅(qū)蚊器
[問(wèn)題描述] 將N個(gè)關(guān)鍵字去整數(shù)的記錄進(jìn)行整序, 以使所有關(guān)鍵字為非負(fù)數(shù)的記錄排在關(guān)鍵字為負(fù)數(shù)的記錄之前,要求使用最少的附加空間,且算法的時(shí)間復(fù)雜度為O(N) [輸入] 待排序記錄個(gè)數(shù),各關(guān)鍵字的值。 [輸出] 關(guān)鍵字從正負(fù)分開(kāi),正數(shù)在前 [存儲(chǔ)結(jié)構(gòu)] 待排序記錄順序存儲(chǔ)。 [算法的基本思想] 快速排序算法每次任取一個(gè)記錄的關(guān)鍵字為標(biāo)準(zhǔn),將其余記錄分為兩組將,N個(gè)關(guān)鍵字去整數(shù)的記錄進(jìn)行整序, 以使所有關(guān)鍵字為非負(fù)數(shù)的記錄排在關(guān)鍵字為負(fù)數(shù)的記錄之前。 #include <iostream> using namespace std #define MAXNUM 100//設(shè)文件的最長(zhǎng)可能長(zhǎng)度 Void sort(int* keys, const int len)//排序
上傳時(shí)間: 2014-01-13
上傳用戶(hù):aig85
本題的算法中涉及的三個(gè)函數(shù): double bbp(int n,int k,int l) 其中n為十六進(jìn)制位第n位,k取值范圍為0到n+7,用來(lái)計(jì)算16nS1,16nS2,16nS3,16nS4小數(shù)部分的每一項(xiàng)。返回每一項(xiàng)的小數(shù)部分。 Void pi(int m,int n,int p[]) 計(jì)算從n位開(kāi)始的連續(xù)m位的十六進(jìn)制數(shù)字。其中p為存儲(chǔ)十六進(jìn)制數(shù)字的數(shù)組。 Void div(int p[]) Void add(int a[],int b[]) 這兩個(gè)函數(shù)都是為最后把十六進(jìn)制數(shù)字轉(zhuǎn)換為十進(jìn)制數(shù)字服務(wù)的。 最后把1000個(gè)數(shù)字分別存儲(chǔ)在整型數(shù)組r[]中,輸出就是按順序輸出該數(shù)組。
上傳時(shí)間: 2014-01-05
上傳用戶(hù):xcy122677
http://www.bc-cn.net/Article/kfyy/cyy/jc/200409/5_4.html float aver(float a[5]) { int i float av,s=a[0] for(i=1 i<5 i++) s=s+a[i] av=s/5 return av } Void main() { float sco[5],av int i
標(biāo)簽: float Article 200409 bc-cn
上傳時(shí)間: 2014-01-08
上傳用戶(hù):zsjzc
UC Library Extensions UnderC comes with a pocket implementation of the standard C++ libraries, which is a reasonably faithful subset. This documentation describes those UnderC functions and classes which are not part of the C++ standard. UC Library Builtin functions: Most of these are standard C functions, but there are a few unique to the UnderC system which give you runtime access to the compiler. You may evaluate expressions, execute commands, compile code, etc. * Expands the text in expr using the UnderC preprocessor, putting the result into buff. Void uc_macro_subst(const char* expr, char* buff, int buffsize) * Executes a UC #-command, like #l or #help. uc_cmd() expects the name of the command, _without_ the hash, e.g. uc_cmd("l fred.cpp") or uc_cmd("help"). Void uc_cmd(const char* cmd) * Evaluates any C++ expression or statement will return non-zero if unsuccessful.
標(biāo)簽: implementation Extensions libraries standard
上傳時(shí)間: 2013-12-14
上傳用戶(hù):leehom61
蟲(chóng)蟲(chóng)下載站版權(quán)所有 京ICP備2021023401號(hào)-1