[Double]) -> [Double] { var inMatrix = A, solution = B var N = __CLPK_integer( sqrt( Double( A.count ) ) ) var N2 = N, N3 = N, LDA = N, LDB = N var NRHS: __CLPK_integer = 1 var pivots = [__CLPK_integer](repeating: 0, count: Int(N)) var error: __CLPK_integer = 0 dgetrf_(&N, &N2, &inMatrix, &N3, &pivots, &error) var t = "T".cString(using: .utf8)!.first! dgetrs_(&t, &N, &NRHS, &inMatrix, &LDA, &pivots, &solution, &LDB, &error) return solution }