예제 #1
0
파일: Node.cpp 프로젝트: JiehuaChen/BART
void Node::GetSwapsList(List **list)
{
	if(Nog || Bot) {
		*list=new List;
		(**list).length=0;
	} else if((LeftC->Bot || LeftC->Nog) && (RightC->Bot || RightC->Nog)) {
		*list=new List;
		(*list)->length=0;
		AddCellToEnd(*list,(void *)this);
	} else {

		List *llist,*rlist;
		LeftC->GetSwapsList(&llist);
		RightC->GetSwapsList(&rlist);
		CombineLists(llist,rlist,list);
		AddCellToEnd(*list,(void *)this);
	}
}
예제 #2
0
파일: Node.cpp 프로젝트: JiehuaChen/BART
void Node::GetNotBotList(List **list)
// gets list of pointers to nog nodes
{

	if(Bot) {
		*list=new List;
		(**list).length=0;
	} else if(Nog) {
			
		*list=new List;
		(*list)->length=0;
		AddCellToEnd(*list,(void *)this);

	} else {
		List *llist,*rlist;
		LeftC->GetNotBotList(&llist);
		RightC->GetNotBotList(&rlist);
		CombineLists(llist,rlist,list);
		AddCellToEnd(*list,(void *)this);

	}
	
}
예제 #3
0
파일: List.cpp 프로젝트: cran/BayesTree
void AddCellAfter(List *list,Cell *oldcell,void *p)
{
	if(oldcell->End) {
		AddCellToEnd(list,p);
	} else {
		Cell *cell;
		cell = new Cell;

		cell->contents = p;
		cell->Beg=0;
		cell->End=0;
		cell->before = oldcell;
		cell->after = oldcell->after;

		oldcell->after = cell;
		(cell->after)->before = cell;

		list->length +=1;
	}
}