Changes

Jump to: navigation, search

Unique Project Page

858 bytes added, 14:28, 24 February 2017
Profiling Data and Screenshots
=== Profiling Data and Screenshots ===
 
{| class="wikitable mw-collapsible mw-collapsed"
! NBody Hot Functions
|-
|
 
<syntaxhighlight lang="cpp">
void dowork(double t){
int numtimes=int(abs(t/dt));
dt=t/double(numtimes+1);
numtimes=numtimes+1;
for (int i=0;i<numtimes;i++){
CRO_step(dt,a);
}
}
 
void CRO_step(register double mydt,void (*a)()){
long double macr_a[4] = {0.5153528374311229364, -0.085782019412973646,0.4415830236164665242, 0.1288461583653841854};
long double macr_b[4] = {0.1344961992774310892, -0.2248198030794208058, 0.7563200005156682911, 0.3340036032863214255};
for (int i=0;i<4;i++){
a();
for (int j=0;j<ncobjects;j++){
cobjects[j]->v += cobjects[j]->a * mydt*macr_b[i];
cobjects[j]->pos += cobjects[j]->v * mydt*macr_a[i];
}
} //We should really expand the loop for efficiency
}</syntaxhighlight>
 
|}
{| class="wikitable mw-collapsible mw-collapsed"
49
edits

Navigation menu