     
     public static var identity: Matrix<R, n, m> {
         return self.init { $0 == $1 ? 1 : 0 }
+    }
+}
+
+public typealias ColVector<R: Ring, n: _Int> = Matrix<R, n, _1>
+public typealias RowVector<R: Ring, m: _Int> = Matrix<R, _1, m>
+
+public extension Matrix {
+    public func rowVector(_ i: Int) -> RowVector<R, m> {
+        return RowVector<R, m>{(_, j) -> R in
+            return self[i, j]
+        }
+    }
+    
+    public func colVector(_ j: Int) -> ColVector<R, n> {
+        return ColVector<R, n>{(i, j0) -> R in
+            print("\(i), \(j0)")
+            return self[i, j0]
+        }
     }
 }
 

        }
    }
}

    
    private func index(_ i: Int, _ j: Int) -> Int {
        return (i * cols) + j
    }
    
    public subscript(index: Int) -> R {
        get {
            return elements[index]
        }
        set {
            elements[index] = newValue
        }
    }
    
    public subscript(i: Int, j: Int) -> R {
