directsolvers.tcc
来自「Flens库-一个在C++的矩阵运算库」· TCC 代码 · 共 38 行
TCC
38 行
#include <iostream>#include <limits>namespace flens {//-- stationary iterative solver -----------------------------------------------template <typename Meth>StationaryIterativeSolver<Meth>::StationaryIterativeSolver(const MatrixType &_A, const VectorType &_f, VectorType &_u) : S(_A, _f), A(_A), f(_f), u(_u), r(f){}template <typename Method>voidStationaryIterativeSolver<Method>::solve(){ double eps = std::numeric_limits<double>::epsilon(); r = f - A*u; for (int i=1; (i<=5000) && (normL2(r)>eps); ++i) { u = S*u; r = f - A*u; }}//-- fast poisson solver -------------------------------------------------------template <typename MatrixType, typename VectorType>FastPoissonSolver<MatrixType, VectorType>::~FastPoissonSolver(){ // fftw_destroy_plan(plan);}} // namespace flens
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?