c语言实现cholesky分解

这段代码展示了如何使用C语言实现Cholesky分解。它遵循FA Graybill在1976年的《线性模型的理论与应用》中描述的方法。函数接受一个对称正定矩阵,对其进行Cholesky分解,生成上三角矩阵C,并提供了一个选项来同时计算矩阵的增广部分与C^-t的乘积。如果输入矩阵不是正定的,函数将返回错误信息。
摘要由CSDN通过智能技术生成
/* file: cholesky.c */


/* Take the cholesky decomposition in the manner described in FA Graybill
   (1976).
*/


#include <math.h>
#include <stdio.h>
#include <stdlib.h>




int cholesky(double **orig, int n, double **aug, int mcol,double **chol, double **cholaug, int ofs)
     /* 
Do the augmented cholesky decomposition as described in FA Graybill
(1976) Theory and Application of the Linear Model. The original matrix
must be symmetric positive definite. The augmentation matrix, or
series of column vectors, are multiplied by C^-t, where C is the
upper triangular cholesky matrix, ie C^t * C = M and M is the original
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值