📄 psn_linalg.h
字号:
/*psn_lib/psn_linalg.h*/
/***********************************************************************
Finite Volume Poisson PDE Solver: C-Library & Matlab Toolbox
Implements numerical solution of Poisson PDE
in 2D Cartesian and Cylindrical coordinates
Copyright (C) 2004 Igor Kaufman
Copyright (C) 2004 Lancaster University, UK
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author's email: i.kaufman@lancaster.ac.uk
APPLICATION : COMMON ROUTINES
VERSION : 1.0
************************************************************************/
/*17.01.04*/
#ifndef PSN_LINALG
#define PSN_LINALG
/*
Function to invert tridiagonal matrix equation.
Left, centre, and right diagonal elements of matrix
stored in arrays a, b, c, respectively.
Right-hand side stored in array w.
Solution written to array u.
Matrix is NxN. Arrays a, b, c, w, u assumed to be of extent N+2,
with redundant 0 and N+1 elements.
Code source:http://farside.ph.utexas.edu/teaching/329/lectures/node77.html
*/
int psn_tridiag_solve_low(
const size_t N,
const PSN_VECTOR a,
PSN_VECTOR b,
const PSN_VECTOR c,
PSN_VECTOR u
);
int psn_tridiag_solve_std(
const size_t N,
const PSN_VECTOR a,
const PSN_VECTOR b,
const PSN_VECTOR c,
const PSN_VECTOR w,
PSN_VECTOR u
);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -