#include <iostream>
#include <math.h>
#include<fstream>
using namespace std;
class Mat {
public:
Mat(int x, int y, double d[]) {
rows = x;
cols = y;
if (x<y - 1)
cout << "Not enough" << endl;
int c = 0;
data[0][0] = 0;
for (int i = 0; i<x; i++) {
for(int j=0;j<4;j++){
data[i][j] = d[c++];
}
}
data[x-1][3]=data[x-1][2];
data[x-1][2]=0;
}
void print();
int matcols();
int matrows();
void gauss();
void change();
void result();
private:
int rows;
int cols;
double data[3][200];
};
void Mat::print() {
int c=0;
cout<<" "<<data[0][1]<<" "<<data[0][2]<<" "<<data[0][3]<<endl;
for (int i = 1; i<rows-1; i++) {
for (int j = 0; j<4; j++) {
//cout.width(4);
cout << data[i][j] <<" ";
}
追赶法求三角方程组
最新推荐文章于 2021-05-22 04:26:25 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)