X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=course%2Fsemester2%2Fpprog%2Fassignment1%2Fsingle-thread%2Fnbody.h;h=2ff81d7bfadc28375f8aa6f7c674d72d8897e98e;hb=HEAD;hp=2ce28b05de0717910a7d364b88685b2394045b72;hpb=bb7fa31ea517a1fba064e723b37d5b8d8bd7dd72;p=matches%2Fhonours.git diff --git a/course/semester2/pprog/assignment1/single-thread/nbody.h b/course/semester2/pprog/assignment1/single-thread/nbody.h index 2ce28b05..2ff81d7b 100644 --- a/course/semester2/pprog/assignment1/single-thread/nbody.h +++ b/course/semester2/pprog/assignment1/single-thread/nbody.h @@ -105,6 +105,8 @@ typedef struct int verbosity; // print statistics every number of steps indicated by this variable clock_t start_clock; // clock cycles done when simulation starts struct timeval start_time; // time at which simulation starts + float theta; // Parameter used for Barns Hut algorithm + int random; //Used to randomly create bodies } Options; void Body_Print(Body * a, FILE * out); //Print body a @@ -114,6 +116,7 @@ void Body_Velocity(Body * a); //Compute velocity of body a void Body_Position(Body * a); //Compute position of body a void System_Init(System * s, const char * fileName); //Initialise System (array of bodies) from a text file +void System_Random(System * s, int r); //Randomly create bodies void System_Compute(System * s); void System_Forces(System * s1, System * s2); //Compute forces for bodies in s1 due to bodies in s2 (also updates velocities) void System_Positions(System * s); //Update positions for bodies in s1