Opened 16 years ago
Closed 16 years ago
#190 closed task (fixed)
Standard maps should be reference maps
Reported by: | Peter Kovacs | Owned by: | Peter Kovacs |
---|---|---|---|
Priority: | critical | Milestone: | LEMON 1.1 release |
Component: | core | Version: | hg main |
Keywords: | Cc: | ||
Revision id: |
Description (last modified by )
Should we state in the graph structure concepts that node and arc/edge maps must be reference maps for all graph types?
It would make writing a general algorithm easier and more convenient since we would have to use set()
functions instead of operator[]
only for the "external" map types, and all the "internal" maps, which are created by the algorithm could be used as reference maps.
Maybe it could also improve the efficiency in some cases, but it is not clear and wasn't tested.
Attachments (6)
Change History (19)
comment:1 follow-up: 3 Changed 16 years ago by
Description: | modified (diff) |
---|---|
Priority: | major → critical |
comment:2 Changed 16 years ago by
Type: | enhancement → task |
---|
comment:3 follow-up: 6 Changed 16 years ago by
Replying to kpeter:
I checked the graph adaptors and they all conform to this concept, so I see no reason for not adding this restriction to the graph concepts.
What do you think?
I support this change.
comment:4 Changed 16 years ago by
Owner: | changed from Alpar Juttner to Peter Kovacs |
---|
comment:5 Changed 16 years ago by
Status: | new → assigned |
---|
Changed 16 years ago by
Attachment: | ref-maps1-add8195ad331.patch added |
---|
Various improvements and fixes (mainly in the doc)
comment:7 follow-up: 8 Changed 16 years ago by
I attached three pathces:
- [add8195ad331] Various improvements and fixes (mainly in the doc)
- [63e0373c4caa] Perform changes so that the standard maps are required to be reference maps
- [43e06cc62cca] Exploit changes in many algorithms
comment:8 follow-up: 9 Changed 16 years ago by
Replying to kpeter:
I attached three pathces:
- [add8195ad331] Various improvements and fixes (mainly in the doc)
- [63e0373c4caa] Perform changes so that the standard maps are required to be reference maps
- [43e06cc62cca] Exploit changes in many algorithms
Some of the changes results in a warning.
g++ -DHAVE_CONFIG_H -I. -I. -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2 -MT test/graph_utils_test.o -MD -MP -MF $depbase.Tpo -c -o test/graph_utils_test.o test/graph_utils_test.cc &&\ mv -f $depbase.Tpo $depbase.Po ./lemon/bits/graph_extender.h: In member function 'void lemon::concepts::IterableDigraphComponent<BAS>::Constraints<_Digraph>::constraints() [with _Digraph = lemon::GridGraph, BAS = lemon::concepts::BaseGraphComponent]': ./lemon/bits/graph_extender.h:576: warning: 'iait.lemon::GraphExtender<lemon::GridGraphBase>::InArcIt::<anonymous>.lemon::GridGraphBase::Arc::_id' is used uninitialized in this function ./lemon/concepts/graph_components.h:750: note: 'iait.lemon::GraphExtender<lemon::GridGraphBase>::InArcIt::<anonymous>.lemon::GridGraphBase::Arc::_id' was declared here ./lemon/bits/graph_extender.h:562: warning: 'oait.lemon::GraphExtender<lemon::GridGraphBase>::OutArcIt::<anonymous>.lemon::GridGraphBase::Arc::_id' is used uninitialized in this function ./lemon/concepts/graph_components.h:751: note: 'oait.lemon::GraphExtender<lemon::GridGraphBase>::OutArcIt::<anonymous>.lemon::GridGraphBase::Arc::_id' was declared here
comment:9 follow-up: 10 Changed 16 years ago by
Replying to alpar:
Some of the changes results in a warning.
I did not get these warnings, but I think I've found the reason for them. The attached bundle file contains three changesets ([48158db1b640], [77a77781b04b], [bf918e729ee7]), which are the same as the former ones except for the fixes for these warnings. Could you please check them?
Changed 16 years ago by
Attachment: | ref-maps-48158db1b640-77a77781b04b-bf918e729ee7.2.bundle added |
---|
Fixed changesets
comment:10 Changed 16 years ago by
Replying to kpeter:
Replying to alpar:
Some of the changes results in a warning.
I did not get these warnings, but I think I've found the reason for them. The attached bundle file contains three changesets ([48158db1b640], [77a77781b04b], [bf918e729ee7]), which are the same as the former ones except for the fixes for these warnings. Could you please check them?
I still get warnings with gcc 4.3.2 in euler_test.cc
./lemon/adaptors.h: In member function 'void lemon::concepts::GraphIncIt<GR, Item, Base, sel>::Constraints<_GraphIncIt>::constraints() [with _GraphIncIt = lemon::GraphAdaptorExtender<lemon::UndirectorBase<const lemon::ListDigraph> >::InArcIt, GR = lemon::Undirector<const lemon::ListDigraph>, Item = lemon::UndirectorBase<const lemon::ListDigraph>::Arc, Base = lemon::ListDigraphBase::Node, char sel = 'i']': ./lemon/adaptors.h:1919: warning: 'it1.lemon::GraphAdaptorExtender<lemon::UndirectorBase<const lemon::ListDigraph> >::InArcIt::<anonymous>.lemon::UndirectorBase<const lemon::ListDigraph>::Arc::_forward' is used uninitialized in this function ./lemon/concepts/graph_components.h:572: note: 'it1.lemon::GraphAdaptorExtender<lemon::UndirectorBase<const lemon::ListDigraph> >::InArcIt::<anonymous>.lemon::UndirectorBase<const lemon::ListDigraph>::Arc::_forward' was declared here ./lemon/adaptors.h:1920: warning: 'it1.lemon::GraphAdaptorExtender<lemon::UndirectorBase<const lemon::ListDigraph> >::InArcIt::_adaptor' may be used uninitialized in this function ./lemon/concepts/graph_components.h:572: note: 'it1.lemon::GraphAdaptorExtender<lemon::UndirectorBase<const lemon::ListDigraph> >::InArcIt::_adaptor' was declared here ./lemon/list_graph.h:103: warning: 'it1.lemon::GraphAdaptorExtender<lemon::UndirectorBase<const lemon::ListDigraph> >::InArcIt::<anonymous>.lemon::UndirectorBase<const lemon::ListDigraph>::Arc::<anonymous>.lemon::ListDigraphBase::Arc::id' may be used uninitialized in this function ./lemon/concepts/graph_components.h:572: note: 'it1.lemon::GraphAdaptorExtender<lemon::UndirectorBase<const lemon::ListDigraph> >::InArcIt::<anonymous>.lemon::UndirectorBase<const lemon::ListDigraph>::Arc::<anonymous>.lemon::ListDigraphBase::Arc::id' was declared here
Changed 16 years ago by
Attachment: | ref-maps-d11bf7998905-2313edd0db0b-aa1804409f29.bundle added |
---|
comment:11 Changed 16 years ago by
I attached another bundle. I don't get warnings with gcc 4.1, 4.2, 4.3.
Changed 16 years ago by
Attachment: | ref-maps-d11bf7998905--7a28e215f715.bundle added |
---|
comment:12 follow-up: 13 Changed 16 years ago by
I've created another changeset [7a28e215f715] that removes notes from the doc of the graph structures mentioning reference maps as an extra feature.
The newest bundle file contains all these 4 changesets: [d11bf7998905], [2313edd0db0b], [aa1804409f29], [7a28e215f715].
comment:13 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Replying to kpeter:
I've created another changeset [7a28e215f715] that removes notes from the doc of the graph structures mentioning reference maps as an extra feature.
The newest bundle file contains all these 4 changesets: [d11bf7998905], [2313edd0db0b], [aa1804409f29], [7a28e215f715].
All of them are in the main branch now.
I checked the graph adaptors and they all conform to this concept, so I see no reason for not adding this restriction to the graph concepts.
What do you think?
If we accept this idea, the following modifications should be made:
set()
and modify them to use the reference map syntax if it is simplier or possibly more efficient (e.g.map[i]++
instead ofmap.set(i, map[i] + 1)
).