预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共19页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

对称矩形C语⾔,c语⾔编程求任意对称正定矩阵的逆。满意答案玖林国际999推荐于2016.03.21采纳率:58%等级:13已帮助:6009⼈#ifndef__MATRIX_DOT_H__#define__MATRIX_DOT_H__templatevoidSwap(T&a,T&b){Ttemp;temp=a;a=b;b=temp;}classCMatrix{staticdoubleZERO;//极⼩值public:CMatrix(introw=3,intcol=3);//CMatrix(constCMatrix&right);//拷贝构造函数~CMatrix();voidShow(constchar*pre=NULL)const;//输出矩阵voidFree();intResize(introw,intcol);//重新定义矩阵⼤⼩intGetRow()const{returnm_iRow;}//返回矩阵⾏数intGetCol()const{returnm_iCol;}//返回矩阵列数intRowSwap(intx,inty);//⾏交换,成功返回1,否则0intColSwap(intx,inty);//列交换staticvoidSetZero(doublez);//设定ZERO的值,所有CMatrix实例精度都将改变constCMatrixTranspose()const;//返回转置矩阵constCMatrixAdjoint()const;//伴随矩阵constCMatrixResidue(introw,intcol)const;//求对应元素的余⼦式constCMatrixContrary()const;//逆矩阵constCMatrixGauss_Jordan(double*pDet=NULL)const;//逆矩阵(⾼斯-约旦法),pDet为⾏列式,//此法精度较低,但效率较⾼doubleResidue_a(introw,intcol)const;//求对应元素的代数余⼦式doubleDeterminant()const;//返回⽅阵的⾏列式doubleDet_Recursion()const;//返回⽅阵的⾏列式(递归)intIsZero()const;//判断元素是否全为0(零矩阵)intIsPhalanx()const;//判断是否为⽅阵intIsReverse()const;//判断矩阵是否可逆intIsNonfunnyPhalanx()const;//判断是否⾮奇异⽅阵double*operator[](inti)const;//操作单个元素CMatrix&operator=(constCMatrix&right);CMatrix&operator=(constdouble*pRight);CMatrix&operator=(constdouble**ppRight);constCMatrix&operator+()const;//⼀元操作符constCMatrixoperator-()const;//⼀元操作符constCMatrixoperator+(constCMatrix&right)const;constCMatrixoperator-(constCMatrix&right)const;constCMatrixoperator*(constCMatrix&right)const;constCMatrixoperator*(constdouble&right)const;constCMatrixoperator/(constdouble&right)const;CMatrix&operator+=(constCMatrix&right);CMatrix&operator-=(constCMatrix&right);CMatrix&operator*=(constCMatrix&right);CMatrix&operator*=(constdouble&right);CMatrix&operator/=(constdouble&right);intoperator==(constCMatrix&right)const;intoperator!=(constCMatrix&right)const;private:intm_iRow;//⾏数intm_iCol;//列数double**m_ppData;//数据};#endif//__MATRIX_DOT_H__//matrix.cpp//#include#include#include#include#include#include"matrix.h"doubleCMatrix::ZERO=1e-10;CMatrix::CMatrix(introw/*=