code: public static void convertTranSrc(DMatrixRMaj src , DMatrixRBlock dst )
      {
          if( src.numRows != dst.numCols || src.numCols != dst.numRows )
              throw new IllegalArgumentException("Incompatible matrix shapes.");
  
          for( int i = 0; i < dst.numRows; i += dst.blockLength ) {
              int blockHeight = Math.min( dst.blockLength , dst.numRows - i);
  
              for( int j = 0; j < dst.numCols; j += dst.blockLength ) {
                  int blockWidth = Math.min( dst.blockLength , dst.numCols - j);
  
                  int indexDst = i*dst.numCols + blockHeight*j;
                  int indexSrc = j*src.numCols + i;
  
                  for( int l = 0; l < blockWidth; l++ ) {
                      int rowSrc = indexSrc + l*src.numCols;
                      int rowDst = indexDst + l;
                      for( int k = 0; k < blockHeight; k++ , rowDst += blockWidth ) {
                          dst.data[ rowDst ] = src.data[rowSrc++];
                      }
                  }
              }
          }
      }
docs: Converts the transpose of a row major matrix into a row major block matrix.
  
  @param src Original DMatrixRMaj.  Not modified.
  @param dst Equivalent DMatrixRBlock. Modified.