function One_Correction_Step_Nonsymmetric_Space(A1,M1,Base0,Base1,Base2,xv1,xv2,...
            coeff,mass,coeff_mix)
%  Do the one correction step for the nonsymetric eigenvalue problem with
%  the multi space way
%  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
%======hehu Xie----------
%   2012-10-09
%==========================================================================

%-----------to do the correction first time--------------------------------
A = mix_matrix(Base2,Base2,coord3,coord4,mesh,@coeff_mix);
A = A'+ stiff_matrix(Base2,Base2,coord3,coord4,mesh,@coeff);
M = mass_matrix(Base2,Base1,coord3,coord4,mesh,@mass);
RHS = lmb1*M*xv1;
[A,RHS] = Poission_BoundaryTreatment(mesh,Base2,@u_D,A,RHS);
xv1 = A\RHS;
%---------correction for the adjoint eigenvalue problem--------------------
RHS = lmb1*M*xv2;
A = A';
[A,RHS] = Poission_BoundaryTreatment(mesh,Base2,@u_D,A,RHS);
xv2 = A\RHS;
A = A';
%-----------Solve the adjoint system---------------------------------------
M2 = mass_matrix(Base2,Base2,coord3,coord4,mesh,@mass);
lmb2 = (xv2'*A*xv1)/(xv2'*M2*xv1);
% %---------to do the correction second time-------------------------------
%-----------A12-----------------------
b1n = xv1'*stiff_matrix(Base2,Base1,coord3,coord4,mesh,@coeff);
b1n = b1n + xv1' * mix_matrix(Base2,Base1,coord3,coord4,mesh,@coeff_mix);
%-----------A21-----------------------
b2n = stiff_matrix(Base1,Base2,coord3,coord4,mesh,@coeff)*xv1;
b2n = b2n + mix_matrix(Base1,Base2,coord3,coord4,mesh,@coeff_mix)*xv1;
%-----------A22-----------------------
ann = xv1'*A*xv1;
%------------Build the stiff matrix for the iegenvalue problem-------------
D = [A1,b1n';b2n',ann];
%-------build the mass matirx: symmetric-----------------------------------
b1n = xv1'*M;
Mass = [M1,b1n';b1n,xv1'*M2*xv1];
[D,Mass] = Poission_BoundaryTreatment(mesh,Base1,@u_D,D,Mass);
% %---eigenvalue-----------------------------------------------------------
tic;
[xvv1,lm,iresult]=sptarn(D,Mass,19,lmb1);
toc
lm
xvv1 = xvv1(:,1);
%------------Produce the solution of the multi-level solution xvv1---------
[v_max,index] = max(abs(xvv1))
xv1 = Prolongate_Space(mesh,xvv1(1:end-1),Base1,Base2) + xvv1(end)*xv1;
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
v_max = xv1(index_R)
xv1 = VR_Max*xv1/v_max;
xv1(index_R)
%--------------------------------------------------------------------------
ErrR(2) = error_estimate(mesh,Base2,coord3,coord4,xv1,@ExactGrad_R,'gradient');
%--------------------------------------------------------------------------
%------------For the adjoint eigenvalue problem----------------------------
A = A';
A1 = A1';
%-----------A12-----------------------
b1n = xv2'*stiff_matrix(Base2,Base1,coord3,coord4,mesh,@coeff);
b1n = b1n + xv2' * mix_matrix(Base2,Base1,coord3,coord4,mesh,@coeff_mix);
%-----------A21-----------------------
b2n = stiff_matrix(Base1,Base2,coord3,coord4,mesh,@coeff)*xv2;
b2n = b2n + mix_matrix(Base1,Base2,coord3,coord4,mesh,@coeff_mix)*xv2;
%-----------A22-----------------------
ann = xv2'*A*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,Mass] = Poission_BoundaryTreatment(mesh,Base1,@u_D,D,Mass);
% %---eigenvalue-----------------------------------------------------------
tic;
[xvv2,lm,iresult]=sptarn(D,Mass,19,lmb1);
toc
lm
%------------Produce the solution of the multi-level solution xvv1---------
xv2 = Prolongate_Space(mesh,xvv2(1:end-1),Base1,Base2)+ xvv2(end)*xv2;
v_max = xv2(index_L);
xv2 = VL_Max*xv2/v_max;
ErrL(2) = error_estimate(mesh,Base2,coord3,coord4,xv2,@ExactGrad_L,'gradient');
%--------Update the matrices-------------
A  = A';
A1 = A1';