Open main menu

CDOT Wiki β

Changes

Algo holics

1,150 bytes added, 03:15, 22 February 2019
Assignment 1
<h5>Compiling the program</h5>
Enter the following commands:
 
g++ -std=c++0x -pg solver.cpp checks.cpp checksolution.cpp -o a
a fileName
<h5>Analysis</h5>
To analyze the flat profile, enter the following command:
gprof -p -b myapp a> myappa.flt
-p directs the profiler (gprof) to output a flat profile.
To analyze the call graph, enter the following command:
gprof -q -b myapp a> myappa.clg
-q directs the profiler (gprof) to output a call graph.
-b directs the profiler to omit detailed explanations of the column headings from the output.
 
 
 
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 4539 0.00 0.00 checkRow(int, int)
0.00 0.00 0.00 1620 0.00 0.00 checkColumn(int, int)
0.00 0.00 0.00 1120 0.00 0.00 placeNum(int, int)
0.00 0.00 0.00 698 0.00 0.00 checkSquare(int, int, int)
0.00 0.00 0.00 476 0.00 0.00 goBack(int&, int&)
0.00 0.00 0.00 2 0.00 0.00 print(int (*) [9])
0.00 0.00 0.00 1 0.00 0.00 _GLOBAL__sub_I_sudoku
0.00 0.00 0.00 1 0.00 0.00 _GLOBAL__sub_I_temp
0.00 0.00 0.00 1 0.00 0.00 solveSudoku()
0.00 0.00 0.00 1 0.00 0.00 storePositions()
0.00 0.00 0.00 1 0.00 0.00 __static_initialization_and_destruction_0(int, int)
0.00 0.00 0.00 1 0.00 0.00 __static_initialization_and_destruction_0(int, int)
85
edits