#include "iostream" using namespace std; class Matrix { private: double** A; //矩陣A double *b; //向量b public: int size; Matrix(int ); ~Matrix(); friend double* Dooli(Matrix& ); void Input(); void Disp(); }; Matrix::Matrix(int x) { size=x; //為向量b分配空間并初始化為0 b=new double [x]; for(int j=0;j<x;j++) b[j]=0; //為向量A分配空間并初始化為0 A=new double* [x]; for(int i=0;i<x;i++) A[i]=new double [x]; for(int m=0;m<x;m++) for(int n=0;n<x;n++) A[m][n]=0; } Matrix::~Matrix() { cout<<"正在析構(gòu)中~~~~"<<endl; delete b; for(int i=0;i<size;i++) delete A[i]; delete A; } void Matrix::Disp() { for(int i=0;i<size;i++) { for(int j=0;j<size;j++) cout<<A[i][j]<<" "; cout<<endl; } } void Matrix::Input() { cout<<"請輸入A:"<<endl; for(int i=0;i<size;i++) for(int j=0;j<size;j++){ cout<<"第"<<i+1<<"行"<<"第"<<j+1<<"列:"<<endl; cin>>A[i][j]; } cout<<"請輸入b:"<<endl; for(int j=0;j<size;j++){ cout<<"第"<<j+1<<"個(gè):"<<endl; cin>>b[j]; } } double* Dooli(Matrix& A) { double *Xn=new double [A.size]; Matrix L(A.size),U(A.size); //分別求得U,L的第一行與第一列 for(int i=0;i<A.size;i++) U.A[0][i]=A.A[0][i]; for(int j=1;j<A.size;j++) L.A[j][0]=A.A[j][0]/U.A[0][0]; //分別求得U,L的第r行,第r列 double temp1=0,temp2=0; for(int r=1;r<A.size;r++){ //U for(int i=r;i<A.size;i++){ for(int k=0;k<r-1;k++) temp1=temp1+L.A[r][k]*U.A[k][i]; U.A[r][i]=A.A[r][i]-temp1; } //L for(int i=r+1;i<A.size;i++){ for(int k=0;k<r-1;k++) temp2=temp2+L.A[i][k]*U.A[k][r]; L.A[i][r]=(A.A[i][r]-temp2)/U.A[r][r]; } } cout<<"計(jì)算U得:"<<endl; U.Disp(); cout<<"計(jì)算L的:"<<endl; L.Disp(); double *Y=new double [A.size]; Y[0]=A.b[0]; for(int i=1;i<A.size;i++ ){ double temp3=0; for(int k=0;k<i-1;k++) temp3=temp3+L.A[i][k]*Y[k]; Y[i]=A.b[i]-temp3; } Xn[A.size-1]=Y[A.size-1]/U.A[A.size-1][A.size-1]; for(int i=A.size-1;i>=0;i--){ double temp4=0; for(int k=i+1;k<A.size;k++) temp4=temp4+U.A[i][k]*Xn[k]; Xn[i]=(Y[i]-temp4)/U.A[i][i]; } return Xn; } int main() { Matrix B(4); B.Input(); double *X; X=Dooli(B); cout<<"~~~~解得:"<<endl; for(int i=0;i<B.size;i++) cout<<"X["<<i<<"]:"<<X[i]<<" "; cout<<endl<<"呵呵呵呵呵"; return 0; }
標(biāo)簽: 道理特分解法
上傳時(shí)間: 2018-05-20
上傳用戶:Aa123456789
ble Logic Controller,可編程邏輯控制器,一種數(shù)字運(yùn)算操作的電子系統(tǒng),專為在工業(yè)環(huán)境應(yīng)用而設(shè)計(jì)的。它采用一類可編程的存儲(chǔ)器,用于其內(nèi)部存儲(chǔ)程序,執(zhí)行邏輯運(yùn)算,順序控制,定時(shí),計(jì)數(shù)與算術(shù)操作等面向用戶的指令,并通過數(shù)字或模擬式輸入/輸出控制各種類型的機(jī)械或生產(chǎn)過程。是工業(yè)控制的核心部分。 另外PLC還有以下幾個(gè)名稱: PLC = Power Line Communication,電力線通信,即我們俗稱的“電力線上網(wǎng)”。 PLC = public Listed Co
標(biāo)簽: 驅(qū)動(dòng)器
上傳時(shí)間: 2018-06-27
上傳用戶:454545
我們編寫的程序由兩個(gè)主要方面組成 1 算法的集合就是將指令組織成程序來解決某個(gè)特定的問題 2 數(shù)據(jù)的集合算法在這些數(shù)據(jù)上操作以提供問題的解決方案 縱觀短暫的計(jì)算機(jī)發(fā)展史這兩個(gè)主要方面算法和數(shù)據(jù)一直保持不變發(fā)展演化的 是它們之間的關(guān)系就是所謂的程序設(shè)計(jì)方法programming paradigm 在過程化程序設(shè)計(jì)方法procedural programming 中一個(gè)問題可直接由一組算法來建 立模型例如公共圖書館的資料借閱/登記check out/check in 系統(tǒng)是由一系列過程表現(xiàn) 出來的其中兩個(gè)主要的過程是資料的借閱和登記這些數(shù)據(jù)被獨(dú)立存儲(chǔ)起來我們既可以 在某個(gè)全局位置上訪問這些數(shù)據(jù)或者把數(shù)據(jù)傳遞給過程以便它能夠訪問這些數(shù)據(jù)Fortran C 和 Pascal 是三種著名的過程語言C++也支持過程化程序設(shè)計(jì)單獨(dú)的過程如check_in() check_out() over_due() fine()等等都被稱為函數(shù)第三篇將集中討論C++對過程化程序 設(shè)計(jì)方法的支持尤其將重點(diǎn)討論函數(shù)函數(shù)模板和通用算法 在20 世紀(jì)70 年代程序設(shè)計(jì)的焦點(diǎn)從過程化程序設(shè)計(jì)方法轉(zhuǎn)移到了抽象數(shù)據(jù)類型 abstract data type 簡寫為ADT 的程序設(shè)計(jì)上現(xiàn)在通常稱之為基于對象(object based 的程序設(shè)計(jì)在基于對象的程序設(shè)計(jì)方法中我們通過一組數(shù)據(jù)抽象來建立問題的模型在 C++中我們把這些抽象稱為類class 例如在這種方法下圖書館資料借閱登記系統(tǒng)就 由類的對象實(shí)例比如書借閱者還書時(shí)間罰款等之間的相互作用表現(xiàn)出來以此表 示出圖書館的抽象概念與每個(gè)類相關(guān)的算法被稱為該類的公有接口public interface 數(shù) 據(jù)以私有形式被存儲(chǔ)在每個(gè)對象中對數(shù)據(jù)的訪問應(yīng)與一般的程序代碼隔離開來CLU Ada 和Modula-2 是三種支持抽象數(shù)據(jù)類型的程序設(shè)計(jì)語言第四篇將說明和討論C++對抽象數(shù)據(jù) 類型程序設(shè)計(jì)方法的支持 面向?qū)ο蟮某绦蛟O(shè)計(jì)方法通過繼承inheritance 機(jī)制和動(dòng)態(tài)綁定dynamic binding 機(jī) 制擴(kuò)展了抽象數(shù)據(jù)類型繼承機(jī)制是對現(xiàn)有實(shí)現(xiàn)代碼的重用動(dòng)態(tài)綁定是指對現(xiàn)有的公有接 口的重用以前獨(dú)立的類型現(xiàn)在有了類型/子類型的特定關(guān)系一本書一盒錄像帶一段錄 音甚至孩子的寵物盡管它們有各自的借閱/登記方式但都可以成為圖書館的收藏資料 共享的公有接口和私有的數(shù)據(jù)都放在一個(gè)抽象類圖書館資料LibraryMaterial 中每個(gè)特 殊的圖書館資料類都從LibraryMaterial 抽象類繼承共享的行為它們只需要提供與自身行為相 關(guān)的算法和數(shù)據(jù)Simula Smalltalk 和Java 是三種支持面向?qū)ο蟪绦蛟O(shè)計(jì)方法的著名語言 第五篇將集中討論C++對面向?qū)ο蟪绦蛟O(shè)計(jì)方法的支持 C++是一種支持多種程序設(shè)計(jì)方法的語言雖然我們主要把它當(dāng)作面向?qū)ο蟮恼Z言但 實(shí)際上它也提供對過程化的和基于對象的程序設(shè)計(jì)方法的支持這樣做的好處是對每個(gè)問題 都能夠提供最合適的解決方案事實(shí)上沒有一種程序設(shè)計(jì)方法能夠
標(biāo)簽: c++從入門到精通.pdf電子書 第二版
上傳時(shí)間: 2019-01-30
上傳用戶:jizhi111
The concept of smart cities emerged few years ago as a new vision for urban development that aims to integrate multiple information and communication technology (ICT) solutions in a secure fashion to manage a city’s assets. Modern ICT infrastructure and e-services should fuel sustainable growth and quality of life, enabled by a wise and participative management of natural resources to be ensured by citizens and government. The need to build smart cities became a requirement that relies on urban development that should take charge of the new infrastructures for smart cities (broadband infrastructures, wireless sensor networks, Internet-based networked applications, open data and open platforms) and provide various smart services and enablers in various domains including healthcare, energy, education, environmental management, transportation, mobility and public safety.
標(biāo)簽: Enablers Cities Smart for
上傳時(shí)間: 2020-05-25
上傳用戶:shancjb
The current methods of communications are becoming less relevant under today’s growing demand for and reliance on constant connectivity. Of decreasing relevance are the models of a single radio to perform a single task. The expansion of wireless access points among coffee shops, airports, malls, and other public arenas is opening up opportunities for new services and applications.
標(biāo)簽: Intelligence Artificial
上傳時(shí)間: 2020-05-26
上傳用戶:shancjb
The General Packet Radio Service (GPRS) allows an end user to send and receive data in packet transfer mode within a public land mobile network (PLMN) without using a permanent connection between the mobile station (MS) and the external network during data transfer. This way, GPRS opti- mizes the use of network and radio resources (RRs) since, unlike circuit- switched mode, no connection between the MS and the external network is established when there is no data flow in progress. Thus, this RR optimiza- tion makes it possible for the operator to offer more attractive fees.
上傳時(shí)間: 2020-05-27
上傳用戶:shancjb
Mobile telephone service (MTS) is a type of service where mobile radio tele- phones connect people to the public switched telephone system (PSTN), to other mobile telephones or to other communication systems (such as to the Internet).
標(biāo)簽: Introduction Telephone Systems Mobile to
上傳時(shí)間: 2020-05-27
上傳用戶:shancjb
Mobile radio networks have risen in prominence over the last few years, primarily by the rise in popularity of cellular phones. It is important to recognise however that mobile radio technology fulfils a far wider range of applications that meet the demands of the modern world. These include the networks that allow police and emergency services to serve the public, military networks for operations and humanitarian support, and the mobile technol- ogies that are vital to the safety of aircraft.
標(biāo)簽: Network Mobile Design Radio
上傳時(shí)間: 2020-05-30
上傳用戶:shancjb
European Research Framework programs are public policy instruments designed to strengthen European competitiveness through cooperation. Although they have a fixed time frame, determined research themes, and a specific expected impact, the achievements in research and development (R&D) made by these funded proj- ects pave the way for a research continuum.
標(biāo)簽: Communications Horizons Wireless Mobile New and in
上傳時(shí)間: 2020-05-31
上傳用戶:shancjb
European Research Framework Programs are a public policy instrument to strengthen European competitiveness through cooperation. Although they have a fixed timeframe, determined research themes, and specific expected impact, the achievements in research and development (R&D) made by the funded projects pave the way for a research continuum.
標(biāo)簽: New Horizons Mobile Wireless
上傳時(shí)間: 2020-05-31
上傳用戶:shancjb
蟲蟲下載站版權(quán)所有 京ICP備2021023401號(hào)-1