code: public void setRow(int row, DoubleVector values) {
          if (values.length() != columns)
              throw new IllegalArgumentException("cannot set a row " +
                  "whose dimensions are different than the matrix");
          if (values instanceof SparseVector) {
              SparseVector sv = (SparseVector)values;
              for (int nz : sv.getNonZeroIndices())
                  backingMatrix.set(nz, getRealColumn(nz), values.get(nz));
          }
          else {
              for (int i = 0; i < columnToReal.length; ++i)
                  backingMatrix.set(i, columnToReal[i], values.get(i));
          }
      }
docs: {@inheritDoc}