code: public double[][] toDenseArray() {
          // Grab the write lock to prevent any new rows from being updated
          rowWriteLock.lock();
          // Then grab the whole matrix lock to prevent any values from being set
          // while this method converts the rows into arrays.
          denseArrayWriteLock.lock();
          int c = cols.get();
          double[][] m = new double[rows.get()][c];
          for (Map.Entry<Integer, AtomicVector> e : sparseMatrix.entrySet()) {
              m[e.getKey()] = toArray(e.getValue(), c);
          }
          denseArrayWriteLock.unlock();
          rowWriteLock.unlock();
          return m;
      }
docs: {@inheritDoc}