EltableAggregate(Dom, Im)ΒΆ
aggcat.spad line 782 [edit on github]
An eltable aggregate is one which can be viewed as a function. For example, the list [1, 7, 4] can be applied to 1, 2, and 3 respectively and will return the integers 1, 7, and 4; thus this list may be viewed as mapping 1 to 1, 2 to 7 and 3 to 4. In general, an aggregate can map members of a domain Dom to an image domain Im.
- elt: (%, Dom, Im) -> Im
- elt(u, x, y)applies- uto- xif- xis in the domain of- u, and returns- yotherwise.
- qelt: (%, Dom) -> Im
- qelt(u, x)applies- uto- xwithout checking whether- xis in the domain of- u. If- xis not in the domain of- ua memory-access violation may occur. If a check on whether- xis in the domain of- uis required, use the function- elt.
- qsetelt!: (%, Dom, Im) -> Im if % has shallowlyMutable
- qsetelt!(u, x, y)sets the image of- xto be- yunder- u, without checking that- xis in the domain of- u. If such a check is required use the function- setelt!.
- setelt!: (%, Dom, Im) -> Im if % has shallowlyMutable
- setelt!(u, x, y)sets the image of- xto be- yunder- u, if- xis in the domain of- u. Error: if- xis not in the domain of- u.
Eltable(Dom, Im)