
Заготовки по С / Динамические структуры / GDSL / Документация
.pdf
5.10 |
list.h File Referen e |
217 |
ˆ |
element_t gdsl_list_map_ba kward ( onst gdsl_list_t L, |
ˆgdslvoidWRITEParsegdslmapF,listlistFILEfunfromwritetailMAPto(headonstF,. voidgdsl USERlist t DATA)L, gdsl_write_fun _t
ˆvoidfun ritegdslWRITEall thelistelemenF,OUTPUTFILEs ofxmla list (FILE,toonsta levoid.gdsl_USERlist_tDATA)L, gdsl_write_-
ˆWRITEvoid gdsltheF,listFILEontentdumpof a list( onsttoOUTPUTa gdslle into_listXMLFILE,.t voidL,gdslUSERwriteDATA)fun _t
ˆgdslL) DumpCrDestrgdslatelistoyahealistnewinternalursorlistursorOUTPUTursorstru.gdsl.turfreee oflist(FILE,gdsla list_ursortovoidlista leUSER.allourorgdsl _list(DATA)onstC) gdsl_list_t
|
|
gdsl_ |
_ |
move_ _head ( |
_ |
_ ursor_t C) |
|
void gdsl_ |
_ |
move to_tail (gdsl_list_ ursor_t C) |
|||
|
|
|
|
head of its list. |
|
|
ˆ |
Put a ursor on the tail of its list. |
|
|
|||
gdsl |
|
|
t gdsl_list_ ursor_move_to_ alue (gdsl_list_- |
|||
|
MovePlaPlagdslelemenelemenursoraat C,listursorursorgdslt C,ononetursorulonggdslastepompareelementartiforwardstepPOS)listulargivenelementfunforwardofursorbyitsitslist.t COMPposition.move(gdsl. toF,listvoidpositionursorVALUE)(tgdslC) _- |
|||||
ˆ voidlistgdslursor |
|
|
|
|
||
|
|
gdsl_list_ |
_step ba kward gdsl_list |
ursor_t C) |
||
ˆ bool gdsl |
list |
ba kward of its list. |
gdsl_list_ ursor_t |
|||
ursor is on head ( onst |
||||||
|
C) Che k if a ursor is on the head of its list. |
|
|
|||
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen |
|
|

