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)appliesutoxifxis in the domain ofu, and returnsyotherwise.
- qelt: (%, Dom) -> Im
qelt(u, x)appliesutoxwithout checking whetherxis in the domain ofu. Ifxis not in the domain ofua memory-access violation may occur. If a check on whetherxis in the domain ofuis required, use the functionelt.
- qsetelt!: (%, Dom, Im) -> Im if % has shallowlyMutable
qsetelt!(u, x, y)sets the image ofxto beyunderu, without checking thatxis in the domain ofu. If such a check is required use the functionsetelt!.
- setelt!: (%, Dom, Im) -> Im if % has shallowlyMutable
setelt!(u, x, y)sets the image ofxto beyunderu, ifxis in the domain ofu. Error: ifxis not in the domain ofu.
Eltable(Dom, Im)