水准网平差c++代码
水准网平差
结果
#include
#include
#include
#include
#define max 50
class CMatrix
{
public:
CMatrix(){row=0; column=0;}; // 默认构造函数
CMatrix(int i, int j){row=i;column=j;} // 构造函数一
CMatrix(const CMatrix& m); // 复制构造函数
~CMatrix(void){/*cout<<"谢谢使用,矩阵所占空间以释放!"< CMatrix& operator=(const CMatrix& m); // 赋值运算符 bool operator==(const CMatrix& m); // 比括较运算符 bool operator!=(const CMatrix& m); // 比括较运算符 CMatrix operator+(const CMatrix& m); // 加运算符 CMatrix operator-(const CMatrix& m); // 减运算符 CMatrix& operator+=(const CMatrix& m); // 自加运算符 CMatrix& operator-=(const CMatrix& m); // 自减运算符 CMatrix operator-();// 取负数 CMatrix& operator*(const CMatrix& m); // 乘法运算符 void input(); //输入矩阵 void outputMatrix(); // 输出该矩阵 void setValue(int row, int column, double value) { A[row-1][column-1] = value; }// 设 置(i,j)的值 double getValue(int row, int column) const { return A[row-1][column-1]; }// 设置行、列的值 void setRow(const int i) { row = i; } int getRow() const { return row; } void setColunm(const int i) { column = i; } int getColumn() const { return column; } CMatrix& change(int i, int j);//交换矩 阵的行 CMatrix& transpose(); // 矩阵转置 CMatrix& inverse(); // 矩阵求逆 void find(int& f)const;// 判断该矩阵 是否可用于迭代求解 friend void jocabi(const CMatrix& a) ; //迭代求解 void lzys(); //列主元素法求解 void solve(); //可逆线性矩阵求解 void qxnh(); //曲线拟合 private:// 成员变量 double A[max][max]; int row;// 行 int column;// 列 }; void CMatrix::input() //输入