218 |
|
|
|
|
|
|
|
|
|
|
|
gdsl File Do umentation |
|
ˆ bool |
gdsl_list_ ursor_is_on |
tail |
( onst gdsl_list_ ursor_t |
||||||||||
|
C) |
|
|
|
|
is on the tail of its list. |
|
|
|||||
|
|
|
|
|
|
|
|
|
su ( onst gdsl_list_ ursor_t C) |
||||
|
bool gdsl_list |
|
|
|
su essor. |
|
gdsl_list_ ursor_t C) |
||||||
|
|
ursor_has |
pred |
||||||||||
ˆ |
|
Che k if a ursor has a |
prede essor. |
|
|
|
|||||||
void |
gdsl list |
|
ursor |
set |
|
onten( onst(gdsl_list_ ursor_t C, |
|||||||
ˆ gdsl_elemen |
|
t |
E) |
|
|
|
|
|
|
( onst gdsl_- |
|||
|
gdsl list_ ursor_get_ ontent |
||||||||||||
|
|
Set th |
|
of the ursor. |
|
|
|
|
|
||||
|
|
Getursorthe |
|
of a ursor. |
|
|
_insert_after |
(gdsl_list_- |
|||||
ˆ gdsl |
elemenontent |
|
gdsl |
list_ |
|
||||||||
|
list |
|
C) |
|
|
|
|
|
|
|
|
||
ˆ gdslursorursorInsertelementtta C,C,newvoidvoidelementelementVALUE)gdslafterlista _ursorursor. _insert_before |
(gdsl_list_- |
ˆˆ gdslC)gdslursorRemoveInsertelemenelementa C)newtheelementgdslVALUE)gdslunderbeforelistlistaa ursor.. __removeremove(gdslafterlist(gdslursorlist__t- |
||||||||
Remove the |
|
after a ursor. |
|
|
||||
ˆ gdsl elemen _ gdsl list |
ursor_remove_before (gdsl_list_- |
|||||||
ursor |
C) |
|
|
|
|
|
|
|
ursorlist |
C) |
|
before a ursor. |
|
|
|||
Remove the |
|
(gdsl_list_- |
||||||
ˆ gdsl |
ursor_ |
gdsl |
|
list_ ursor_delete |
||||
ursor |
C) |
|
|
|
|
|
|
|
Delete the element under a ursor. |
|
|
||||||
ˆ gdsl |
ursor_ gdsl_list |
. |
ursor_delete_after (gdsl_list_- |
|||||
Delete the element after a |
|
Jun 22 11:15:30 2006 for gdsl by Doxygen |
|
|||||
|
|
Generated onursorTh |
|

5.10 |
.h File Referen e |
219 |
|
ˆ |
gdsl list |
ursor_t gdsl_list_ ursor_delete_before |
(gdsl_- |
|
list ursor_ C) |
|
|
|
Delete the element before the ursor of a list. |
|
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen

220 |
|
gdsl File Do umentation |
|
5.11 gdsl_ma ros.h File Referen e |
|
||
De nes |
|
|
|
|
MINnumberAX(X,(X,ofY)Y)two(X(XnumbersY?X:Y). |
||
ˆ #de ne GDSLlowestgr atest |
> |
|
|
Give the |
number of two numbers>Y?Y:X). |
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen

.12 gdsl perm.h File Referen e |
|
221 |
5.12 gdsl_perm.h File Referen e |
|
|
Typedefs |
|
|
ˆ typedefGDSLgdslpermutationvoid(perm typegdsl. _permwrite |
|
|
gdsl_perm_ |
_fun _t )(ulong E, |
FILE |
ˆumerationsDAypedefOUTPUTGDSLA) gdslpermutationFILE,perm datagdslwrite_funlo tionationtyp_.t POSITION, void USER_-
Enˆ enFIRSTThisgdsltype= 1,ispermGDSLfor gdsl__positionwritePERMermgdsl POSITIONperm{funGDSLt.dataPERMLASTt =POSITION2 } _-
Fun tions
ˆ gdslN)voidgdslCrDestrCopygdslatepermpermharoyaaermutationpermermutationnwt gdslgdslfree. permperm.(gdsl. allopermopy((onstonstP)gdslhar_permNAME,t P)onst ulong
ˆ ulongonstGetGet gdslINDIX)thethe name(INDIX+1)izegdslpermofof permermutation-getthgetelutationsizementgetelemen. .(fromnameonsta(gdslpermut(onstonstpermgdslgdsltion.___permpermtP) __tt P)P, onst
Generatedˆ P) Geton ThuthegdslarrayJun_22elementsperm11:15:30getof2006a permutationelementsfor gdsl by. Doxygenarray ( onst gdsl_perm_t

222 |
|
|
|
|
|
gdsl File Do umentation |
||
ˆ ulong gdsl_perm |
_inversions_ oun |
( onst gdsl_perm_t |
||||||
|
P) |
Count the y les numberlinear to linear permutatiermutation. |
. |
|||||
|
|
|
inversions |
umber into a linear p |
|
|
||
|
|
|
gdsl_perm |
y les_ oun ( |
st gdsl_perm_t P) |
|||
ˆ ulong gdsl_perm |
y les oun |
( onst gdsl_perm_t |
||||||
|
P) |
Count the y les numbanoniintoal anoni al permutation. |
|
|||||
ˆ gdsl perm t gdsl |
perm_set name (gdsl |
perm_t P, onst har |
||||||
ˆ |
|
|
|
heNAME)namepreviousnexttpofermutationgdslgdslpermutationpermutationpermpermfromfromlinear.set elementsarlinearprevnextermutationermutation((gdslarray. perm. (gdsltt_P)perm_t |
||||
|
|
permthe |
|
|
|
|
||
|
|
onst |
|
|
|
|
|
|
|
gdslNEWGetSet |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ˆˆ P,onstgdslgdslQ, InitializeMultiplyConvonstgdslpermpermulongrtgdslatwoapermineartpermt ermutationsARRAY)gdslgdslermutationALPHA,permpermP)with._antolinearmultiplyanonionstarrayitsgdsloftoalvaluesalperm(gdslformanoni. ._permtalBETA)(gdslt _RESULT,perm t
ˆ gdsl |
|
t gdsl perm |
|
to linear (gdsl_perm_t |
|
Q, onst |
P) |
|
|
|
|
Conv rt a |
al permutation to its linear form. |
||||
|
everse in anoni permutation.everse (gdsl_perm_t P) |
||||
|
|
|
in erse (gdsl_perm_t P) |
||
Inverse in pla e permutation. |
|
|
|||
ˆ gdsl_perm_t gdsl perm |
randomize (gdsl_perm_t P) |
||||
Randomize pla ermutation. |
|
|
|
||
|
|
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen |
|

5.12 |
perm.h File Referen e |
223 |
ˆ gdslelementelementermutationonst gdsl_perm_apply_on_array |
(gdsl_- |
ˆvoidfunApplygdslriteWRITEa ppermV, __F,writeFILEongdslto( onstapvermgdsltor. t P)perm_t P, onst gdsl_write_-
ˆvoidwriteWgdslfunthepermelementsWRITEwriteof a permutationF,xmlOUTPUTFILE(onstto_gdslaFILE,le. permvoid _USERt P, onstDATA)gdsl
ˆDATA)voidfunWgdslrite WRITEtheperm__F,dumpofFILEa permutation( onst gdsltoOUTPUTperma le into_P,XMLFILE,onst. voidgdsl writeUSER__--
Dump the internal stru tureOUTPUTof a permutationFILE, voida le.USER_DATA)
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen

224 |
gdsl File Do umentation |
|
5.13 gdsl_queue.h File Referen e |
|
|
T |
|
|
Funypedefsˆˆ gdslttionsGDSLq_euequeuegdsl_ttypquegdslue. _gdslqueuequeueallo t( o |
st har |
|
gdslateharfuoynaqueueanewt .queueALLOC. free.ush(F,gdsl(gdslgdslqueuequeuefree(funonstQ)Q)_t FREENAME,F) |
gdsl_- |
|
voidalloFlushDestrCr |
|
|
ˆ |
|
Getgdslsthegdslk ifsizenameaqueuegdslofofa aisqueuequeueisemptyget.empty.. sizeget (nameonst gdsl__queuegdsl___queuettQ) _t Q) |
||||||
|
boolulongonstChe |
|
|
|
|
|
||
|
gdsl |
|
|
t t gdsl_queue_get_head ( onst gdsl_queue_t |
||||
|
Q) |
|
element t gdsl |
|
queue_get_tail |
gdsl_queue_t Q) |
||
|
Get the |
head of a queue. |
|
|||||
|
|
tail of a queue. |
|
|
||||
ˆ gdsl |
queue_t gdsl |
queue_set_name( onstgdsl_queue_t Q, onst |
||||||
ˆ |
|
|
elementhe nameelementNAME)of a queuegdsl. queue_insert (gdsl_queue_t Q, void |
|||||
|
gdslharSetNEW |
|
|
|
|
ˆ gdslVALUE)InsertRemoveelemenanan elementGeneratedgdslinfromquequeueaonqueueTh(PUT)Junremove(GET). 22 .11:15:30(gdsl2006queuefor gdslt byQ)Doxygen

5.13 gdsl_queue.h File Referen e |
225 |
|
ˆ |
element_ gdsl_ |
sear h ( onst gdsl_queue_t Q, |
ˆˆ |
gdslSearSearelementelementomparehhttforforQ,Q, angdslulongarelementtfunigdslmapularPOS)gdslbyelemtqueueitsCOMPfunqueuepntositionin searF,MAPqueuemapinvoidh.queueF,byforwardVALUE)void. position( onst(onst gdslgdsl__-- |
|
|
queuegdslqueue |
|
ˆgdslqueueParseelementtaQ,queuegdslfromt mgdslheadp tofunqueuetail. t_MAPmap F,bavoidkwardUSER(_onstDATA)gdsl_-
ˆvoidfunParseritegdslWRITEa quequeuefromF, writeFILEail to head( onst. gdsl_queue_tUSERQ,gdslDATA)write_-
ˆvoidwriteW gdslfunall thequeueontentlementsWRITEwriteof aF,OUTPUTqueuexmlFILEto( aonstleFILE,. gdslvoidqueueUSERt_DATA)Q, gdsl
ˆDATA)voidfunWritegdslWRITEthequeueF,ofdumpFILEa queue( toonsta legdslintoOUTPUTXMLqueue. _FILE,t Q, voidgdsl writeUSER__--
Dump the internal stru tureOUTPUTof a queue_toFILE,a levoid. USER_DATA)
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen

226 |
|
|
|
gdsl File Do umentation |
||
5.14 gdsl_rbtree.h File Referen e |
|
|
||||
T |
|
|
|
|
|
|
Funypedefsˆˆ gdsltionsrbtreegdslrbtreerbtreegdslgdslrbtreerbtreeallot ( onst har |
|
|
||||
|
|
|
|
|
F, |
|
|
afunteoyaanewfund-blaALLdt-blakCOMPfreetrushk .(gdsl(F,gdsl. F)gdslrbtreerbtreefree___ttfunT)T) _t FREENAME, gdsl_- |
|||||
|
gdsl |
|
|
|
|
|
|
voidalloompDestrCr |
|
|
|
|
|
|
Flush a r d-bla k tr . |
|
|
|
|
|
ˆ |
rbtreerbtreedof-ofblaaekgdslistr-dgetbla-blaeemptiskrbtreeknamesizeemptytr . .(. onst(getonstgdslrootgdsl__rbtree(rbtreeonst__tgdslT)t T)_rbtree_t |
|||||
|
T)gdslboolharCheGetgdslelemengdslthekifrootname |
|
|
|
|
|
|
ulong gdsl |
get |
|
( onst gdsl_rbtree_t T) |
|
|
|
heigh |
( onst gdsl_rbtree_t T) |
|
|
||
|
size of a |
-bla k . |
|
|
|
|
ˆ |
Get the height of a re -bla k |
ee. |
|
|
||
gdsl rbtree gdsl_ |
_set_name (gdsl_rbtree_t T, onst |
|||||
ˆ |
elementhe nameelementNAME)of a regdsl-blarbtreerbtreek._insert (gdsl_rbtreeturn T, |
void |
||||
|
gdslharSetNEW |
|
|
|
|
|
ˆ |
|
|
|
remoif it'sve not(gdslfound or _t itT,. |
void |
|
|
gdslVALUE,Insertelemenanin RESULT)gdslinto a r d-bla k_tr |
|
|
VALUE)Remove an elementGeneratedfrom aon Thud-blaJunk tr22 .11:15:30 2006 for gdsl by Doxygen