Finishing the app & preview
Finishing up the work
In the last post, we've seen the frontend of our Interpolation visualizer iPhone app.
In order to make the app functional, we'll now write the backend portion of the app: the code that will perform computations of the interpolation functions.
We'll also show how we can call the Neural Engine in modern iPhone to help accelerate this process.
The code block(s)
1. CoreGraphics libraries
2. Accelerated Vector Computation libraries
3. SIMD (Single Instruction Multiple Data) libraries.
In which the focus point is the Accelerate.vecLib libraries, this is the libraries that allow the Neural Engine in the iPhone to help assist in interpolation computation.
And, SIMD libraries allows for parallelization of the computation processes, further improving the application performance.
We can also sees that the backend also initialize the interpolated graph Axes and what algorithm to use, in this case, a Linear and Quadratic interpolation is chosen.
In the second block, the backend first check which data portion will be use in the interpolation computation, in which the program first will check if it's a horizontal component or vertical component, how far is the point from each other.
The third block is where the main computation begins, this section perform interpolation operations, depending on what toggle setting the UI is switched too.
The code will perform the operations in the increment of 2 points step, until all the data points are accounted for.
The final section of the code then return the computed equations, the graphing plot back to the frontend in the format of X and Y coordinates.
ความคิดเห็น
แสดงความคิดเห็น