public static int computeBlockSize(MatrixCharacteristics mc){
  int brlen=mc.getRowsPerBlock();
  int basic=Math.max((int)(FrameBlock.BUFFER_SIZE / mc.getCols()),1);
  int div=(int)Math.ceil((double)brlen / basic);
  while (brlen % div != 0)   div++;
  return brlen / div;
}

public static int computeBlockSize ( MatrixCharacteristics mc ) { int brlen = mc . getRowsPerBlock ( ) ; int basic = Math . max ( ( int ) ( FrameBlock . BUFFER_SIZE / mc . getCols ( ) ) , 1 ) ; int div = ( int ) Math . ceil ( ( double ) brlen / basic ) ; while ( brlen % div != 0 ) div ++ ; return brlen / div ; }
computes an output row block size that ensures matrix block alignment and contains at most frameblock . buffer_size cells per block .
