         }
     }
     
-    public static func - (a: Self, b: Self) -> Self {
-        return Self(rows: a.rows, cols: a.cols) { (i, j) -> R in
-            return a[i, j] - b[i, j]
-        }
-    }
-    
     public static func * (r: R, a: Self) -> Self {
         return Self(rows: a.rows, cols: a.cols) { (i, j) -> R in
             return r * a[i, j]

    public var grid: [R]
    
    // root initializer
    public init(rows: Int, cols: Int, grid: [R]) {
        assert(!(rows == Auto && n.self == Dynamic.self) && !(cols == Auto && m.self == Dynamic.self),
               "Must specify rows/cols for DynamicMatrix.")
        
        self.rows = (rows != Auto) ? rows : n.intValue
        self.cols = (cols != Auto) ? cols : m.intValue
        self.grid = grid
    }
    
    public init(rows: Int = Auto, cols: Int = Auto, gen: (Int, Int) -> R) {
        assert(!(rows == Auto && n.self == Dynamic.self) && !(cols == Auto && m.self == Dynamic.self),
               "Must specify rows/cols for DynamicMatrix.")
        
        let _rows = (rows != Auto) ? rows : n.intValue
        let _cols = (cols != Auto) ? cols : m.intValue
        
        let grid = (0 ..< _rows * _cols).map { (index: Int) -> R in
            let (i, j) = index /% _cols
            return gen(i, j)
        }
        self.init(rows: _rows, cols: _cols, grid: grid)
    }

    public init(_ grid: R...) {
        self.init(rows: Auto, cols: Auto, grid: grid)
    }
}



private let Auto = -1

public typealias ColVector<R: Ring, n: _Int>    = Matrix<R, n, _1>
public typealias RowVector<R: Ring, m: _Int>    = Matrix<R, _1, m>
public typealias SquareMatrix<R: Ring, n: _Int> = Matrix<R, n, n>
public typealias DynamicMatrix<R: Ring>         = Matrix<R, Dynamic, Dynamic>
public typealias DynamicColVector<R: Ring>      = Matrix<R, Dynamic, _1>
public typealias DynamicRowVector<R: Ring>      = Matrix<R, _1, Dynamic>

public struct Matrix<_R: Ring, n: _Int, m: _Int>: _Matrix {
    public typealias R = _R
