
function  [TTalpha_j,alpha_j,Tjf,TTLambda_j,Uj1] =  LocalSVD( Pjg_hat,Thresh,Pjf,Lambda_j,Par)
  
   [Uj,Tjg_hat,Vj] =   svd(Pjg_hat); 
    PatNum       = size(Pjg_hat,2);
  alpha_j = Thresholding(Tjg_hat,Lambda_j*Par.eta/(1+Par.eta),Thresh);                        
  TTalpha_j =  Uj*alpha_j*Vj';
  TTLambda_j=Uj*Lambda_j*Vj';
  Tjf=Uj'*Pjf*Vj;
   Uj1=Uj(:,1);

%{
 [Uj,Tjg_hat,Vj] =   mysvd(Pjg_hat); 
    PatNum       = size(Pjg_hat,2);
  alpha_j = Thresholding(Tjg_hat,Lambda_j*Par.eta/(1+Par.eta),Thresh);                        
  TTalpha_j =  Uj*alpha_j*Vj;
  TTLambda_j=Uj*Lambda_j*Vj;
  Tjf=Uj'*Pjf*Vj';
   Uj1=Uj(:,1);
%}
%{
   [Uj,Tjf,Vj] =   svd(Pjf); 
    PatNum       = size(Pjf,2);
    Tjg_hat=Uj'*Pjg_hat*Vj;
  alpha_j = Thresholding(Tjg_hat,Lambda_j*Par.eta/(1+Par.eta),Thresh);                        
  TTalpha_j =  Uj*alpha_j*Vj';
  TTLambda_j=Uj*Lambda_j*Vj';
   Uj1=Uj(:,1);
%}
return;
