- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
strange coedge traversal
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-15-2011 01:25 PM
i have a WIRE * acis_wire and i get its coedge = acis_wire->coedge();
now if i do something like:
do {
printf("%p\n",coedge);
DO_SOMETHING_WITH_COEDGE;
coedge = coedge->next();
if(!coedge || coedge == acis_wire->coedge) break;
} while(1)
i notice that for one particular SAT file i get different pointers for a while and then i get a situation where it then begins to bounce between two different coedge pointers. is this some special type of WIRE or coedge that i can detect to avoid an infinite loop?
Re: strange coedge traversal
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-15-2011 01:34 PM
Hi Sawarsi
There are two issues here. For wires traversing coedges is different then traversing coedges in a loop. I think sometimes wires are terminated by the condition coedge == coedge->next(); adding this as a termination condition in your loop might fix the issue.
Rather than getting into low level details of traversing coedges, you might also consider using api_get_coedges which should correctly find all the coedges in any wire.
If neither of these works there could be problems with the model. One thing you could do is have a loop counter and throw and error if it gets ridiculously high (e.g., 10k coedges in one loop). This is better than hanging and has very little overhead. Another approach that could work is to keep an ENTITY_LIST of coedges you have already seen and change the second termination criterion from coedge == acis_wire->coedge to coedges_already_seen.lookup(coedge) != -1.
hope this helps.
Eric
Re: strange coedge traversal
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-15-2011 02:12 PM
than Eric, the api_get_coedges did the trick.

