#include <stdlib.h>
#include "udanax.h"
Include dependency graph for genf.cxx:

Go to the source code of this file.
(to be defined)
Definition in file genf.cxx.
|
|
Definition at line 80 of file genf.cxx. Referenced by assertsubtreeisok(), findleftson(), freecrum(), funcrejuvinate(), grimlyreap(), ishouldbother(), isreapable(), peelcrumoffnd(), recombineseq(), reserve(), takeovernephewsseq(), testforrejuvinate(), and testforreservedness(). |
|
||||||||||||||||
|
??? (to be defined) Definition at line 715 of file genf.cxx. References assert, typecorecrumhedr::cenftype, findfather(), findleftbro(), findleftson(), findrightbro, findrightmostson(), typecorecrumhedr::height, typecuc::height, LEFTBRO, typecorecrumhedr::leftbroorfather, LEFTMOSTSON, typecuc::leftson, NULL, typecuc::numberofsons, RIGHTBRO, typecorecrumhedr::rightbro, RIGHTMOSTSON, and typecorecrum. Referenced by createenf(), insertcbcnd(), insertseq(), levelpush(), newpeelcrumoffnd(), peelcrumoffnd(), peeloffcorrectson(), peelsoncorrectly(), slicecbcpm(), splitcrumseq(), takenephewnd(), takeovernephewsseq(), and varunpackloaf().
00719 {
00720 typecuc *father = NULL;
00721 typecorecrum *left = NULL, *right = NULL;
00722
00723 assert(newcc && old); // ERROR: adopt with NULL
00724 assert(newcc != old); // ERROR: adopt with both crums same
00725
00726 // assert(!isfullcrum(newcc); // adopt called with fullcrum
00727
00728 newcc->cenftype = old->cenftype; // make crum know what kind it is
00729
00730 switch (relative) {
00731 case LEFTMOSTSON:
00732 father = (typecuc *) old;
00733 left = NULL;
00734 right = findleftson(father);
00735 break;
00736
00737 case RIGHTMOSTSON:
00738 father = (typecuc *) old;
00739 if (father->leftson) left = findrightmostson(father);
00740 else left = NULL;
00741 right = NULL;
00742 break;
00743
00744 case RIGHTBRO:
00745 assert(newcc->height == old->height); // ERROR: adopt 1
00746 left = old;
00747 father = findfather(left);
00748 right = findrightbro(left);
00749 break;
00750
00751 case LEFTBRO:
00752 assert(newcc->height == old->height); // ERROR: adopt 2
00753 right = old;
00754 father = findfather(right);
00755 left = findleftbro(right);
00756 break;
00757
00758 default:
00759 assert(false); // ERROR: bad relative
00760 }
00761
00762 assert(father); // ERROR: adopt without a father!
00763 assert(father->height == newcc->height + 1); // ERROR: height mismatch in adopt
00764
00765 if (left) {
00766 left->rightbro = newcc;
00767 newcc->leftbroorfather = left;
00768 newcc->isleftmost = false;
00769 } else {
00770 father->leftson = newcc;
00771 newcc->leftbroorfather = (typecorecrum *) father;
00772 newcc->isleftmost = true;
00773 }
00774
00775 newcc->rightbro = right;
00776 if (right) {
00777 right->leftbroorfather = newcc;
00778 right->isleftmost = false;
00779 }
00780
00781 ++father->numberofsons;
00782 }
|
|
|
??? (to be defined) Definition at line 625 of file genf.cxx. References assert, disownnomodify(), dump(), isfullcrum(), ivemodified(), typecorecrum, and weakfindfather. Referenced by deletend(), eatbrossubtreend(), eatbrossubtreeseq(), newpeelcrumoffnd(), peelcrumoffnd(), splitcrumseq(), subtreefree(), takenephewnd(), takeovernephewsnd(), and takeovernephewsseq().
00627 {
00628 typecuc *father;
00629
00630 if (isfullcrum(crumptr)) {
00631 #ifndef DISTRIBUTION
00632 dump(crumptr);
00633 assert(0); // can't disownnomodify fullcrum
00634 #else
00635 assert(0);
00636 #endif
00637 }
00638
00639 if (!(father = weakfindfather(crumptr))) {
00640 #ifndef DISTRIBUTION
00641 dump(crumptr);
00642 assert(0); // disownnomodify called without a father
00643 #else
00644 assert(0);
00645 #endif
00646 }
00647
00648 disownnomodify(crumptr);
00649 ivemodified((typecorecrum *) father);
00650 }
|
|
|
??? (to be defined) Definition at line 660 of file genf.cxx. References assert, dump(), findleftbro(), findrightbro, isfullcrum(), typecorecrumhedr::leftbroorfather, typecuc::leftson, NULL, typecuc::numberofsons, typecorecrumhedr::rightbro, typecorecrum, and weakfindfather. Referenced by disown(), and loaffree().
00662 {
00663 typecuc *father;
00664 typecorecrum *left, *right;
00665
00666 if (isfullcrum(crumptr)) {
00667 #ifndef DISTRIBUTION
00668 dump(crumptr);
00669 assert(0); // can't disownnomodify fullcrum
00670 #else
00671 assert(0);
00672 #endif
00673 }
00674
00675 if (!(father = weakfindfather((typecorecrum *) crumptr))) {
00676 #ifndef DISTRIBUTION
00677 dump((typecorecrum *) crumptr);
00678 assert(0); // disownnomodify called without a father
00679 #else
00680 assert(0);
00681 #endif
00682 }
00683
00684 right = findrightbro(crumptr);
00685 father->numberofsons -= 1;
00686
00687 if (crumptr->isleftmost) {
00688 father->leftson = right;
00689 if (right) {
00690 right->leftbroorfather = (typecorecrum *) father;
00691 right->isleftmost = true;
00692 }
00693 } else { /* has left brother */
00694 left = findleftbro(crumptr);
00695 left->rightbro = right;
00696 if (right) {
00697 right->leftbroorfather = left;
00698 }
00699 }
00700 crumptr->leftbroorfather = crumptr->rightbro = NULL;
00701 /* ivemodified(father) ; *//*for now till we remove this */
00702 }
|
|
|
??? (to be defined) Definition at line 296 of file genf.cxx. References rejuvinateifnotRESERVED, typecorecrum, and weakfindfather. Referenced by adopt(), asserttreeisok(), dumpwholetree(), eatbrossubtreend(), findfullcrum(), graphpoom(), graphwholetree(), insertcbcnd(), insertseq(), makegappm(), newpeelcrumoffnd(), peelcrumoffnd(), setwispupwards(), and splitcrumupwards().
00298 {
00299 typecuc *ptr;
00300
00301 if ((ptr = weakfindfather(son)) != 0)
00302 rejuvinateifnotRESERVED((typecorecrum *) ptr);
00303
00304 return ptr;
00305 }
|
|
|
??? (to be defined) Definition at line 224 of file genf.cxx. References findfather(), isfullcrum(), and typecorecrum. Referenced by makecutsnd().
00226 {
00227 typecuc *ptr;
00228
00229 for (ptr = (typecuc *) descendant; !isfullcrum((typecorecrum *) ptr); ptr = findfather((typecorecrum *) ptr))
00230 ;
00231
00232 return ptr;
00233 }
|
|
|
??? (to be defined) Definition at line 315 of file genf.cxx. References typecorecrumhedr::leftbroorfather, NULL, rejuvinateifnotRESERVED, and typecorecrum. Referenced by adopt(), disownnomodify(), and splitcrumseq().
00317 {
00318 if (ptr->isleftmost) {
00319 rejuvinateifnotRESERVED(ptr);
00320 return NULL;
00321 }
00322
00323 ptr = ptr->leftbroorfather;
00324 rejuvinateifnotRESERVED(ptr);
00325 return /* checkenftypes( */ ptr /* ,"") */;
00326 }
|
|
|
??? (to be defined) Definition at line 336 of file genf.cxx. References typecorecrumhedr::leftbroorfather, rejuvinateifnotRESERVED, and typecorecrum. Referenced by peelsoncorrectly().
00338 {
00339 while (!ptr->isleftmost) {
00340 ptr = ptr->leftbroorfather;
00341 rejuvinateifnotRESERVED(ptr);
00342 }
00343 return /* checkenftypes( */ ptr /* ,"") */;
00344 }
|
|
|
|
??? (to be defined) Definition at line 410 of file genf.cxx. References findrightbro, rejuvinateifnotRESERVED, and typecorecrum. Referenced by findrightmostson(), and peelsoncorrectly().
00412 {
00413 typecorecrum *temp;
00414
00415 for (; leftbro && (temp = findrightbro(leftbro)); leftbro = temp)
00416 ;
00417
00418 rejuvinateifnotRESERVED(leftbro);
00419 return /* checkenftypes( */ leftbro /* ,"") */;
00420 }
|
|
|
??? (to be defined) Definition at line 463 of file genf.cxx. References findleftson(), and findrightmostbro(). Referenced by adopt(), and splitcrumseq().
00465 {
00466 return findrightmostbro(findleftson(ptr));
00467 }
|
|
|
??? (to be defined) Definition at line 371 of file genf.cxx. References NULL, rejuvinateifnotRESERVED, typecorecrumhedr::rightbro, and typecorecrum.
00373 {
00374 if (!ptr->rightbro) {
00375 rejuvinateifnotRESERVED(ptr);
00376 return NULL;
00377 }
00378
00379 ptr = ptr->rightbro;
00380 rejuvinateifnotRESERVED(ptr);
00381 return ptr;
00382 }
|
|
|
??? (to be defined) Definition at line 270 of file genf.cxx. References assert, isfullcrum(), typecorecrumhedr::leftbroorfather, NULL, and typecorecrum.
00272 {
00273 if (!ptr)
00274 assert(0); // weakfindfater called with NULL
00275
00276 if (isfullcrum(ptr)) /* what about spanf */
00277 return NULL;
00278
00279 for (; ptr && !ptr->isleftmost; ptr = ptr->leftbroorfather)
00280 ;
00281
00282 if (ptr)
00283 return (typecuc *) ptr->leftbroorfather;
00284 else
00285 return NULL;
00286 }
|
|
|
??? (to be defined) Definition at line 206 of file genf.cxx. References getleftmostbro(), typecorecrumhedr::leftbroorfather, rejuvinateifnotRESERVED, and typecorecrum. Referenced by takenephewnd().
00208 {
00209 ptr = getleftmostbro(ptr)->leftbroorfather;
00210 if (ptr)
00211 rejuvinateifnotRESERVED(ptr);
00212
00213 return (typecuc *) ptr;
00214 }
|
|
|
??? (to be defined) Definition at line 164 of file genf.cxx. References typecorecrumhedr::leftbroorfather, NULL, rejuvinateifnotRESERVED, and typecorecrum. Referenced by getleftmostbro().
00166 {
00167 rejuvinateifnotRESERVED(ptr);
00168
00169 if (ptr->isleftmost)
00170 return NULL;
00171
00172 ptr = ptr->leftbroorfather;
00173 if (ptr)
00174 rejuvinateifnotRESERVED((typecorecrum *) ptr);
00175
00176 return ptr;
00177 }
|
|
|
??? (to be defined) Definition at line 187 of file genf.cxx. References getleftbro(), and typecorecrum. Referenced by getfather().
00189 {
00190 typecorecrum *p;
00191
00192 while ((p = getleftbro(ptr)) != 0)
00193 ptr = p;
00194
00195 return ptr;
00196 }
|
|
|
??? (to be defined) Definition at line 105 of file genf.cxx. References typecuc::leftson, rejuvinateifnotRESERVED, and typecorecrum. Referenced by eatbrossubtreend(), eatbrossubtreeseq(), fixdspsofbroschildren(), fixincoresubtreewids(), getorderedsons(), recombinend(), recombineseq(), and takeovernephewsseq().
00107 {
00108 rejuvinateifnotRESERVED((typecorecrum *) ptr);
00109
00110 ptr = (typecuc *) ptr->leftson;
00111 if (ptr)
00112 rejuvinateifnotRESERVED((typecorecrum *) ptr);
00113
00114 return (typecorecrum *) ptr;
00115 }
|
|
|
??? (to be defined) Definition at line 145 of file genf.cxx. References getrightbro, and typecorecrum. Referenced by eatbrossubtreend(), and eatbrossubtreeseq().
00147 {
00148 typecorecrum *p;
00149
00150 while ((p = getrightbro(ptr)) != 0)
00151 ptr = p;
00152
00153 return ptr;
00154 }
|
|
|
??? (to be defined) Definition at line 91 of file genf.cxx. References typecorecrumhedr::cenftype, GRAN, and typecorecrum. Referenced by hgetinfo(), hputinfo(), makecontextfromcbc(), roomformoresons(), toofewsons(), and toomanysons().
|
|
|
??? (to be defined) Definition at line 243 of file genf.cxx. References assert, typecuc::cdsp, typecuc::cenftype, typecuc::cwid, typewid::dsas, dspsize, GRAN, isfullcrum(), iszerolock(), POOM, SPAN, typecorecrum, and widsize. Referenced by doinsertnd().
00245 {
00246 if (!isfullcrum((typecorecrum *) ptr))
00247 return false;
00248
00249 switch (ptr->cenftype) {
00250 case GRAN:
00251 return iszerolock(ptr->cwid.dsas, (unsigned)widsize(ptr->cenftype));
00252 case SPAN:
00253 case POOM:
00254 return iszerolock(ptr->cwid.dsas, (unsigned) widsize(ptr->cenftype)) && iszerolock(ptr->cdsp.dsas, (unsigned) dspsize(ptr->cenftype));
00255 default:
00256 assert(0); // isempytenfilade - bad enftype
00257 }
00258 return false; // Just to keep compiler from complaining
00259 }
|
|
|
??? (to be defined) Definition at line 792 of file genf.cxx. References typecorecrumhedr::leftbroorfather, rejuvinateifnotRESERVED, and typecorecrum. Referenced by createenf(), disown(), eatbrossubtreend(), expandcrumleftward(), firstinsertionnd(), fixdspsofbroschildren(), insertcbcnd(), insertmorend(), insertseq(), levelpush(), makecutsbackuptohere(), makegappm(), newpeelcrumoffnd(), peelcrumoffnd(), rearrangend(), setwidnd(), setwidseq(), setwispnd(), setwispupwards(), splitcrumseq(), takenephewnd(), and takeovernephewsseq().
00794 {
00795 bool fatherflag;
00796
00797 if (!ptr)
00798 return;
00799
00800 rejuvinateifnotRESERVED(ptr);
00801
00802 fatherflag = true; /* not really, but the incoming ptr wants to get modified */
00803 while (ptr) {
00804 /* if (ptr->height == 0) *//* 10-2-84 what was this for bug */
00805
00806 rejuvinateifnotRESERVED(ptr);
00807 if (fatherflag) {
00808 /* if (ptr->modified) return; *//* this optimization commented out because createcrum sets flag true to fix this makesure that all created crums get ivemodified then change createcrum then fix here */
00809 ptr->modified = true;
00810 }
00811 fatherflag = ptr->isleftmost;
00812 ptr = ptr->leftbroorfather;
00813 }
00814 }
|
|
|
??? (to be defined) Definition at line 598 of file genf.cxx. Referenced by recombinend(), and recombineseq().
00600 {
00601 /* typecuc *ptr; */
00602 return;
00603 /*
00604 * if (!isfullcrum (fullcrumptr)) #ifndef DISTRIBUTION assert(0); "Levelpull not called with fullcrum"); #else assert(0); #endif if
00605 * (fullcrumptr->numberofsons > 1) return; if (fullcrumptr->height <= 1)
00606 * return; ptr = (typecuc *) findleftson (fullcrumptr); dspadd
00607 * (&fullcrumptr->cdsp, &ptr->cdsp, &fullcrumptr->cdsp,
00608 * fullcrumptr->cenftype);
00609 *
00610 * disown (ptr); fullcrumptr->height--; transferloaf (ptr, fullcrumptr);
00611 * setwispupwards (fullcrumptr,1); freecrum (ptr); */
00612 }
|
|
|
??? (to be defined) Definition at line 557 of file genf.cxx. References adopt(), assert, typecuc::cenftype, createcrum(), typediskloafptr::diskblocknumber, DISKPTRNULL, typecuc::height, isfullcrum(), ivemodified(), L, setwispupwards(), SON, typecuc::sonorigin, transferloaf(), and typecorecrum. Referenced by makecutsdownnd(), and splitcrumupwards().
00559 {
00560 typecuc *newcuc;
00561 typediskloafptr temploafptr;
00562
00563 #ifndef DISTRIBUTION
00564 L("in levelpush");
00565 /* checkwholesubtree(fullcrumptr); */
00566 #endif
00567
00568 if (!isfullcrum((typecorecrum *) fullcrumptr))
00569 assert(0); // Levelpush not called with fullcrum
00570
00571 newcuc = (typecuc *) createcrum((int) fullcrumptr->height, (int) fullcrumptr->cenftype);
00572 newcuc->isleftmost = true;
00573
00574 transferloaf(fullcrumptr, newcuc);
00575 temploafptr = fullcrumptr->sonorigin;
00576 fullcrumptr->sonorigin.diskblocknumber = DISKPTRNULL;
00577 fullcrumptr->height++;
00578 adopt((typecorecrum *) newcuc, SON, (typecorecrum *) fullcrumptr); /* adopt new under fullcurm */
00579
00580 newcuc->sonorigin = temploafptr;
00581 setwispupwards(newcuc, 1);
00582 ivemodified((typecorecrum *) newcuc);
00583 ivemodified((typecorecrum *) fullcrumptr); /* is this redundant */
00584
00585 #ifndef DISTRIBUTION
00586 L("leaving levelpush");
00587 #endif
00588 }
|
|
|
??? (to be defined) Definition at line 511 of file genf.cxx. References findleftson(), typecuc::height, is2dcrum(), typecuc::leftson, MAX2DBCINLOAF, MAXBCINLOAF, MAXUCINLOAF, typecuc::numberofsons, and typecorecrum. Referenced by newpeelcrumoffnd(), peeloffcorrectson(), peelsoncorrectly(), recombineseq(), takeovernephewsnd(), and takeovernephewsseq().
00513 {
00514 if (ptr->height && !ptr->leftson) /* brings in leftson if not here */
00515 findleftson(ptr);
00516
00517 return ptr->numberofsons < (ptr->height > 1 ? MAXUCINLOAF : (is2dcrum((typecorecrum *) ptr) ? MAX2DBCINLOAF : MAXBCINLOAF));
00518 }
|
|
|
??? (to be defined) Definition at line 125 of file genf.cxx. References rejuvinateifnotRESERVED, typecorecrumhedr::rightbro, and typecorecrum. Referenced by takeovernephewsseq().
00127 {
00128 rejuvinateifnotRESERVED((typecorecrum *) ptr);
00129
00130 ptr = ptr->rightbro;
00131 if (ptr)
00132 rejuvinateifnotRESERVED((typecorecrum *) ptr);
00133
00134 return ptr;
00135 }
|
|
|
??? (to be defined) Definition at line 494 of file genf.cxx. References findleftson(), typecuc::height, is2dcrum(), typecuc::leftson, MAX2DBCINLOAF, MAXBCINLOAF, MAXUCINLOAF, typecuc::numberofsons, and typecorecrum.
00496 {
00497 if (ptr->height && !ptr->leftson) /* brings in leftson if not here */
00498 findleftson(ptr);
00499
00500 return ptr->numberofsons < (ptr->height > 1 ? MAXUCINLOAF - 1 : (is2dcrum((typecorecrum *) ptr) ? MAX2DBCINLOAF : MAXBCINLOAF));
00501 }
|
|
|
??? (to be defined) Definition at line 477 of file genf.cxx. References findleftson(), typecuc::height, is2dcrum(), MAX2DBCINLOAF, MAXBCINLOAF, MAXUCINLOAF, typecuc::numberofsons, and typecorecrum. Referenced by makecutsbackuptohere(), makecutsdownnd(), newpeelcrumoffnd(), peeloffcorrectson(), splitcrumupwards(), and varpackloaf().
00479 {
00480 if (ptr->height)
00481 findleftson(ptr);
00482
00483 return ptr->numberofsons > (ptr->height > 1 ? MAXUCINLOAF : (is2dcrum((typecorecrum *) ptr) ? MAX2DBCINLOAF : MAXBCINLOAF));
00484 }
|
|
||||||||||||
|
??? (to be defined) Definition at line 528 of file genf.cxx. References typecuc::cenftype, findleftson(), typecuc::height, typecuc::leftbroorfather, typecuc::leftson, NULL, typecuc::numberofsons, POOM, SPAN, and typecorecrum. Referenced by levelpush().
00531 {
00532 if (from->height == 0) /* bottom crums */
00533 return;
00534
00535 if (from->cenftype == SPAN || from->cenftype == POOM) {
00536 /* the sucker dosen't know what it is yet anywow */
00537 }
00538
00539 typecuc *ptr = (typecuc *) findleftson(from);
00540 int nsons = from->numberofsons;
00541 from->numberofsons = 0;
00542 to->numberofsons = nsons;
00543 ptr->leftbroorfather = (typecorecrum *) to;
00544 to->leftson = (typecorecrum *) ptr;
00545 from->leftson = NULL;
00546 /* to->sonorigin = from->sonorigin; from->sonorigin = DISKPTRNULL; */
00547 }
|
|
|
??? (to be defined) Definition at line 354 of file genf.cxx. References typecorecrumhedr::leftbroorfather, and typecorecrum. Referenced by isreapable().
00356 {
00357 while (!ptr->isleftmost)
00358 ptr = ptr->leftbroorfather;
00359
00360 return ptr;
00361 }
|
|
|
??? (to be defined) Definition at line 392 of file genf.cxx. References NULL, typecorecrumhedr::rightbro, and typecorecrum.
|
1.3.4