function y=solveSEPSS(B,LNp,UNp,pNp,LCpbet,UCpbet,pCpb,x,semi) 
%Summary of this function goes here
%y=inv(SEPSS)x; y=[y1;y2]; x=[x1;x2]
m1=size(B,2);
x1=x(1:m1,1);x2=x(m1+1:end);
if semi==1
   s2(pCpb,:)=UCpbet\(LCpbet\(x2(pCpb)));
else 
   s2=gmres(LCpbet*UCpbet,x2);
end
s1=x1-B'*s2;
y1(pNp,:)=UNp\(LNp\(s1(pNp)));
t2=x2+B*y1;
y2(pCpb,:)=UCpbet\(LCpbet\(t2(pCpb)));
y=[y1;y2];
end
