Difference between revisions of "DPS915 Toad"
(→PI Calculation) |
(→Sample GPROF) |
||
Line 37: | Line 37: | ||
====Sample GPROF==== | ====Sample GPROF==== | ||
− | + | Flat profile: | |
− | Flat profile: | + | |
− | + | Each sample counts as 0.01 seconds. | |
− | Each sample counts as 0.01 seconds. | ||
no time accumulated | no time accumulated | ||
− | + | ||
% cumulative self self total | % cumulative self self total | ||
time seconds seconds calls Ts/call Ts/call name | time seconds seconds calls Ts/call Ts/call name | ||
0.00 0.00 0.00 1 0.00 0.00 _GLOBAL__sub_I_main | 0.00 0.00 0.00 1 0.00 0.00 _GLOBAL__sub_I_main | ||
− | |||
− | |||
=== Assignment 2 === | === Assignment 2 === | ||
=== Assignment 3 === | === Assignment 3 === |
Revision as of 14:09, 14 October 2015
Contents
Project Name Goes here
Team Members
Progress
Assignment 1
PI Calculation
Code
double xValue, yValue; for(int i = 0; i < npoints; i++) { //Generate random numbers xValue = (double) rand()/RAND_MAX; yValue = (double) rand()/RAND_MAX; if(sqrt((xValue*xValue)+(yValue*yValue)) <= 1) { circle_count++; } } double pi, ds; cout<<circle_count<<"/"<<npoints<<endl; ds = (double)circle_count/npoints; cout<<ds<<endl; pi = ((4.0)*ds); cout<<"PI = "<< pi <<endl;
"
Sample GPROF
Flat profile: Each sample counts as 0.01 seconds. no time accumulated % cumulative self self total time seconds seconds calls Ts/call Ts/call name 0.00 0.00 0.00 1 0.00 0.00 _GLOBAL__sub_I_main