function res=mrses(A,B,k,Niter,Ncycle,distmod,block)
  if (nargin<7)
    block=256;
  end
  if (nargin<6)
    distmod=1;
  end
  if (nargin<5)
    Ncycle=1000;
  end
  if (nargin<4)
    Niter=500;
  end
  if (nargin<3)
    k=5;
  end
  if (nargin<2)
    error('As minimum two matrixes needed for MRSES');
  end
  if (nargin>6)
    error('Too much parameters');
  end

  sa=size(A);sb=size(B);
  if (sa(2)==sb(2))
    genes=sa(2);
  else
    error('Features dimension mismatch');
  end

  ctx = mrses_hw();
  mrses_hw(ctx, 1, k, block, single(A), single(B), distmod);

  for icycle=0:block:(Ncycle-1)
    block_size = min(block, Ncycle - icycle);
    mrses_hw(ctx, 15, Niter, block_size);
  end
  n = mrses_hw(ctx, 16);
  mrses_hw(ctx);

  H=[double(n)./Ncycle;1:genes];
  res=flipud(sortrows(H'));
