Changeset 2562 in Sophya for trunk/SophyaProg
- Timestamp:
- Jul 23, 2004, 12:54:27 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaProg/Tests/tsttminv.cc
r2558 r2562 27 27 #define ALSO_LAPACK_EV_SYM 28 28 #define ALSO_LAPACK_SVD 29 #define ALSO_LAPACK_SVD_DC 29 30 30 31 ////////////////////////////////////////////////// … … 338 339 cout<<"------------ Eigen decompositon LapackEigen "<<endl; 339 340 A=Ainput; 340 TMatrix< TYPE > Evec (N,N); Evec = (TYPE) 0;341 TVector< complex<r_8> > Eval (N); Eval = complex<r_8>(0,0);341 TMatrix< TYPE > Evec; 342 TVector< complex<r_8> > Eval; 342 343 //-- Decompositon 343 344 int_4 info = LapackEigen(A,Eval,Evec,true); … … 434 435 cout<<"------------ SVD decompositon LapackSVD "<<endl; 435 436 A=Ainput; 436 TVector< TYPE > S (N,N); TMatrix< TYPE > U(N,N); TMatrix< TYPE > VT(N,N);437 TVector< TYPE > S; TMatrix< TYPE > U; TMatrix< TYPE > VT; 437 438 //-- Decompositon 438 439 int_4 info = LapackSVD(A,S,U,VT); … … 453 454 Check_Mat_Zero(AmUSVt); 454 455 PrtTim("--- End of LapackSVD Test ---"); 456 } 457 #endif 458 459 460 /////////////////////////////////////////////////// 461 ///////////// Test avec Lapack SVD_DC ///////////// 462 /////////////////////////////////////////////////// 463 #if defined(USE_LAPACK) && defined(ALSO_LAPACK_SVD_DC) 464 { 465 cout<<"\n=========================================="<<endl; 466 cout<<"------------ SVD decompositon LapackSVD_DC "<<endl; 467 A=Ainput; 468 TVector< TYPE > S; TMatrix< TYPE > U; TMatrix< TYPE > VT; 469 //-- Decompositon 470 int_4 info = LapackSVD_DC(A,S,U,VT); 471 cout<<"info="<<info<<endl; 472 PrtTim("--- End of LapackSVD_DC decompositon ---"); 473 if(nprline>0) {cout<<S; cout<<endl;} 474 double smax = ABS_VAL(S(0)), smin = ABS_VAL(S(N-1)); 475 cout<<" Smin = |"<<S(N-1)<<"| = "<<smin<<", " 476 <<" Smax = |"<<S(0)<<"| = "<<smax<<", " 477 <<" --> Smin/Smax = "<<smin/smax<<endl; 478 //-- A = U*S*VT 479 cout<<"Compute A = U*S*VT"<<endl; 480 TMatrix< TYPE > AmUSVt(N,N); AmUSVt = U; 481 for(int i=0;i<N;i++) for(int j=0;j<N;j++) AmUSVt(i,j) *= S(j); 482 AmUSVt *= VT; AmUSVt -= Ainput; 483 if(nprline>0) {cout<<AmUSVt; cout<<endl;} 484 //-- Check 485 Check_Mat_Zero(AmUSVt); 486 PrtTim("--- End of LapackSVD_DC Test ---"); 455 487 } 456 488 #endif
Note:
See TracChangeset
for help on using the changeset viewer.