class SparseMatrix extends AbstractMatrix {

    @Override
    public void set(int i, int j, double value) {
        checkBounds(i, j);
        if (j == currentColumn) {
            // ok, continue to fill row
        } else if (j > currentColumn) {
            // start new column
            columnStart[j] = values.size();
            currentColumn = j;
        } else {
            throw new PowsyblException("Columns have to be filled in the right order");
        }
        values.add(value);
        rowIndices.add(i);
        columnStart[columnStart.length - 1] = values.size();
        columnValueCount[j]++;
    }

      SparseMatrix(int rowCount, int columnCount, int[] columnStart, int[] rowIndices, double[] values);
      SparseMatrix(int rowCount, int columnCount, int estimatedNonZeroValueCount);

}