Accelerate Framework

Mac OSX specific forum
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3944
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Accelerate Framework

Post by wilbert »

I came across the accelerate framework today
https://developer.apple.com/library/mac ... rateFWRef/
The Accelerate Framework contains C APIs for vector and matrix math, digital signal processing, large number handling, and image processing.
It's probably not something I would use myself but maybe someone finds it useful.

The following example computes the cosine of every value inside an array and puts the result in a second array

Code: Select all

ImportC "-framework Accelerate"
  vvsin(*out, *in, *len)
  vvcos(*out, *in, *len)
EndImport

Size.i = 100000

Dim A.d(Size - 1)
Dim B.d(Size - 1)

For i = 0 To Size - 1
  B(i) = Random(9999) * 0.01
Next

vvcos(@A(), @B(), @Size)