This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func invert(matrix : [Double]) -> [Double] { | |
var inMatrix = matrix | |
var N = __CLPK_integer(sqrt(Double(matrix.count))) | |
var pivots = Array(repeating: 0 as __CLPK_integer, count: Int(N)) | |
var workspace = Array(repeating: 0.0 as Double, count: Int(N)) | |
var error : __CLPK_integer = 0 | |
dgetrf_(&N, &N, &inMatrix, &N, &pivots, &error) | |
dgetri_(&N, &inMatrix, &N, &pivots, &workspace, &N, &error) | |
return inMatrix | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func printAllSubviews(of view: UIView, from layer: Int) { | |
for _ in 0..<layer { | |
print(" ", separator: "", terminator: "") | |
} | |
print("\(view): ") | |
let subView = view.subviews | |
if subView.count != 0 { | |
subView.forEach({ (view) in | |
printAllSubviews(of: view, from: layer + 1) | |
}) |