Opened 17 years ago
Last modified 15 years ago
#73 assigned task
Port the remaining miscellaneous tools
Reported by: | Alpar Juttner | Owned by: | Alpar Juttner |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | core | Version: | |
Keywords: | Cc: | ||
Revision id: |
Description (last modified by )
The following files should be considered.
- lemon/dist_log.h
- lemon/refptr.h
lemon/iterable_maps.h- lemon/bits/debug_map.h
- lemon/matrix_maps.h
- lemon/polynomial.h
- lemon/concepts/matrix_maps.h
- lemon/map_iterator.h
Attachments (2)
Change History (17)
comment:1 Changed 17 years ago by
Type: | defect → task |
---|
comment:2 Changed 17 years ago by
Milestone: | LEMON 1.0 release → Post 1.0 |
---|
comment:3 Changed 17 years ago by
comment:4 Changed 16 years ago by
Status: | new → assigned |
---|
comment:5 Changed 16 years ago by
Description: | modified (diff) |
---|
comment:6 Changed 16 years ago by
Milestone: | LEMON 1.1 release |
---|
comment:7 follow-up: 8 Changed 15 years ago by
The patch [7bda7860e0a8] contains the port of the iterable maps and new unit tests for them.
comment:8 follow-up: 10 Changed 15 years ago by
Replying to deba:
The patch [7bda7860e0a8] contains the port of the iterable maps and new unit tests for them.
According to the doc IterableIntMap
can store any integer value, but can only iterate through the keys belonging to the non-negative ones. It is true? That's the rational behind it?
Changed 15 years ago by
Attachment: | 73-iterable-71939d63ae77.patch added |
---|
comment:9 Changed 15 years ago by
[71939d63ae77] contains small improvements for these classes (mainly in the doc).
comment:10 follow-up: 11 Changed 15 years ago by
Replying to alpar:
According to the doc
IterableIntMap
can store any integer value, but can only iterate through the keys belonging to the non-negative ones. It is true? That's the rational behind it?
Yes, it is true. Probably the ease of implementation motivated this design. The items are laced in linked lists corresponding to the values. The "head pointers" of the lists are stored in a vector that is indexed by the value itself.
The structure could be modified to support iteration for all values by e.g. adding a separate vector for storing the first item of the lists for negative values.
comment:11 follow-up: 12 Changed 15 years ago by
Replying to kpeter:
Replying to alpar:
According to the doc
IterableIntMap
can store any integer value, but can only iterate through the keys belonging to the non-negative ones. It is true? That's the rational behind it?Yes, it is true. Probably the ease of implementation motivated this design. The items are laced in linked lists corresponding to the values. The "head pointers" of the lists are stored in a vector that is indexed by the value itself.
The structure could be modified to support iteration for all values by e.g. adding a separate vector for storing the first item of the lists for negative values.
I think the main reason is the simple implementation and efficiency, but it has one more reason. In my opinion, this class is intended to be used where each value is small non-negative integer. For example, when the map values are component identifiers, and the identifiers come from range [0..n-1]. Perhaps there are applications, where we want to store small negative values as well, but I think they are not so frequent.
comment:12 follow-up: 13 Changed 15 years ago by
Replying to deba:
Replying to kpeter:
Replying to alpar:
According to the doc
IterableIntMap
can store any integer value, but can only iterate through the keys belonging to the non-negative ones. It is true? That's the rational behind it?Yes, it is true. Probably the ease of implementation motivated this design. The items are laced in linked lists corresponding to the values. The "head pointers" of the lists are stored in a vector that is indexed by the value itself.
The structure could be modified to support iteration for all values by e.g. adding a separate vector for storing the first item of the lists for negative values.
I think the main reason is the simple implementation and efficiency, but it has one more reason. In my opinion, this class is intended to be used where each value is small non-negative integer. For example, when the map values are component identifiers, and the identifiers come from range [0..n-1]. Perhaps there are applications, where we want to store small negative values as well, but I think they are not so frequent.
Then why don't we say that this map stores non-negative integers? Is there any use-case for also storing negative values but never iterating over them?
comment:13 Changed 15 years ago by
Replying to alpar:
Then why don't we say that this map stores non-negative integers? Is there any use-case for also storing negative values but never iterating over them?
I have never used this strucutre, but I could imagine such use cases, e.g. negative values (-1) mean something invalid/irrelevant. Then iterating on the keys with "invalid" values is probably not necessary.
comment:14 Changed 15 years ago by
Iterable maps ([7bda7860e0a8] and [7bda7860e0a8]) has been merged to the main.
comment:15 Changed 15 years ago by
Description: | modified (diff) |
---|
lemon/concept_check.h has already been ported.