code: public synchronized int addColumn(SparseArray<? extends Number> row) {
          if (isFinished)
              throw new IllegalStateException(
                  "Cannot add columns to a MatrixBuilder that is finished");
  
          // Update the size of the matrix based on the size of the array
          if (row.length() > numCols)
              numCols = row.length();
  
          // SparseArray instances can take on the maximum possible array size
          // when the array length isn't specified.  This ruins the matrix size
          // specification since the matrix shouldn't actually be that big.
          // However, because this is an implementation artifact, we can't check
          // for it explicitly with an exception.  Therefore, put in an assert to
          // indicate what is likely going on if asserts are enabled for debugging
          // they symptoms.
          assert row.length() != Integer.MAX_VALUE : "adding a column whose " +
              "length is Integer.MAX_VALUE (was likley left unspecified in the " +
              " constructor).";           
  
          // Write the row to the file.
          int[] nonZero = row.getElementIndices();
          nonZeroValues += nonZero.length;
          StringBuilder sb = new StringBuilder();
          for (int i : nonZero) {
              sb.append(i+1).append(" ");
              sb.append(row.get(i).floatValue()).append(" ");
          }
          writer.println(sb.toString());
          return ++curRow;
      }
docs: {@inheritDoc}