-
大小: 10.63MB文件類型: .zip金幣: 2下載: 0 次發(fā)布日期: 2023-11-14
- 語言: 其他
- 標(biāo)簽: GSL函數(shù)庫??
資源簡介
復(fù)數(shù)矩陣的特征值分解,使用了GSL科學(xué)計(jì)算函數(shù)庫,使得特征值分解時(shí)間大大減少。

代碼片段和文件信息
//?GSL_特征值分解.cpp?:?定義控制臺應(yīng)用程序的入口點(diǎn)。
//
#include?“stdafx.h“
#include?
#include?
#include?
#include?
#include?
#include??
#include?
#include?
#include?
#include?
#include?
#include?
using?namespace?std;
#define?M?????8????????????//預(yù)設(shè)陣元數(shù)
#define?Nf????200
int?_tmain(int?argc?_TCHAR*?argv[])
{
gsl_matrix_complex?*RSR??=?gsl_matrix_complex_alloc(MM);//申請接收信號的自相關(guān)空間?
gsl_matrix_complex?*eVec?=?gsl_matrix_complex_alloc(MM);//申請相關(guān)矩陣特征向量空間
gsl_vector?????????*eVal?=?gsl_vector_alloc(M);//申請?zhí)卣髦悼臻g?
FILE?*filep;
char?*str1;
char?*str2;
float?ttr[M*M];
float?tti[M*M];
str1=“ttr.dat“;
str2=“tti.dat“;
filep=fopen(str1“r+b“);
if?(filep!=NULL)
{
for?(int?ii=0?;ii {
fread(&ttr[ii]41filep);
}
}
fclose(filep);
filep=fopen(str2“r+b“);
if?(filep!=NULL)
{
for?(int?ii=0?;ii {
fread(&tti[ii]41filep);
}
}
fclose(filep);
gsl_complex?temp;
int?ijx;
for?(i=0;i for?(j=0;j {
temp.dat[0]?=?ttr[i*M+j];
temp.dat[1]?=?tti[i*M+j];
gsl_matrix_complex_set(RSRijtemp);
}
LARGE_INTEGER?litmp;???//計(jì)時(shí)
LONGLONG?QPart1QPart2;
double?dfMinusdfFreqdfTime;
QueryPerformanceFrequency(&litmp);
dfFreq=(double)litmp.QuadPart;
QueryPerformanceCounter(&litmp);
QPart1=litmp.QuadPart;
for?(x=0;x {
gsl_eigen_hermv_workspace?*ws?=?gsl_eigen_hermv_alloc?(M);
gsl_eigen_hermv?(RSR?eValeVec?ws);
gsl_eigen_hermv_free(ws);
gsl_eigen_hermv_sort?(eVal?eVec?GSL_EIGEN_SORT_VAL_ASC);//對所獲得特征值與向量按升序排序?
}
QueryPerformanceCounter(&litmp);
QPart2=litmp.QuadPart?;
dfMinus=(double)(QPart2-QPart1);
dfTime=dfMinus/dfFreq;
gsl_matrix_complex_free(RSR);//釋放接收信號的自相關(guān)空間?
gsl_matrix_complex_free(eVec);//釋放相關(guān)矩陣特征向量空間
gsl_vector_free(eVal);//釋放特征值空間
printf(“\n特征值時(shí)間為:%4f?ms\n“?dfTime*1000.0);
getchar();
return?0;
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-07-02?08:18??GSL_特征值分解\
?????目錄???????????0??2014-07-02?08:18??GSL_特征值分解\Debug\
?????文件???????29184??2014-06-09?19:39??GSL_特征值分解\Debug\GSL_特征值分解.exe
?????文件?????????406??2014-06-09?19:37??GSL_特征值分解\Debug\GSL_特征值分解.exe.manifest
?????文件??????366480??2014-06-09?19:39??GSL_特征值分解\Debug\GSL_特征值分解.ilk
?????文件??????805888??2014-06-09?19:39??GSL_特征值分解\Debug\GSL_特征值分解.pdb
?????目錄???????????0??2014-07-02?08:18??GSL_特征值分解\GSL_特征值分解\
?????文件????30625792??2014-06-10?01:06??GSL_特征值分解\GSL_特征值分解.sdf
?????文件?????????924??2014-06-09?18:37??GSL_特征值分解\GSL_特征值分解.sln
?????文件???????10240??2014-06-10?01:06??GSL_特征值分解\GSL_特征值分解.suo
?????目錄???????????0??2014-07-02?08:18??GSL_特征值分解\GSL_特征值分解\Debug\
?????文件????????1482??2014-06-09?19:39??GSL_特征值分解\GSL_特征值分解\Debug\cl.command.1.tlog
?????文件???????33210??2014-06-09?19:39??GSL_特征值分解\GSL_特征值分解\Debug\CL.read.1.tlog
?????文件?????????668??2014-06-09?19:39??GSL_特征值分解\GSL_特征值分解\Debug\CL.write.1.tlog
?????文件???????????2??2014-06-09?19:36??GSL_特征值分解\GSL_特征值分解\Debug\GSL_特征值分解.exe.em
?????文件??????????68??2014-06-09?19:36??GSL_特征值分解\GSL_特征值分解\Debug\GSL_特征值分解.exe.em
?????文件?????????381??2014-06-09?19:39??GSL_特征值分解\GSL_特征值分解\Debug\GSL_特征值分解.exe.intermediate.manifest
?????文件??????????57??2014-06-09?19:39??GSL_特征值分解\GSL_特征值分解\Debug\GSL_特征值分解.lastbuildstate
?????文件????????3084??2014-06-09?19:39??GSL_特征值分解\GSL_特征值分解\Debug\GSL_特征值分解.log
?????文件???????63958??2014-06-09?19:39??GSL_特征值分解\GSL_特征值分解\Debug\GSL_特征值分解.obj
?????文件?????1179648??2014-06-09?19:36??GSL_特征值分解\GSL_特征值分解\Debug\GSL_特征值分解.pch
?????文件?????????713??2014-06-09?19:36??GSL_特征值分解\GSL_特征值分解\Debug\GSL_特征值分解.vcxprojResolveAssemblyReference.cache
?????文件???????????0??2014-06-09?19:36??GSL_特征值分解\GSL_特征值分解\Debug\GSL_特征值分解.write.1.tlog
?????文件?????????208??2014-06-09?19:36??GSL_特征值分解\GSL_特征值分解\Debug\GSL_特征值分解_manifest.rc
?????文件????????1366??2014-06-09?19:39??GSL_特征值分解\GSL_特征值分解\Debug\li
?????文件????????3328??2014-06-09?19:39??GSL_特征值分解\GSL_特征值分解\Debug\li
?????文件?????????592??2014-06-09?19:39??GSL_特征值分解\GSL_特征值分解\Debug\li
?????文件?????????406??2014-06-09?19:39??GSL_特征值分解\GSL_特征值分解\Debug\mt.command.1.tlog
?????文件?????????250??2014-06-09?19:39??GSL_特征值分解\GSL_特征值分解\Debug\mt.read.1.tlog
?????文件?????????250??2014-06-09?19:39??GSL_特征值分解\GSL_特征值分解\Debug\mt.write.1.tlog
?????文件?????????508??2014-06-09?19:36??GSL_特征值分解\GSL_特征值分解\Debug\rc.command.1.tlog
............此處省略20個(gè)文件信息
評論
共有 條評論