             let currentRowStartIndex = nextRowStartIndex
             nextRowStartIndex += self.columns
 
-            return self.grid[currentRowStartIndex..<nextRowStartIndex]
+            return self.elements[currentRowStartIndex..<nextRowStartIndex]
         }
     }
 }

    precondition(x.rows == y.rows && x.columns == y.columns, "Matrix dimensions not compatible with addition")

    var results = y
    cblas_daxpy(Int32(x.grid.count), 1.0, x.grid, 1, &(results.grid), 1)

    return results
}

public func mul(alpha: Float, x: Matrix<Float>) -> Matrix<Float> {
    var results = x
    cblas_sscal(Int32(x.grid.count), alpha, &(results.grid), 1)

    return results
}

public func mul(alpha: Double, x: Matrix<Double>) -> Matrix<Double> {
    var results = x
    cblas_dscal(Int32(x.grid.count), alpha, &(results.grid), 1)

    return results
}


public func transpose(x: Matrix<Float>) -> Matrix<Float> {
    var results = Matrix<Float>(rows: x.columns, columns: x.rows, repeatedValue: 0.0)
    vDSP_mtrans(x.elements, 1, &(results.elements), 1, vDSP_Length(results.rows), vDSP_Length(results.columns))

    return results
}

public func transpose(x: Matrix<Double>) -> Matrix<Double> {
    var results = Matrix<Double>(rows: x.columns, columns: x.rows, repeatedValue: 0.0)
    vDSP_mtransD(x.elements, 1, &(results.elements), 1, vDSP_Length(results.rows), vDSP_Length(results.columns))

    return results
}
