# 数学软件quiz **Repository Path**: uranium235/mathematical-software-quiz ## Basic Information - **Project Name**: 数学软件quiz - **Description**: 数学软件课程期末quiz代码 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2023-02-09 - **Last Updated**: 2023-02-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 项目地址:https://gitee.com/liu-zhifang2333/mathematical-software-quiz.git ## section1 ```c++ #include #include #include #include #include #include using namespace std; extern lapack_int LAPACKE_dgeev( int matrix_order, char jobvl, char jobvr, lapack_int n, double* a, lapack_int lda, double* wr, double* wi, double* vl, lapack_int ldvl, double* vr, lapack_int ldvr); int main() { int matrix_order = LAPACK_COL_MAJOR; char jobvl = 'N'; char jobvr = 'V'; int n = 50; double A[2500]; for(int i = 0;i<50;i++) { for(int j = 0;i<50;i++) { A[i*50+j] = 0; } } A[0] = 3; A[1] = 1; for(int i = 1;i<49;i++) { A[i*51] = 3; A[i*51+1] = 1; A[i*51-1] = 1; } A[49*51] = 3; A[49*51-1] = 1; int lda = n; double wr[50]; double wi[50]; for(int i = 0;i<50;i++) { wr[i] = 0; wi[i] = 0; } double vl[2500]; int ldvl = 50; double vr[2500]; int ldvr = 50; int info = LAPACKE_dgeev(matrix_order,jobvl,jobvr,n,A,lda,wr,wi,vl,ldvl,vr,ldvr); if(info==0) { int i = 0; int j = 0; for(i=0;i #include #include #include using namespace std; using namespace Eigen; int main(int argc, char const *argv[] { MatrixXd A; MatrixXd b; MatrixXd x; x = A.colPivHouseholderQr().solve(b) ofstream outfile("data0.csv"); if(!outfile) { cout << "打开文件夹失败!" << endl; exit(1); } for(int q = 0;q>[i,j,s] = A >>dimwrite('A.csv',[i,j,s]) >>dimwritee('b.csv',b,'precision',''%f') ```