code: public static void divideRowsCols( double []diagA , int offsetA ,
                                         DMatrixRMaj B ,
                                         double []diagC , int offsetC )
      {
          if( diagA.length-offsetA < B.numRows ) {
              throw new IllegalArgumentException("Not enough elements in diagA.");
          }
          if( diagC.length-offsetC < B.numCols ) {
              throw new IllegalArgumentException("Not enough elements in diagC.");
          }
  
          final int rows = B.numRows;
          final int cols = B.numCols;
  
          int index = 0;
          for (int row = 0; row < rows; row++) {
              double va = diagA[offsetA+row];
              for (int col = 0; col < cols; col++, index++) {
                  B.data[index] /= va*diagC[offsetC+col];
              }
          }
      }
docs: Equivalent to multiplying a matrix B by the inverse of two diagonal matrices.
  B = inv(A)*B*inv(C), where A=diag(a) and C=diag(c).
  
  @param diagA Array of length offsteA + B.numRows
  @param offsetA First index in A
  @param B Rectangular matrix
  @param diagC Array of length indexC + B.numCols
  @param offsetC First index in C