📄 eigenvaluevectorrealsymmetryjacobib.cpp
字号:
//EigenvalueVectorRealSymmetryJacobiB.cpp
//实对称阵特征值及特征向量雅可比过关法
#include <iostream> //输入输出流头文件
#include "Matrix.h" //矩阵类及相关函数头文件
#include "EigenvalueVector.h" //特征值及特征向量头文件
using namespace std; //名字空间
void main() // 定义控制台应用程序的入口点
{
double a[5][5] =
{
{10.0, 1.0, 2.0, 3.0, 4.0},
{ 1.0, 9.0, -1.0, 2.0, -3.0},
{ 2.0, -1.0, 7.0, 3.0, -5.0},
{ 3.0, 2.0, 3.0, 12.0, -1.0},
{ 4.0, -3.0, -5.0, -1.0, 15.0}
};
matrix<double> v(5,5), da(&a[0][0],5,5);
double eps = FLOATERROR;
cout.setf(ios::fixed); //输出数据为定点法
cout.precision(6); //精度6位
if(EigenvalueVectorRealSymmetryJacobiB(da,v,eps)>0)
{
cout << "MATRIX A IS: " << endl;
MatrixLinePrint(da);
cout << endl;
cout << "MATRIX V IS: " << endl;
MatrixLinePrint(v);
cout << endl;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -