📄 eigenvalue.cpp
字号:
//MatrixSingularValue.cpp 一般实矩阵的奇异值分解
#include <valarray> //模板类valarray的标准头文件
#include <complex>
#include <math.h>
#include <iostream> //输入输出流
#include "Matrix.h" //矩阵类及相关函数等的定义
#include "EigenvalueVector.h"
using namespace std; //名字空间
void main() // 定义控制台应用程序的入口点
{
double dma[3][3] = { { 11.0, 5.0, 8.0},
{ -5.0, 6.0, 10.0},
{ -2.0, 3.0, 4}};
//--------------------QR-------------------------------
matrix<double> matA(&dma[0][0], 3, 3);
matrix<double> matB(3,3);
cout<<endl<<"matA:"<<endl;
MatrixLinePrint(matA);
/* if(MatrixQR(matA,matB))
{
cout<<endl<<"Q:"<<endl;
MatrixLinePrint(matB);
cout<<endl<<"R:"<<endl;
MatrixLinePrint(matA);
} */
//-------------------------特征值------------------------
//求赫申伯格阵全部特征值QR法
// HessenbergTransform(matA);
// valarray<complex<double> > uv(3);
// EigenvalueVectorHessenbergQR(matA,uv,1e-8,1e6);
// cout<<endl<<"uv:"<<endl<<uv[0]<<endl<<uv[1]<<endl<<uv[2]<<endl<<endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -