IndexedAggregate(Index, Entry)
aggcat.spad line 826
[edit on github]
An indexed aggregate is a many-to-one mapping of indices to entries. For example, a one-dimensional-array is an indexed aggregate where the index is an integer. Also, a table is an indexed aggregate where the indices and entries may have any type.
- # : % -> NonNegativeInteger if % has finiteAggregate
- from Aggregate
- = : (%, %) -> Boolean if Entry has BasicType and % has finiteAggregate or Entry has SetCategory
- from BasicType
- any? : (Mapping(Boolean, Entry), %) -> Boolean if % has finiteAggregate
- from HomogeneousAggregate(Entry)
- coerce : % -> OutputForm if Entry has CoercibleTo(OutputForm)
- from CoercibleTo(OutputForm)
- copy : % -> %
- from Aggregate
- count : (Entry, %) -> NonNegativeInteger if Entry has BasicType and % has finiteAggregate
- from HomogeneousAggregate(Entry)
- count : (Mapping(Boolean, Entry), %) -> NonNegativeInteger if % has finiteAggregate
- from HomogeneousAggregate(Entry)
- elt : (%, Index) -> Entry
- from Eltable(Index, Entry)
- elt : (%, Index, Entry) -> Entry
- from EltableAggregate(Index, Entry)
- empty : () -> %
- from Aggregate
- empty? : % -> Boolean
- from Aggregate
- entries : % -> List(Entry)
entries(u)
returns a list of all the entries of aggregate u
in no assumed order.
- entry? : (Entry, %) -> Boolean if Entry has BasicType and % has finiteAggregate
entry?(x, u)
tests if x
equals u . i
for some index i
.
- eq? : (%, %) -> Boolean
- from Aggregate
- eval : (%, Entry, Entry) -> % if Entry has SetCategory and Entry has Evalable(Entry)
- from InnerEvalable(Entry, Entry)
- eval : (%, Equation(Entry)) -> % if Entry has SetCategory and Entry has Evalable(Entry)
- from Evalable(Entry)
- eval : (%, List(Entry), List(Entry)) -> % if Entry has SetCategory and Entry has Evalable(Entry)
- from InnerEvalable(Entry, Entry)
- eval : (%, List(Equation(Entry))) -> % if Entry has SetCategory and Entry has Evalable(Entry)
- from Evalable(Entry)
- every? : (Mapping(Boolean, Entry), %) -> Boolean if % has finiteAggregate
- from HomogeneousAggregate(Entry)
- fill! : (%, Entry) -> % if % has shallowlyMutable
fill!(u, x)
replaces each entry in aggregate u
by x
. The modified u
is returned as value.
- first : % -> Entry if Index has OrderedSet
first(u)
returns the first element x
of u
. Note: for collections, first([x, y, ..., z]) = x
. Error: if u
is empty.
- index? : (Index, %) -> Boolean
index?(i, u)
tests if i
is an index of aggregate u
.
- indices : % -> List(Index)
indices(u)
returns a list of indices of aggregate u
in no particular order.
- latex : % -> String if Entry has SetCategory
- from SetCategory
- less? : (%, NonNegativeInteger) -> Boolean
- from Aggregate
- map : (Mapping(Entry, Entry), %) -> %
- from HomogeneousAggregate(Entry)
- map! : (Mapping(Entry, Entry), %) -> % if % has shallowlyMutable
- from HomogeneousAggregate(Entry)
- max : % -> Entry if Entry has OrderedSet and % has finiteAggregate
- from HomogeneousAggregate(Entry)
- max : (Mapping(Boolean, Entry, Entry), %) -> Entry if % has finiteAggregate
- from HomogeneousAggregate(Entry)
- maxIndex : % -> Index if Index has OrderedSet
maxIndex(u)
returns the maximum index i
of aggregate u
. Note: in general, maxIndex(u) = reduce(max, indices u)
; for List, maxIndex(u) = #u
.
- member? : (Entry, %) -> Boolean if Entry has BasicType and % has finiteAggregate
- from HomogeneousAggregate(Entry)
- members : % -> List(Entry) if % has finiteAggregate
- from HomogeneousAggregate(Entry)
- min : % -> Entry if Entry has OrderedSet and % has finiteAggregate
- from HomogeneousAggregate(Entry)
- minIndex : % -> Index if Index has OrderedSet
minIndex(u)
returns the minimum index i
of aggregate u
. Note: in general, minIndex(a) = reduce(min, indices a)
; for List, minIndex(a) = 1
.
- more? : (%, NonNegativeInteger) -> Boolean
- from Aggregate
- parts : % -> List(Entry) if % has finiteAggregate
- from HomogeneousAggregate(Entry)
- qelt : (%, Index) -> Entry
- from EltableAggregate(Index, Entry)
- qsetelt! : (%, Index, Entry) -> Entry if % has shallowlyMutable
- from EltableAggregate(Index, Entry)
- sample : () -> %
- from Aggregate
- setelt! : (%, Index, Entry) -> Entry if % has shallowlyMutable
- from EltableAggregate(Index, Entry)
- size? : (%, NonNegativeInteger) -> Boolean
- from Aggregate
- swap! : (%, Index, Index) -> Void if % has shallowlyMutable
swap!(u, i, j)
interchanges elements i
and j
of aggregate u
. No meaningful value is returned.
- ~= : (%, %) -> Boolean if Entry has BasicType and % has finiteAggregate or Entry has SetCategory
- from BasicType
EltableAggregate(Index, Entry)
Evalable(Entry)
Eltable(Index, Entry)
BasicType
InnerEvalable(Entry, Entry)
SetCategory
CoercibleTo(OutputForm)
Aggregate
HomogeneousAggregate(Entry)