Package comocma :: Module hv :: Class MultiList
[hide private]
[frames] | no frames]

Class MultiList

source code

A special data structure needed by FonsecaHyperVolume.

It consists of several doubly linked lists that share common nodes. So, every node has multiple predecessors and successors, one in every list.

Nested Classes [hide private]
  Node
Instance Methods [hide private]
 
__init__(self, numberLists)
Constructor.
source code
 
__str__(self) source code
 
__len__(self)
Returns the number of lists that are included in this MultiList.
source code
 
getLength(self, i)
Returns the length of the i-th list.
source code
 
append(self, node, index)
Appends a node to the end of the list at the given index.
source code
 
extend(self, nodes, index)
Extends the list at the given index with the nodes.
source code
 
remove(self, node, index, bounds)
Removes and returns 'node' from all lists in [0, 'index'[.
source code
 
reinsert(self, node, index, bounds)
Inserts 'node' at the position it had in all lists in [0, 'index'[ before it was removed.
source code
Method Details [hide private]

__init__(self, numberLists)
(Constructor)

source code 

Constructor.

Builds 'numberLists' doubly linked lists.

reinsert(self, node, index, bounds)

source code 

Inserts 'node' at the position it had in all lists in [0, 'index'[ before it was removed. This method assumes that the next and previous nodes of the node that is reinserted are in the list.