         return RMatrix(la: la)
     }
     
+    public func insert(array: [[Double]], axis: Int = 0) {
+        let rows = array.count
+        let cols = array.first!.count
+        if axis == 0 {
+            assert(self.cols == cols)
+            self.rows += rows
+            var flat = self.flat
+            flat += array.flatten()
+            self.la = toLaObject(flat, rows: self.rows, cols: self.cols)            
+        }
+        else {
+            assert(self.rows == rows)
+            self.cols += cols
+            var buffer = [Double](count: self.cols * self.rows, repeatedValue: 0.0)
+            var index: Int = 0
+            for var row = 0; row < self.rows; row++ {
+                for var col = 0; col < self.cols; col++ {
+                    buffer[index] = self[row, col]
+                    index++
+                }
+                for var col = 0; col < cols; col++ {
+                    buffer[index] = array[row][col]
+                    index++
+                }
+            }
+            self.la = toLaObject(flat, rows: self.rows, cols: self.cols)  
+        }
+    }
+    
     public func invert() -> RMatrix {
         var flat = self.flat
         for var i = 0; i < self.rows * self.cols; i++ {

        }
    }
    
    private func checkRow(row: Int) -> Int {
        assert(row >= 0 && row < self.rows)
        return (row >= 0) ?  row : self.rows + row

    }
    
    public var array: [[Double]] {
        let flat = self.flat
        var array = [[Double]]()
        for var i = 0; i < self.rows; i++ {
            let begin = i * self.cols
            let end = begin + self.cols - 1
            let item = Array(flat[begin...end])
            array.append(item)
        }
        return array
