iMariner 2.1 will use the vDSP & vecLib libraries

View previous topic View next topic 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;
#else
// 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;
#endif

Admin
Admin

Posts : 41
Join date : 2011-05-11

View user profile http://imariner.frbb.net

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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