>
> Dear Sir,
>
>                   Thank you for replying but aprof i guess is like a
> profiler, what i am looking for is a code or tool that takes any c or c++
> program and on execution gives me the output in terms of asymptotic
> notation.
>
> For example : test.c
>                   for (i = 0; i < N; i++) {
>                               sequence of statements
>                                }
>
> output:  O(N)
>
>
> Regards,
> Zinat Shaikh
>

Hi Zinat,

Thank you for replying but aprof i guess is like a profiler, what i am
> looking for is a code or tool that takes any c or c++ program and on
> execution gives me the output in terms of asymptotic notation.
>

I am not aware of any tool capable of doing this *BUT* aprof does in "some
way" exactly this: for each function/routine of your code, it gives you:

- input sizes: e.g.,  x1=5 , x2=15, x3=20, x4=100, xN=1000, ...
- running times (of the routine) on these input sizes: e.g., y1=10, y2=30,
y3=40, x4=200, yN=2000

Then, you can plot each point (x_i, y_i) and analyze the trend. The trend
will give you an hint on the asymptotic cost of you function, e.g. O(n)

There are several ways for analyzing the trend:

- if you use aprof-plot (a Java GUI which we developed for analyzing
aprof's reports), you can apply the "guess ratio rule". *See our tutorial
for more info* <https://code.google.com/p/aprof/wiki/Tutorial1>.

- You can easily export from aprof-plot the points related to a specific
routine and perform curve fitting (e.g., using gnuplot, matlab, python
scipy, etc). For instance, you can test for a function like a + b*x^c and
the curve fitting library wiil give you the parameters a, b and c.

aprof provides only an hint because it is a dynamic analysis tool and it
can only analyze the actual behaviour during your experiment. If you want a
more "general" and "sound" answer, you can't use any dynamic analysis tool.
Maybe, a static analysis tool can do better, but for this goal it is very
hard/expensive (you need to analyze all possible execution paths inside
your code and for each one analyze all possible inputs).

Emilio
------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to