iMariner 2.1 will use the vDSP & vecLib libraries

Go down

iMariner 2.1 will use the vDSP & vecLib libraries

Post  Admin on Sat Mar 31, 2012 1:17 am

These functions are optimized for the new multi-core iDevices (iPhone 4S, iPad 3).
Here is the main function doing VSOP87D calculations, with the previous algorithm and the new one :

static double Serie(struct terms *terms, int count, double t) {
#if 1
// vecLib and vDSP librairies
double calc[2000];
double res = 0;

vDSP_vsmulD (terms->C, 1, &t, calc, 1, count);
vDSP_vaddD (calc, 1, terms->B, 1, calc, 1, count);
vvcos (calc, calc, &count);
vDSP_vmulD (calc, 1, terms->A, 1, calc, 1, count);
vDSP_sveD (calc, 1, &res, count);
return res;
// classical computation using libmath
double res = 0;
for (int i=0; i<count; i++)
res += terms->A[i] * cos(terms->B[i]+terms->C[i]*t);
return res;


Posts : 41
Join date : 2011-05-11

View user profile

Back to top Go down

Back to top

Permissions in this forum:
You cannot reply to topics in this forum