/*计算方法实验二
*WYC
*计科1604
*/
#include <cstdio>
#include <cmath>
#include <iostream>
using namespace std;
const int MAXSIZE = 20;
void columnPivoting(double a[MAXSIZE][MAXSIZE],int n, double b[]); //声明函数columnPivoting
int main(){
double matrix[MAXSIZE][MAXSIZE];//系数
double b[MAXSIZE]; //b
int sizeM;
cin>> sizeM;
for(int i=0;i<sizeM;i++){
for(int j=0;j<sizeM;j++)
cin>> matrix[i][j];
cin>>b[i];
}
columnPivoting(matrix,sizeM,b);
return 0;
}
//列主元消去法
void columnPivoting(double a[MAXSIZE][MAXSIZE], int n, double b[]){
int i, j, k;
int col = 0, row = 0;
for (k = 0; k < n -
[计算方法]列主元消去法 LU分解法求线性方程解
最新推荐文章于 2022-10-11 12:47:51 发布