//--------------------------------------------------------------------------- // Entry point // Calculate RA and Dec for noon on every day in 1900-2100 int main(int argc, char ** argv) { int i, n, p; double jd[2]; double pv[2][3]; double position[8][3]; bool ga_testing = false; // do we have verbose output? if (argc > 1) { for (i = 1; i < argc; ++i) { if (!strcmp(argv[1],"-ga")) { ga_testing = true; break; } } } // get starting time // main loop for (i = 0; i < TEST_LOOPS; ++i) { jd[0] = J2000; jd[1] = 0.0; for (n = 0; n < TEST_LENGTH; ++n) { jd[0] += 1.0; for (p = 0; p < 8; ++p) { planetpv(jd,p,pv); radecdist(pv,position[p]); } } } for (p = 0; p < 8; ++p) printf("%f %f %f\n", position[p][0], position[p][1], position[p][2]); // get final time // report runtime fflush(stdout); return 0; }
static void test(void) { int p; double jd[2]; double pv[2][3]; double position[3]; jd[0] = J2000; jd[1] = 0.0; for (p = 0; p < 8; ++p) { planetpv(jd,p,pv); radecdist(pv,position); printf("p = %d position[0] = %g position[1] = %g\n", p, position[0], position[1]); } }
static void bench(int nloops) { int i, n, p; double jd[2]; double pv[2][3]; double position[3]; for (i = 0; i < nloops; ++i) { jd[0] = J2000; jd[1] = 0.0; for (n = 0; n < TEST_LENGTH; ++n) { jd[0] += 1.0; for (p = 0; p < 8; ++p) { planetpv(jd,p,pv); radecdist(pv,position); } } } }