Hello Claude, First of all, I am sorry about the absence of comments. It would be a headache for me too if I had not written the code myself, so I should have thought about adding comments earlier... I will add them and send the code again soon. The xValues form the vector x in the equation Ax = B, where A and B are matrices that are the arguments of the leastSquaresSolution function. Apple describes how the Ax = B equation can be solved with Swift in this article. xValues is indeed modified by updating xPtr. xPtr's baseAddress is passed to the DenseVector_Double that holds x: let x = DenseVector_Double( count: Int32(A.transpose().count), data: xPtr.baseAddress! ) Then, x is passed to the constant 'status', which should modify x and thereby should modify xPtr and xValues: let status = SparseSolve(SparseLSMR(), a, b, x, SparsePreconditionerDiagScaling)
Topic:
Programming Languages
SubTopic:
Swift
Tags: