矩阵求解(列行列主元消元法)

该博客详细介绍了如何运用列出行列的主元消元法来解决矩阵问题,并探讨了通过采用双精度浮点数来提升计算精度的方法,旨在提供更准确的矩阵计算方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

计算扩展矩阵解,利用列出行列的主元及利用双精度浮点数提高计算精度:

//Three order Mat
typedef struct STRTHREEORDERMAT
{
	//parameter and y (result)
	double m_param[3][4];
	//x (unknown)
	double m_unk[3];
}thrmat_t, *thrmat_tt;

//Three order Mat
typedef struct STRFOURORDERMAT
{
	//parameter and y (result)
	double m_param[4][5];
	//x (unknown)
	double m_unk[4];
}format_t, *format_tt;

//Six order Mat
typedef struct STRSIXORDERMAT
{
	//parameter and y (result)
	double m_param[6][7];
	//x (unknown)
	double m_unk[6];
}sixmat_t, *sixmat_tt;

//EliMination with maximal col and row privoting
static char gelimsolve(double **prow, short *pcol, double *unk, short row)
{
	double *temprow = NULL;
	short tempcol = 0;
	double calctemp = 0;
	short it0 = 0, it1 = 0, it2 = 0;
	short maxrow = 0, maxcol = 0;
	//elimination calc
	for (it0 = 0; it0 < row; ++it0)
	{
		//calc max col and row
		calctemp = FABS(*(*(prow + it0) + it0));
		maxrow = maxcol = it0;
		for (it1 = it0; it1 < row; ++it1)
		{
			for 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值