             let item = array[i]
             buffer[begin..<end] = item[0..<self.cols]
         }
-        self.la = la_matrix_from_double_buffer( buffer,
-                                                la_count_t(self.rows),
-                                                la_count_t(self.cols),
-                                                la_count_t(self.cols),
-                                                la_hint_t(LA_NO_HINT),
-                                                la_attribute_t(LA_DEFAULT_ATTRIBUTES))
+        self.la = toLaObject(buffer, rows: self.rows, cols: self.cols)
     }
     
     init(array: [Double], rows: Int, cols: Int) {
         self.rows_ = rows
         self.cols_ = cols
-        self.la = la_matrix_from_double_buffer( array,
-                                                la_count_t(self.rows),
-                                                la_count_t(self.cols),
-                                                la_count_t(self.cols),
-                                                la_hint_t(LA_NO_HINT),
-                                                la_attribute_t(LA_DEFAULT_ATTRIBUTES))
+        self.la = toLaObject(array, rows: self.rows, cols: self.cols)
     }
     
     init(value: Double, rows: Int, cols: Int) {
         self.rows_ = rows
         self.cols_ = cols
         let array = [Double](count: rows * cols, repeatedValue: value)
-        self.la = la_matrix_from_double_buffer( array,
-            la_count_t(rows),
-            la_count_t(cols),
-            la_count_t(cols),
-            la_hint_t(LA_NO_HINT),
-            la_attribute_t(LA_DEFAULT_ATTRIBUTES))
+        self.la = toLaObject(array, rows: self.rows, cols: self.cols)
     }
     
     init(la: la_object_t) {

    subscript (row: Int, col: Int) -> Double {
        get {
            let theRow = checkRow(row)
            let theCol = checkRow(col)
            var array = [0.0]
            let slice = la_matrix_slice(   self.la,
                                            la_index_t(theRow),

        
        set(value) {
            var buffer = self.flat
            let index = col + row * self.cols
            assert(index >= 0 && index < self.cols * self.rows)
            buffer[index] = value
            self.la = toLaObject(buffer, rows: self.rows, cols: self.cols)
        }
    }
    
    subscript (rowOrColumn: Int) -> RMatrix {
        get {
            if self.isRowVector {
                let col = checkCol(rowOrColumn)
                let array: [Double] = [0.0]
                array[0] = self[0, col]
                return RMatrix(array: array, rows: 1, cols: 1)
            }
            else if self.isColVector {
                let row = checkRow(rowOrColumn)
                let array: [Double] = [0.0]
                array[0] = self[row, 0]
                return RMatrix(array: array, rows: 1, cols: 1)
            }
            else {
                let row = checkRow(rowOrColumn)
                let slice = la_matrix_slice(   self.la,
                                            la_index_t(row),
                                            0,
                                            1,
                                            1,
                                            1,
                                            la_count_t(self.cols))
                return RMatrix(la: slice)
            }        
        }
    }
    
