function [lm,xv1,xv2] = One_Correction_Step_Nonsymmetric_Space(mesh,lmb1,A1,M1,Base0,...
                     Base1,Base2,xv1,xv2,coeff,mass,coeff_mix,...
                     coord3,coord4,Eigen_Low,Eigen_Up,u_D,u_N)
        
%==========================================================================        
%  Do the one correction step for the nonsymetric eigenvalue problem with
%  the multi space way
%  Mesh: the current mesh for the finite element discretization
%  lmb1: the current eigenvalue approximation
%  A1,M1: the background stiff and mass matrices
%  Base0: the background base function
%  Base1: the current base function for the current solution xv1 and xv2
%  xv1: the current right hand eigenfunction on Base1
%  xv2: the current left hand eigenfunction on Base2
%  coeff: the coeffieient function for the stiff matrix
%  mass: the coefficient function for the mass matrix 
%  coeff_mix: the coefficient function for the mixed matrix
%  corrd3, corrd4: the quadrature information for building matrices
%  Eigen_Low, Eigen_Up: the interval for the eigenvalue solution with the
%  Arnoldi method
%  u_D, u_N: the boundary condition for the Dirichlet or Neumann type ssss
%============hehu Xie======================================
%   2012-10-09
%==========================================================================
fprintf('Do the correction step for the nonsymetric eigenvalue problem!\n');
%-------------get the number of the eigenvalues----------------------------
Num_Eig = length(lmb1)
%-----------To do the correction first time--------------------------------
%-----------Solve the boundary value problem-------------------------------
Mix = mix_matrix(Base2,Base2,coord3,coord4,mesh,coeff_mix);
A = stiff_matrix(Base2,Base2,coord3,coord4,mesh,coeff);
A = A +  Mix';
%--------------------------------------------------------------------------
M = mass_matrix(Base2,Base1,coord3,coord4,mesh,mass);
RHS = M*xv1*diag(lmb1);
[A,RHS] = Poission_BoundaryTreatment(mesh,Base2,u_D,A,RHS);
xv1 = A\RHS;
A = A - Mix';
%---------correction for the adjoint eigenvalue problem--------------------
RHS = M*xv2*diag(lmb1);
A = A + Mix;
[A,RHS] = Poission_BoundaryTreatment(mesh,Base2,u_D,A,RHS);
xv2 = A\RHS;
A = A - Mix;
%-----------Solve the adjoint system---------------------------------------
M2 = mass_matrix(Base2,Base2,coord3,coord4,mesh,mass);
%---------to do the correction second time---------------------------------
%--------------------A12---------------------------------------------------
A20 = stiff_matrix(Base2,Base0,coord3,coord4,mesh,coeff);
A02 = A20';
Mix20 = mix_matrix(Base2,Base0,coord3,coord4,mesh,coeff_mix);
Mix02 = mix_matrix(Base0,Base2,coord3,coord4,mesh,coeff_mix);
%----------------------------solve the small eigenvalue problem------------
b1n = xv2'*A20;
b1n = b1n + xv2' * Mix02'; 
%-----------A21-----------------------
b2n = A02 * xv1;
b2n = b2n + Mix20' * xv1;
%-----------A22-----------------------
ann = xv2' * (A + Mix') * xv1;
%------------Build the stiff matrix for the iegenvalue problem-------------
D = [A1,b2n;b1n,ann];
%-------build the mass matirx: symmetric-----------------------------------
M = mass_matrix(Base2,Base0,coord3,coord4,mesh,mass);
b1n = xv2'*M;
b2n = M'*xv1;
Mass = [M1,b2n;b1n,xv2'*M2*xv1];
[D,Mass] = Poission_BoundaryTreatment(mesh,Base0,u_D,D,Mass);
%-----eigenvalue-----------------------------------------------------------
tic;
[xvv1,lm,iresult]=sptarn(D,Mass,Eigen_Low,Eigen_Up);
toc
'right problem'
lm = lm(1:Num_Eig)
xvv1 = xvv1(:,1:Num_Eig);
%------------Produce the solution of the multi-level solution xvv1---------
xv1 = xv1 * xvv1(end-Num_Eig+1:end,:);
for kk= 1:Num_Eig
    xv1(:,kk) = Prolongate_Space(mesh,xvv1(1:end-Num_Eig,kk),Base0,Base2) + ...
                xv1(:,kk);
end
%--------------------------------------------------------------------------
%------------For the adjoint eigenvalue problem----------------------------
%--------------------------------------------------------------------------
% %A = A;
% A1 = A1';
% %-----------A12-----------------------
% b1n = xv2'*A20;
% b1n = b1n + xv2' * Mix20;
% %-----------A21-----------------------
% b2n = A02*xv2;
% b2n = b2n + Mix02*xv2;
% %-----------A22-----------------------
% ann = xv2'*(A + Mix)*xv2;
% %------------Build the stiff matrix for the iegenvalue problem-------------
% D = [A1,b2n;b1n,ann];
% %-------build the mass matirx: symmetric-----------------------------------
% b1n = xv2'*M;
% Mass = [M1,b1n';b1n,xv2'*M2*xv2];
D = D';
Mass = Mass';
[D,Mass] = Poission_BoundaryTreatment(mesh,Base0,u_D,D,Mass);
% %---eigenvalue-----------------------------------------------------------
tic;
[xvv2,lm2,iresult]=sptarn(D,Mass,Eigen_Low,Eigen_Up);
toc
'left problem'
lm2 = lm2(1:Num_Eig)
xvv2 = xvv2(:,1:Num_Eig);
%A1 = A1';
%------------Produce the solution of the multi-level solution xvv1---------
xv2 = xv2*xvv2(end-Num_Eig+1:end,:);
for kk=1:Num_Eig
    xv2(:,kk) = Prolongate_Space(mesh,xvv2(1:end-Num_Eig,kk),Base0,Base2)+...
                xv2(:,kk);
end