iMariner 2.1 will use the vDSP & vecLib libraries
Page 1 of 1
iMariner 2.1 will use the vDSP & vecLib libraries
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
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
Similar topics
» iMariner doc en français
» iMariner 1.1 : IAU skymaps
» iMariner 1.2 released in appStore
» NEW APP : Solar Compass 1.0 by iMariner
» iMariner Astronomical References
» iMariner 1.1 : IAU skymaps
» iMariner 1.2 released in appStore
» NEW APP : Solar Compass 1.0 by iMariner
» iMariner Astronomical References
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum