COIN-OR::LEMON - Graph Library

Opened 17 years ago

Closed 16 years ago

#82 closed enhancement (fixed)

Doc review needed for time_measure.h and counter.h

Reported by: Alpar Juttner Owned by: Peter Kovacs
Priority: major Milestone: LEMON 1.0 release
Component: documentation Version: hg main
Keywords: Cc:
Revision id:

Description

See ticket:52 for a longish discussion on it.

Attachments (2)

counter.patch (5.1 KB) - added by Peter Kovacs 16 years ago.
counter-reset.patch (1.4 KB) - added by Peter Kovacs 16 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 17 years ago by Peter Kovacs

Status: newassigned

Changed 16 years ago by Peter Kovacs

Attachment: counter.patch added

comment:2 Changed 16 years ago by Peter Kovacs

I uploaded a patch with improved documentation for counters.

I see only one problem with the current counter-nocounter concept. The following code

Counter a("a=");
Counter::SubCounter b(a, "b=");
++a;
++b;
b.reset();

prints out

b=0
a=1

However if the SubCounter is replaced with NoSubCounter it prints out

a=2

What do you think about it? It could be fixed using an implementation like SubCounter for NoSubCounter (but without printing report), however then NoSubCounters would generate code even if they are used for a NoCounter.

comment:3 in reply to:  2 ; Changed 16 years ago by Alpar Juttner

Replying to kpeter:

What do you think about it? It could be fixed using an implementation like SubCounter for NoSubCounter (but without printing report)

I don't like this idea. What about just removing the reset() functions from the subcounters? Or even from the main counters? (I would expect that reset() also resets the sub-counters, but I can't see any reasonable implementation for that.)

Alternatively, we can leave it as is, but also write a documentation note about when will the reset() do what the user might expect.

comment:4 in reply to:  2 Changed 16 years ago by Alpar Juttner

Replying to kpeter:

I uploaded a patch with improved documentation for counters.

The patch went to the main branch, see [b1bd0c2a7f57].

comment:5 in reply to:  3 ; Changed 16 years ago by Peter Kovacs

I support removing reset() from subcounters.
For Counter we have two options:

  • Remove the reset() functuion to keep the current concpet that the subcounters can be used exactly the same way as Counter and to avoid the following confusing meaning.
  • Add a note to the doc of reset() that it does not resets the values of SubCounters but it do resets NoSubCounters.

comment:6 in reply to:  5 Changed 16 years ago by Alpar Juttner

Replying to kpeter:

I support removing reset() from subcounters.

Let's do that.

For Counter we have two options:

  • Remove the reset() functuion to keep the current concpet that the subcounters can be used exactly the same way as Counter and to avoid the following confusing meaning.
  • Add a note to the doc of reset() that it does not resets the values of SubCounters but it do resets NoSubCounters.

I prefer the latter one.

Changed 16 years ago by Peter Kovacs

Attachment: counter-reset.patch added

comment:7 Changed 16 years ago by Peter Kovacs

I attached a patch about the reset() functions. As it goes to the main branch, this ticket can be closed.

comment:8 in reply to:  7 Changed 16 years ago by Alpar Juttner

Resolution: fixed
Status: assignedclosed

Replying to kpeter:

I attached a patch about the reset() functions. As it goes to the main branch, this ticket can be closed.

It went there, see [8ceb318224b1].

Note: See TracTickets for help on using tickets.