最近解师弟一个43758*43758的稀疏方程,发现一个很困扰的问题:师弟使用SSOR-PCG法解了66分钟,得到了一个不准确的结果,也就是说解的精度很低。在我这,不管是Matlab还是我使用的数值库来解,只要是迭代法,比如使用ILU预分解的BiCG、GMRES(m),迭代收敛速度都很慢,迭代上十万次精度只达1.e-2量级。偶尔间使用Matlab的'\'发现不到2秒便解出了十分精确的解,惊讶万分。查阅Matlab的文档得到以下资料:

inv:
Y = inv(X) returns the inverse of the square matrix X. Awarning message is printed if X is badly scaled or nearlysingular.
In practice, it is seldom necessary to form the explicitinverse of a matrix. A frequent misuse of inv arises when solvingthe system of linear equations Ax=b. One way to solve this is withx = inv(A)*b. A better way, from both an execution time andnumerical accuracy standpoint, is to use the matrix divisionoperator x = A\b. This produces the solution using Gaussianelimination, without forming the inverse. See \ and /for further information.

'\':
Backslash or matrix left division. If A is a square matrix,A\B is roughly the same as inv(A)*B, except it is computed in adifferent way. If A is an n-by-n matrix and B is a column vectorwith n components, or a matrix with several such columns, then X =A\B is the solution to the equation AX = B. A warning message isdisplayed if A is badly scaled or nearly singular. A\EYE(SIZE(A))produces the inverse of A. See the reference page for mldivide formore information.
If A is an m-by-n matrix with m ~= n and B is a column vectorwith m components, or a matrix with several such columns, then X =A\B is the solution in the least squares sense to the under- oroverdetermined system of equations AX = B. The effective rank, k,of A is determined from the QR decomposition with pivoting. Asolution X is computed that has at most k nonzero components percolumn. If k < n, this is usually not the samesolution as pinv(A)*B, which is the least squares solution with thesmallest norm||X||.    A\EYE(SIZE(A)) producesa  generalized inverse of A.
mldivide \:
Left matrix division
mldivide(A,B) and the equivalent A\B perform matrix leftdivision (back slash). A and B must be matrices that have the samenumber of rows, unless A is a scalar, in which case A\B performselement-wise division — that is, A\B = A.\B.
If A is a square matrix, A\B is roughly the same as inv(A)*B,except it is computed in a different way. If A is an n-by-n matrixand B is a column vector with n elements, or a matrix with severalsuch columns, then X = A\B is the solution to the equation AX = B.A warning message is displayed if A is badly scaled or nearlysingular.
If A is an m-by-n matrix with m ~= n and B is a column vectorwith m components, or a matrix with several such columns, then X =A\B is the solution in the least squares sense to the under- oroverdetermined system of equations AX = B. In other words, Xminimizes norm(A*X - B), the length of the vector AX - B. The rankk of A is determined from the QR decomposition with columnpivoting. The computed solution X has at most k nonzero elementsper column. If k < n, this is usually not the samesolution as x = pinv(A)*B, which returns a least squaressolution.

就是说当A是N阶方阵B为N行的列向量时,X=A\B就是线性方程组A*X=B的解,算法是用高斯消去法。A\EYE(SIZE(A))产生的是方阵A的逆矩阵。如果A是M*N的矩阵且M≠N,B是跟A行数(M行)相同的列向量时,X=A\B是非满秩的线性方程组A*X=B的解系,A的秩K由QR分解得出。如果K<N通常结果与PINV(A)*B不等(PINV(A)是求A的广义逆矩阵)。 A\EYE(SIZE(A))得到的是A的广义逆矩阵。总而言之,A\B就是求A*X=B的解,你可以看作是A的逆矩阵,只不过是广义逆矩阵,这样A不是方阵也可以计算的。至于A/B,在解线性方程组上比\少用一些,因为通常都把B写成列向量,所以用反除\就可以了。用/的话,B通常是行向量。
可以把B/A看作是X*A=B的解,这里B的列数等于A的列数。A\B=pinv(A)*B
A/B=A*pinv(B)
可见,'\'用的是高斯消元法。
同时还查到:
Square Matrices

If A is symmetric and has real, positive diagonal elements, MATLABattempts a Cholesky factorization. If the Cholesky factorizationfails, MATLAB performs a symmetric, indefinite factorization. If Ais upper Hessenberg, MATLAB uses Gaussian elimination to reduce thesystem to a triangular matrix. If A is square but is neitherpermuted triangular, symmetric and positive definite, orHessenberg, MATLAB performs a general triangular factorizationusing LU factorization with partial pivoting.

