code: public static void rankNUpdate(int blockLength , double alpha ,
                                     DSubmatrixD1 A , DSubmatrixD1 B )
      {
  
          int heightB = B.row1-B.row0;
          if( heightB > blockLength )
              throw new IllegalArgumentException("Height of B cannot be greater than the block length");
  
          int N = B.col1-B.col0;
  
          if( A.col1-A.col0 != N )
              throw new IllegalArgumentException("A does not have the expected number of columns based on B's width");
          if( A.row1-A.row0 != N )
              throw new IllegalArgumentException("A does not have the expected number of rows based on B's width");
  
          for( int i = B.col0; i < B.col1; i += blockLength ) {
  
              int indexB_i = B.row0*B.original.numCols + i*heightB;
              int widthB_i = Math.min(blockLength,B.col1-i);
  
              int rowA = i-B.col0+A.row0;
              int heightA = Math.min( blockLength , A.row1 - rowA);
  
              for( int j = B.col0; j < B.col1; j += blockLength ) {
  
                  int widthB_j = Math.min(blockLength,B.col1-j);
  
                  int indexA = rowA * A.original.numCols + (j-B.col0+A.col0)*heightA;
                  int indexB_j = B.row0*B.original.numCols + j*heightB;
  
                  InnerMultiplication_DDRB.blockMultPlusTransA(alpha,
                          B.original.data,B.original.data,A.original.data,
                          indexB_i,indexB_j,indexA,heightB,widthB_i,widthB_j);
              }
          }
      }
docs: <p>
  Performs:<br>
  <br>
  A = A + &alpha; B <sup>T</sup>B
  </p>
  
  @param blockLength Size of the block in the block matrix.
  @param alpha scaling factor for right hand side.
  @param A Block aligned submatrix.
  @param B Block aligned submatrix.