nitc :: LinexComparator :: _tree
nitc :: LinexComparator :: computeminmax
nitc :: LinexComparator :: defaultinit
nitc :: LinexComparator :: tree
nitc :: LinexComparator :: tree=
nitc $ LinexComparator :: SELF
Type of this instance, automatically specialized in every classnitc :: LinexComparator :: _tree
core :: Comparator :: bubble_sort
Bubble-sortarray
between from
and to
indices
core :: Comparator :: build_heap
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: LinexComparator :: computeminmax
nitc :: LinexComparator :: defaultinit
core :: Comparator :: defaultinit
core :: Object :: defaultinit
core :: Comparator :: insertion_sort
Insertion-sortarray
between from
and to
indices
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Comparator :: merge_sort
Merge-sortarray
between from
and to
indices
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).core :: Comparator :: quick_sort
Quick-sortarray
between from
and to
indices
nitc :: LinexComparator :: tree
nitc :: LinexComparator :: tree=
# Compare modules and groups using the
private class LinexComparator
super Comparator
redef type COMPARED: MConcern
var mins = new HashMap [MGroup, nullable MModule]
var maxs = new HashMap [MGroup, nullable MModule]
fun mini(o: Object): nullable MModule do
if o isa MModule then return o
assert o isa MGroup
if not mins.has_key(o) then computeminmax(o)
return mins[o]
end
fun maxi(o: Object): nullable MModule do
if o isa MModule then return o
assert o isa MGroup
if not maxs.has_key(o) then computeminmax(o)
return maxs[o]
end
fun computeminmax(o: MGroup) do
if not tree.sub.has_key(o) then
mins[o] = null
maxs[o] = null
return
end
var subs = tree.sub[o]
var minres = mini(subs.first)
var maxres = maxi(subs.first)
var order = o.model.mmodule_importation_hierarchy
for o2 in subs do
var c = mini(o2)
if c == null then continue
if minres == null or order.compare(minres, c) > 0 then minres = c
c = maxi(o2)
if c == null then continue
if maxres == null or order.compare(maxres, c) < 0 then maxres = c
end
mins[o] = minres
maxs[o] = maxres
#if minres != maxres then print "* {o} {minres}..{maxres}"
end
redef fun compare(a,b) do
var ma = mini(a)
var mb = mini(b)
if ma == null then
if mb == null then return 0 else return -1
else if mb == null then
return 1
end
var order = ma.model.mmodule_importation_hierarchy
return order.compare(ma, mb)
end
var tree: OrderedTree[MConcern]
end
src/model/model_viz.nit:59,1--113,3