Matlab中的\ 和/和pinv的关系以及运算相关推荐

  1. matlab 中偏微分符号,一阶、二阶偏微分方程符号运算

    定义字符如下: syms rx ry zx zy phai; k=sqrt((4*rx*ry)/((rx+ry)^2+(zx-zy)^2)); kk=int(1/sqrt(1-k^2*sin(phai ...

  2. matlab中连续信号的卷积,连续时间信号卷积运算的MATLAB实现

    . . . .. .. 连续时间信号卷积运算的MATLAB 实现 一.实验目的 (1) 理解掌握卷积的概念及物理意义. (2) 理解单位冲击响应的概念及物理意义. 二.实验原理 根据前述知识,连续信号 ...

  3. matlab的数学函数,matlab中常见数学函数的使用

    matlab中常见数学函数的使用 MATLAB 基本知识 Matlab 的内部常数 pi 圆周率 exp(1) 自然对数的底数 e i 或 j 虚数单位 Inf 或 inf 无穷大 Matlab 的常 ...

  4. 在matlab中怎样把图片转化为数据类型,matlab图像数据类型转换

    uint 8:无符号的8位(8bit)整型数据(unit 都是存储型) int :整型数据 1.在MATLAB中,数值一般都采用double型(64位)存储和运算. 2.为了节省存储空间,MATLAB ...

  5. matlab最后ceq,matlab 中ceq是什么

    matlab 中这句话是什么含义? unique(p)的意思即是给出数组p中的所有不同的元素:比如:>>A=[115623398624]A=115623398624>>c=un ...

  6. matlab中方波信号的谐波表示

    matlab中方波信号的谐波表示 一.数学运算 二.matlab代码 t=-7:0.001:7; %x(t)中t取值范围为[-7,7] T1=1; T=4; w=2*pi/T; a0=2*T1/T; ...

  7. matlab中imshow函数输出图像全白全黑问题

    imshow 显示图像全白 在matlab中,为了保证精度,经过了运算的图像矩阵A其数据类型会从unit8型变成double型.imshow()显示图像时对double型是认为在0-1范围内,即大于1 ...

  8. char matlab中,matlab中char什么意思

    .. matlab 的常用指令及其含义 最佳答案 matlab 常用命令速查 s... //按指定的维数将多个数组聚合 字符与字符串( char ) 字符与字符串运算是各种高级语言不可缺 少的部分,M ...

  9. matlab中怎样求峭度,【转】Matlab常用函数~

    计算样本的百份位数 Matlab的常用内部数学函数 指数函数 exp(x) 以e为底数 对数函数 log(x) 自然对数,即以e为底数的对数 log10(x) 常用对数,即以10为底数的对数 log2 ...

最新文章

  1. 卡片使用_APP必备的设计元素!卡片
  2. 一个项目可以有多个源代码路径
  3. python硬件测试开发_用python实现高性能测试工具(一)
  4. mybatis出现 Parameter '__frch_excelModel_0' not found.
  5. [USACO1.5]数字三角形 Number Triangles
  6. 数字电路与逻辑设计笔记
  7. How to change max_allowed_packet size
  8. Android之ndk之用arm-linux-androideabi工具通过地址找到具体哪里崩溃
  9. 大气校正后的ndvi_Sentinel2 L1C下载、大气校正、重采样
  10. python捕获异常装饰器_python异常装饰器--比较全的版本了
  11. Web应用运行在pywebview在窗口
  12. php将excel日期转成时间戳,使用PHP将Excel日期编号转换为Unix时间戳时不匹配
  13. Nohttp 获取图片Bitmap
  14. 【资源】同济线性代数教材(第五版)
  15. 软件工程——软件结构图设计(变换分析设计、事务分析设计、混合流设计)
  16. 程序员的遮羞布:这个需求技术上无法实现
  17. PS常用平面设计制作尺寸
  18. Apereo CAS 5.0.X 配置数据库认证方式
  19. Delphi编程中流的使用
  20. 加密IC 在android 机子上的简单应用

热门文章

  1. 记一次 idea 配置scala 和运行 IDEA 错误: 找不到或无法加载主类
  2. 微软认证Programming in C# 70-483 MCP 首日封(首日拿下)
  3. 校招失败,在外包熬了 2 年后终于进了阿里
  4. CF1225D Power Products (数论)
  5. 计算机网络逻辑类故障实例,逻辑故障计算机网络论文
  6. java as2_使用AS2(http)协议实现 B2B 商用数据交换 (二) [译]
  7. [CVE-2022-0847][Dirty Pipe]Linux内核权限提升漏洞
  8. 计算机网络实验(华为eNSP模拟器)——第十四章 RIP协议和OSPF协议
  9. C语言_因数、因子_质数(素数)、合数
  10. centerOS安装涛思