package de.kleppmann.maniation.maths;

import java.util.List;

public class SparseMatrix implements Matrix {
    
    public interface Slice {
        int getStartRow();
        int getStartColumn();
        int getRows();
        int getColumns();
        Matrix getMatrix();
    }
    
    private int rows, columns;
    private List<Slice> slices = new java.util.ArrayList<Slice>();

    public SparseMatrix(int rows, int columns) {
        this.rows = rows; this.columns = columns;
    }
    
    public void addSlice(Slice slice) {
        slices.add(slice);
    }

    public int getRows() {
        return rows;
    }

    public int getColumns() {
        return columns;
    }

    public double getComponent(int row, int column) {
        // TODO Auto-generated method stub
        return 0;
    }

    public Matrix transpose() {
        // TODO Auto-generated method stub
        return null;
    }

    public Matrix inverse() {
        // TODO Auto-generated method stub
        return null;
    }

    public Matrix mult(double scalar) {
        // TODO Auto-generated method stub
        return null;
    }

    public Matrix mult(Matrix other) {
        // TODO Auto-generated method stub
        return null;
    }

    public Vector mult(Vector vec) {
        // TODO Auto-generated method stub
        return null;
    }

    public Matrix add(Matrix other) {
        // TODO Auto-generated method stub
        return null;
    }

    public Matrix subtract(Matrix other) {
        // TODO Auto-generated method stub
        return null;
    }

}

@@ -277,24 +277,766 @@
 %0A    %7D%0A    %0A
+%0A    public static class SliceImpl implements Slice %7B%0A        private Matrix m;%0A        private int startRow, startColumn, rows, columns;%0A        %0A        public SliceImpl(Matrix m, int startRow, int startColumn) %7B%0A            this.m = m; this.startRow = startRow; this.startColumn = startColumn;%0A            this.rows = m.getRows(); this.columns = m.getColumns();%0A        %7D%0A        public int getStartRow() %7B%0A            return startRow;%0A        %7D%0A        public int getStartColumn() %7B%0A            return startColumn;%0A        %7D%0A        public int getRows() %7B%0A            return rows;%0A        %7D%0A        public int getColumns() %7B%0A            return columns;%0A        %7D%0A        public Matrix getMatrix() %7B%0A            return m;%0A        %7D%0A    %7D%0A%0A
     private 

Add nested class SliceImpl.