📄 cgsolver.cpp
字号:
#include <iostream>
using namespace std;
#include "Plate.h"
//---------------------------------------------------------------------------
double* TPlate::Cal_CGSolver(){
nmax = 0;
nmax = count_nmax();
sa = Allocate_1D_Matrix(sa, nmax);
ija = Allocate_1D_Matrix(ija, nmax);
b = Allocate_1D_Matrix(b, NEQ);
x = Allocate_1D_Matrix(x, NEQ);
sa = SetZero_1D_Matrix(sa, nmax);
ija = SetZero_1D_Matrix(ija, nmax);
b = SetZero_1D_Matrix(b, NEQ);
x = SetZero_1D_Matrix(x, NEQ);
b = U;
// dsprsin (Banded Matrix --> Sparse Matrix);
// Numerical Recipes In C++, Chapter 2 (Modified);
dsprsin(sa, NEQ, MBAND, S, ija);
// linbcg(Conjugate Gradient Solver);
// Numerical Recipes In C++, Chapter 2;
linbcg();
U = x;
return U;
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -