On Sep 22, 2:14 am, pianoman <
pma...@gmail.com> wrote:
>
> First, how to control the precision format, i.e., decimal points, of
> "display command"? When I use "display command" to show all values of
> variables after solving my LP using CPLEX, sometimes AMPL simply
> displays some variables as zeros, which should have very small values.
> So if I can increase decimal points of display command to like 10th
> digits, I would be able to see the actual values of variables of
> interest.
To print exact values:
option display_precision 0;
>
> Second, is there a way to measure the elapsed time for some executions
> (not involved with "solve") in AMPL, like "tic-toc" in MATLAB? (I'm
> not looking for _solve_system_time, etc.) For example, if I'd like to
> know CPU time for the for-loop statements, what should I do?
The best I can come up with is to print the time at the start and end
of the loop and figure it out manually. To print the time, I think
you'll need to shell out to the operating system. So something like
the following would work on Windows:
shell "time /T"; # display start time
# for loop here
shell "time /T"; # display end time
/Paul