COIN-OR::LEMON - Graph Library

Opened 15 years ago

Closed 15 years ago

#304 closed enhancement (fixed)

Doc improvements in Bfs, Dfs, Dijkstra

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

Description


Attachments (3)

304-1-a4d00df8852e.patch (4.4 KB) - added by Peter Kovacs 15 years ago.
Bug fixes in the function type interfaces
304-2-f85e505e7eba.patch (40.2 KB) - added by Peter Kovacs 15 years ago.
Doc improvements (only for the main branch)
304-new-doc-impr-f47b6c94577e.patch (40.9 KB) - added by Peter Kovacs 15 years ago.
Doc improvements (without modifying the interface)

Download all attachments as: .zip

Change History (12)

Changed 15 years ago by Peter Kovacs

Attachment: 304-1-a4d00df8852e.patch added

Bug fixes in the function type interfaces

Changed 15 years ago by Peter Kovacs

Attachment: 304-2-f85e505e7eba.patch added

Doc improvements (only for the main branch)

comment:1 Changed 15 years ago by Peter Kovacs

Status: newassigned

[a4d00df8852e] contains fixes for the function type interfaces. These bugs are not so critical, but the patch may worth to be merged into the release branch 1.1.

[f85e505e7eba] contains doc improvements (on the top of the former patch) inspired by the doc of the ported BellmanFord class (see #51).

comment:2 in reply to:  1 ; Changed 15 years ago by Alpar Juttner

Replying to kpeter:

[a4d00df8852e] contains fixes for the function type interfaces. These bugs are not so critical, but the patch may worth to be merged into the release branch 1.1.

I don't understand what kind of bugs are fixed by this chgset.

comment:3 in reply to:  2 ; Changed 15 years ago by Peter Kovacs

Replying to alpar:

Replying to kpeter:

[a4d00df8852e] contains fixes for the function type interfaces. These bugs are not so critical, but the patch may worth to be merged into the release branch 1.1.

I don't understand what kind of bugs are fixed by this chgset.

I don't know if these mistakes should be called bugs or not, that's why I did not use this word in the commit log.

For the function type interfaces of Bfs, Dfs, Dijkstra and BellmanFord there are several named parameters for setting attributes (with const T& parameters) and there are two named parameter functions for getting results, namely path() and dist(). They also had const T& parameter and const cast was made for them. So the doc of these functions were misleading, moreover a code like that can be compiled:

dijkstra(g,length).path(Path()).run(s,t);

These mistakes (that were actually made by me) were fixed in the changeset. As you can see, the test files should also be modified. The original versions should not be compilable.

comment:4 in reply to:  3 Changed 15 years ago by Peter Kovacs

Replying to kpeter:

Replying to alpar:

Replying to kpeter:

[a4d00df8852e] contains fixes for the function type interfaces. These bugs are not so critical, but the patch may worth to be merged into the release branch 1.1.

I don't understand what kind of bugs are fixed by this chgset.

I don't know if these mistakes should be called bugs or not, that's why I did not use this word in the commit log.

Now I don't think these "mistakes" were mistakes at all.

Currently all the named parameters (predMap(), distMap(), processedMap(), reachedMap(), path(), dist()) have const T& parameters, thus temporary objects can be passed to them (as I wrote in the above comment). In some cases it could be useful for named parameters that work with maps. E.g.

   std::vector<Node> v(countNodes(g));
   dfs(g).processedMap(loggerBoolMap(v.begin())).run(s);

So const T& parameters should be kept for maps. For path() and dist() I don't know such a use case, but it could be imagined. Therefore I reject my own patch (however the doc can be misleading in its current version).

Changed 15 years ago by Peter Kovacs

Doc improvements (without modifying the interface)

comment:5 Changed 15 years ago by Peter Kovacs

I suggest applying [f47b6c94577e] instead of the two former patches: it contains doc improvements, but does not modify the const parameters.

comment:6 Changed 15 years ago by Peter Kovacs

Type: defectenhancement

comment:7 Changed 15 years ago by Peter Kovacs

Summary: Fixes and improvements in Bfs, Dfs, DijkstraDoc improvements in Bfs, Dfs, Dijkstra

comment:8 Changed 15 years ago by Peter Kovacs

Component: coredocumentation
Version: release branch 1.1hg main

comment:9 in reply to:  5 Changed 15 years ago by Alpar Juttner

Resolution: fixed
Status: assignedclosed

Replying to kpeter:

I suggest applying [f47b6c94577e] ...

Done.

Note: See TracTickets for help on using tickets.