- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
c 解线性方程组的几种方法(Several methods of solving linear equations by C)
c 解线性方程组的几种方法(Several methods of solving linear equations by C)
#包括 iostream。”
#包括 iomanip。”
#包括程序。”
/ / ----------------------------------------------全局变量定义区
const int数= 15;//方程最大个数
双[数] [数],B [数],copy_a [数] [数],copy_b [数];//系数行列式
国际a_y [数];// [ ] [ ]中随着横坐标增加列坐标的排列顺序,如一[ 0 ] [ 0 ],一个[ 1 ] [ 2 ],一个[ 2 ] [ 1 ]…则a_y [ ] = { 0,2,1…};
int的长度,copy_lenth;/ /方程的个数
双a_sum;/ /计算行列式的值
char * x;//未知量A,B,C的载体
/ / ----------------------------------------------函数声明区
无效();//输入方程组
print_menu() /打印主菜单无效;
int();//输入选择选择
cramer() /克莱默算法解方程组无效;
gauss_row() /高斯列主元解方程组无效;
guass_all() /高斯全主元解方程组无效;
无效doolittle();/ /用杜利特算法解方程组
国际doolittle_check(双[ ] [数],双B [数]);//判断是否行列式 0,若是,调整为顺序主子式全 0
无效xiaoqu_u_l();/ /将行列式杜利特分解
无效calculate_u_l();/ /计算杜利特结果
两calculate_a(int,int m);/ /计算行列式
双quanpailie_a();
According to the calculation of the coordinates of the arrangement of column / value, such as A_y[]={0,2,1}, sum=a[0][A_y[0] a[1][A_y[1]]] * * a[2][A_y[2]]=a[0][0]*a[1][2]*a[2][1];
Void exchange (int m, int i); / / A_y[m] exchange, A_y[i]
Void exchange_lie (int j); / / exchange a[][j] and b[];
Void exchange_hang (int m, int n); / / a[][] and N respectively to exchange M and b[] in the two row
Void gauss_row_xiaoqu (); //Gauss column principal elimination
Void, gauss_all_xiaoqu (); //Gauss total principal elimination
Void (gauss_calculate); / / Gauss elimination method to calculate the unknown amount according to the value of the
Void exchange_a_lie (int m, int n and n m); / / exchange columns in a[][]
Void exchange_x (int m, int n); / / x[] exchange in x[m] and x[n]
Void (recovery); / / data recovery
The main function.
Void, main ()
{
Int flag=1;
(input); / / input equation
While (flag)
{
(print_menu); / / menu
(flag=choose); / / select solutions
}
}
/ / function defined area
Void, print_menu ()
{
System (CLS);
The cout - equation coefficients and constant matrix expressed as follows: \n;
For (int j=0; jlenth; j++)
Cout coefficient j+1;
Cout \t constant;
Coutendl;
For (int i=0; ilenth; i++)
{
For (j=
您可能关注的文档
- 4.3火法导论(4.3 introduction to fire).doc
- 4.2补丁新增成就(4.2 patch new achievements).doc
- 4.岩土的工程性质(4. engineering properties of rock and soil).doc
- 400句常用英语(400 sentences in common English).doc
- 410-惠州市教育考试中心(410- Huizhou Education Examination Center).doc
- 42个生活小点子,太全面了(42 life tips, too comprehensive).doc
- 42个生活实用小点子(42 practical little tips for living).doc
- 44期航海学二三副916(44 phase navigation, two or three, 916).doc
- 46条驾驶技巧!(46 driving skills!).doc
- 40气象932(40 weather 932).doc
- c 界面设计(C interface design).doc
- c++ 学习路线与推荐书籍(C++ learning routes and recommended books).doc
- c++ stl vector容器用法精讲(C++ STL Vector container usage).doc
- c++ lists(链表)(C++ lists (linked list)).doc
- c++作业(C++ operation).doc
- c++容器类(C++ container class).doc
- c++期末考试经典例题(C++ final exam classic examples).doc
- c++类型转换符(C++ type conversion character).doc
- c++中vector的用法(The use of vector in c++).doc
- c1科目三(路考)考试技巧口诀(C1 three subjects (road test) test skills formula).doc
文档评论(0)