-
Notifications
You must be signed in to change notification settings - Fork 1
Invert
Maarten Hilferink edited this page Apr 8, 2026
·
7 revisions
Relational functions invert
- invert(relation)
invert(a) inverts the relation argument.
Inverting means the resulting attribute has as domain unit the values unit and as values unit the domain unit of the relation argument.
- attribute relation with value type of the group CanBeDomainUnit
O(n) where n = number of elements in the domain of relation. Single pass finding last occurrence of each value. For multiple occurrences per value, see invertAll which builds linked lists in O(n).
attribute<Region> invertRegion_rel (Region) := invert(City/Region_rel);
| City/Region_rel |
|---|
| 0 |
| 1 |
| 2 |
| 1 |
| 3 |
| null |
| 3 |
domain City, nr of rows = 7
| InvertRegion_rel |
|---|
| 1 |
| 4 |
| 3 |
| 7 |
| null |
domain Region, nr of rows = 5
GeoDMS ©Object Vision BV. Source code distributed under GNU GPL-3. Documentation distributed under CC BY-SA 4.0.