lapack
lapack copied to clipboard
reorder schur decomposition
hello dears, i have tried to use the executing the following code, but it seems does not work at least in my point of view,
char job,compq; int ldq ,ldt, N=8, M,info , order=N;
job = 'B';
compq = 'V';
int select[N]; // int selec[8] works same.
for(int i =0 ; i < N; i++)
{select[i]=false;}
ldt=N;
ldq =N;
Eigen::VectorXd wr(N);
Eigen::VectorXd wi(N);
int lwork=ldq*8;
Eigen::VectorXi iwork(lwork);
int liwork = 1/*std::max(1,M*(N-M))*/;
Eigen::VectorXd work(lwork);
double s;
double sep;
LAPACK_dtrsen(&job,&compq,select,&order,U.data(),&ldt,T.data(),&ldq,wr.data(),wi.data(),&M,&s,&sep,work.data(),&lwork,iwork.data(),&liwork,&info);
please define two matrices U and T which are unitary and upper triangular matrices respectively. this LAPACK_dtrsen function should update mentioned matrices with reordered ones. please take a look at this and let me know your idea, thank you so much for your time.
best,