public static MatrixBlock rexpand(MatrixBlock in,MatrixBlock ret,double max,boolean rows,boolean cast,boolean ignore) throws DMLRuntimeException {
  int lmax=(int)UtilFunctions.toLong(max);
  if (!ignore && in.getNonZeros() < in.getNumRows())   throw new DMLRuntimeException("Invalid input w/ zeros for rexpand ignore=false " + "(rlen=" + in.getNumRows() + ", nnz="+ in.getNonZeros()+ ").");
  if (in.isEmptyBlock(false)) {
    if (rows)     ret.reset(lmax,in.rlen,true);
 else     ret.reset(in.rlen,lmax,true);
    return ret;
  }
  if (rows)   return rexpandRows(in,ret,lmax,cast,ignore);
 else   return rexpandColumns(in,ret,lmax,cast,ignore);
}

public static MatrixBlock rexpand ( MatrixBlock in , MatrixBlock ret , double max , boolean rows , boolean cast , boolean ignore ) throws DMLRuntimeException { int lmax = ( int ) UtilFunctions . toLong ( max ) ; if ( ! ignore && in . getNonZeros ( ) < in . getNumRows ( ) ) throw new DMLRuntimeException ( "Invalid input w/ zeros for rexpand ignore=false " + "(rlen=" + in . getNumRows ( ) + ", nnz=" + in . getNonZeros ( ) + ")." ) ; if ( in . isEmptyBlock ( false ) ) { if ( rows ) ret . reset ( lmax , in . rlen , true ) ; else ret . reset ( in . rlen , lmax , true ) ; return ret ; } if ( rows ) return rexpandRows ( in , ret , lmax , cast , ignore ) ; else return rexpandColumns ( in , ret , lmax , cast , ignore ) ; }
cp rexpand operation ( single input , single output )
