superlu.edp
来自「FreeFem++可以生成高质量的有限元网格。可以用于流体力学」· EDP 代码 · 共 40 行
EDP
40 行
load "SuperLU"verbosity=0;for(int i=0;i<3;++i){ { matrix A = [[ 0, 1, 0, 10], [ 0, 0, 2, 0], [ 0, 0, 0, 3], [ 4, 0, 0, 0]]; real[int] xx = [ 4,1,2,3], x(4), b(4); // xb(4),bbb(4); b=A*xx; cout << "b=" << b << endl; cout << "xx=" << xx << endl; cout << "A=" << A << endl; set(A,solver=sparsesolver); x = A^-1*b; cout << "x=" << endl; cout << x << endl; cout << "A=" << A << endl; } { matrix<complex> A = [[ 0, 1i, 0, 10], [ 0, 0, 2i, 0], [ 0, 0, 0, 3i], [ 4i, 0, 0, 0]]; complex[int] xx = [ 4i,1i,2i,3i], x(4), b(4); b = A*xx; cout << "b=" << b << endl; cout << "xx=" << xx << endl; set(A,solver=sparsesolver); x = A^-1*b; cout << "x=" << endl; cout << x << endl; } if(i==0)defaulttoGMRES(); if(i==1)defaultsolver(); }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?