SectionList more methods?

The basics of how to develop, test, and use models.
Post Reply
eacheon
Posts: 97
Joined: Wed Jan 18, 2006 2:20 pm

SectionList more methods?

Post by eacheon »

Hi, I am wondering are more methods planned to be added into SectionList?
Say, supporting intersect operation of 2 sectionLists etc...

Right now I find myself always doing something like:

Code: Select all

objref intersec_seclist
intersec_seclist = new SectionList()
forsec seclist1 {
    ifsec seclist2 intersec_seclist.append()
}
          
     
hines
Site Admin
Posts: 1711
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

Nothing new for SectionList is planned. Things get added in response to an experienced need. In the CellBuild class there is an intersection of subsets but that is in terms of its internal representation and not the eventual instantiation as a SectionList. One thing I'd mention is that the quadratic nature of the algorithm you exhibit can be reduced to linear complexity by putting a sentinel value into some range variable on the sweep over seclist1 and then checking the value when you sweep over seclist2. (initialize the range variable first with a sweep over the seclist2). I often use rallbranch for this purpose as its substantive use is extremely rare. And if that seems too unsafe, I'll save and restore them using Vectors.

So this can all be done in a reusable obfunc that returns a new SectionList. How many items are there in your "etc..." list?
Post Reply