00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 BEGIN
00060
00061 #include "bitset.h"
00062 #include "#filename#.h"
00063
00064 #uset# *#uset#_Create(
00065 size_t size,
00066 MEM_POOL *pool
00067 )
00068 {
00069 return (#uset#*) BS_Create(size,pool);
00070 }
00071
00072 size_t #uset#_Size_Alloc_Size(
00073 size_t size
00074 )
00075 {
00076 return BS_Size_Alloc_Size(size);
00077 }
00078
00079 size_t #uset#_Alloc_Size(
00080 #uset# *set
00081 )
00082 {
00083 return BS_Alloc_Size((BS*) set);
00084 }
00085
00086 #uset# *#uset#_ClearD(
00087 #uset# *set
00088 )
00089 {
00090 return (#uset#*) BS_ClearD((BS*) set);
00091 }
00092
00093 #uset# *#uset#_Create_Empty(
00094 size_t size,
00095 MEM_POOL *pool
00096 )
00097 {
00098 return (#uset#*) BS_Create_Empty(size,pool);
00099 }
00100
00101 #uset# *#uset#_Range(
00102 BS_ELT low,
00103 BS_ELT high,
00104 MEM_POOL *pool
00105 )
00106 {
00107 return (#uset#*) BS_Range(low,high,pool);
00108 }
00109
00110 #uset# *#uset#_RangeD(
00111 #uset# *set,
00112 BS_ELT low,
00113 BS_ELT high,
00114 MEM_POOL *pool
00115 )
00116 {
00117 return (#uset#*) BS_RangeD((BS*) set,low,high,pool);
00118 }
00119
00120 #uset# *#uset#_Singleton(
00121 #base_type# element,
00122 MEM_POOL *pool
00123 )
00124 {
00125 return (#uset#*) BS_Singleton(#elt_num#(element),pool);
00126 }
00127
00128 #uset# *#uset#_SingletonD(
00129 #uset# *set,
00130 #base_type# element,
00131 MEM_POOL *pool
00132 )
00133 {
00134 return (#uset#*) BS_SingletonD((BS*) set,#elt_num#(element),pool);
00135 }
00136
00137 BEGIN SUBUNIVERSES
00138 #uset# *#uset#_SingletonS(
00139 #base_type# element,
00140 MEM_POOL *pool,
00141 #uset#_SUBUNIVERSE *sub
00142 )
00143 {
00144 return (#uset#*) BS_Singleton(#elt_num_sub#(element,sub),pool);
00145 }
00146
00147 #uset# *#uset#_SingletonDS(
00148 #uset# *set,
00149 #base_type# element,
00150 MEM_POOL *pool,
00151 #uset#_SUBUNIVERSE *sub
00152 )
00153 {
00154 return (#uset#*) BS_SingletonD((BS*) set,#elt_num_sub#(element,sub),pool);
00155 }
00156
00157 END SUBUNIVERSES
00158 #uset# *#uset#_Universe(
00159 size_t size,
00160 MEM_POOL *pool
00161 )
00162 {
00163 return (#uset#*) BS_Universe(size,pool);
00164 }
00165
00166 #uset# *#uset#_UniverseD(
00167 #uset# *set,
00168 size_t size,
00169 MEM_POOL *pool
00170 )
00171 {
00172 return (#uset#*) BS_UniverseD((BS*) set,size,pool);
00173 }
00174
00175 #uset# *#uset#_Copy(
00176 #uset# *set,
00177 MEM_POOL *pool
00178 )
00179 {
00180 return (#uset#*) BS_Copy((BS*) set,pool);
00181 }
00182
00183 #uset# *#uset#_CopyD(
00184 #uset# *set1,
00185 #uset# *set2,
00186 MEM_POOL *pool
00187 )
00188 {
00189 return (#uset#*) BS_CopyD((BS*) set1,(BS*) set2,pool);
00190 }
00191
00192 #base_type# #uset#_Choose(
00193 #uset# *set
00194 )
00195 {
00196 BS_ELT elt = BS_Choose((BS*) set);
00197 if ( elt != BS_CHOOSE_FAILURE )
00198 return #num_elt#(elt);
00199 else
00200 return #uset#_CHOOSE_FAILURE;
00201 }
00202
00203 #base_type# #uset#_Intersection_Choose(
00204 #uset# *set1,
00205 #uset# *set2
00206 )
00207 {
00208 BS_ELT elt = BS_Intersection_Choose((BS*) set1, (BS*) set2);
00209 if ( elt != BS_CHOOSE_FAILURE )
00210 return #num_elt#(elt);
00211 else
00212 return #uset#_CHOOSE_FAILURE;
00213 }
00214
00215 #base_type# #uset#_Choose_Next(
00216 #uset# *set,
00217 #base_type# x
00218 )
00219 {
00220 BS_ELT elt = BS_Choose_Next((BS*) set, #elt_num#(x));
00221 if ( elt != BS_CHOOSE_FAILURE )
00222 return #num_elt#(elt);
00223 else
00224 return #uset#_CHOOSE_FAILURE;
00225 }
00226
00227 #base_type# #uset#_Intersection_Choose_Next(
00228 #uset# *set1,
00229 #uset# *set2,
00230 #base_type# x
00231 )
00232 {
00233 BS_ELT elt = BS_Intersection_Choose_Next((BS*) set1, (BS*) set2,
00234 #elt_num#(x));
00235 if ( elt != BS_CHOOSE_FAILURE )
00236 return #num_elt#(elt);
00237 else
00238 return #uset#_CHOOSE_FAILURE;
00239 }
00240
00241 #base_type# #uset#_Choose_Range(
00242 #uset# *set,
00243 BS_ELT low,
00244 BS_ELT high
00245 )
00246 {
00247 BS_ELT elt = BS_Choose_Range((BS*) set,low,high);
00248 if ( elt != BS_CHOOSE_FAILURE )
00249 return #num_elt#(elt);
00250 else
00251 return #uset#_CHOOSE_FAILURE;
00252 }
00253
00254 BEGIN SUBUNIVERSES
00255 #base_type# #uset#_ChooseS(
00256 #uset# *set,
00257 #uset#_SUBUNIVERSE *sub
00258 )
00259 {
00260 BS_ELT elt = BS_Choose((BS*) set);
00261 if ( elt != BS_CHOOSE_FAILURE )
00262 return #num_elt_sub#(elt,sub);
00263 else
00264 return #uset#_CHOOSE_FAILURE;
00265 }
00266
00267 #base_type# #uset#_Intersection_ChooseS(
00268 #uset# *set1,
00269 #uset# *set2,
00270 #uset#_SUBUNIVERSE *sub
00271 )
00272 {
00273 BS_ELT elt = BS_Intersection_Choose((BS*) set1, (BS*) set2);
00274 if ( elt != BS_CHOOSE_FAILURE )
00275 return #num_elt_sub#(elt,sub);
00276 else
00277 return #uset#_CHOOSE_FAILURE;
00278 }
00279
00280 #base_type# #uset#_Choose_NextS(
00281 #uset# *set,
00282 #base_type# x,
00283 #uset#_SUBUNIVERSE *sub
00284 )
00285 {
00286 BS_ELT elt = BS_Choose_Next((BS*) set, #elt_num_sub#(x,sub));
00287 if ( elt != BS_CHOOSE_FAILURE )
00288 return #num_elt_sub#(elt,sub);
00289 else
00290 return #uset#_CHOOSE_FAILURE;
00291 }
00292
00293 #base_type# #uset#_Intersection_Choose_NextS(
00294 #uset# *set1,
00295 #uset# *set2,
00296 #base_type# x,
00297 #uset#_SUBUNIVERSE *sub
00298 )
00299 {
00300 BS_ELT elt = BS_Intersection_Choose_Next((BS*) set1, (BS*) set2,
00301 #elt_num_sub#(x,sub));
00302 if ( elt != BS_CHOOSE_FAILURE )
00303 return #num_elt_sub#(elt,sub);
00304 else
00305 return #uset#_CHOOSE_FAILURE;
00306 }
00307
00308 #base_type# #uset#_Choose_RangeS(
00309 #uset# *set,
00310 BS_ELT low,
00311 BS_ELT high,
00312 #uset#_SUBUNIVERSE *sub
00313 )
00314 {
00315 BS_ELT elt = BS_Choose_Range((BS*) set,low,high);
00316 if ( elt != BS_CHOOSE_FAILURE )
00317 return #num_elt_sub#(elt,sub);
00318 else
00319 return #uset#_CHOOSE_FAILURE;
00320 }
00321
00322 END SUBUNIVERSES
00323 #uset# *#uset#_Difference(
00324 #uset# *set1,
00325 #uset# *set2,
00326 MEM_POOL *pool
00327 )
00328 {
00329 return (#uset#*) BS_Difference((BS*) set1,(BS*) set2,pool);
00330 }
00331
00332 #uset# *#uset#_DifferenceD(
00333 #uset# *set1,
00334 #uset# *set2
00335 )
00336 {
00337 return (#uset#*) BS_DifferenceD((BS*) set1,(BS*) set2);
00338 }
00339
00340 #uset# *#uset#_Difference1(
00341 #uset# *set,
00342 #base_type# x,
00343 MEM_POOL *pool
00344 )
00345 {
00346 return (#uset#*) BS_Difference1((BS*) set,#elt_num#(x),pool);
00347 }
00348
00349 #uset# *#uset#_Difference1D(
00350 #uset# *set,
00351 #base_type# x
00352 )
00353 {
00354 return (#uset#*) BS_Difference1D((BS*) set,#elt_num#(x));
00355 }
00356
00357 BEGIN SUBUNIVERSES
00358 #uset# *#uset#_Difference1S(
00359 #uset# *set,
00360 #base_type# x,
00361 MEM_POOL *pool,
00362 #uset#_SUBUNIVERSE *sub
00363 )
00364 {
00365 return (#uset#*) BS_Difference1((BS*) set,#elt_num_sub#(x,sub),pool);
00366 }
00367
00368 #uset# *#uset#_Difference1DS(
00369 #uset# *set,
00370 #base_type# x,
00371 #uset#_SUBUNIVERSE *sub
00372 )
00373 {
00374 return (#uset#*) BS_Difference1D((BS*) set,#elt_num_sub#(x,sub));
00375 }
00376
00377 END SUBUNIVERSES
00378 #uset# *#uset#_Intersection(
00379 #uset# *set1,
00380 #uset# *set2,
00381 MEM_POOL *pool
00382 )
00383 {
00384 return (#uset#*) BS_Intersection((BS*) set1,(BS*) set2,pool);
00385 }
00386
00387 #uset# *#uset#_IntersectionD(
00388 #uset# *set1,
00389 #uset# *set2
00390 )
00391 {
00392 return (#uset#*) BS_IntersectionD((BS*) set1,(BS*) set2);
00393 }
00394
00395 size_t #uset#_Size(
00396 #uset# *set
00397 )
00398 {
00399 return BS_Size((BS*) set);
00400 }
00401
00402 #uset# *#uset#_Union(
00403 #uset# *set1,
00404 #uset# *set2,
00405 MEM_POOL *pool
00406 )
00407 {
00408 return (#uset#*) BS_Union((BS*) set1,(BS*) set2,pool);
00409 }
00410
00411 #uset# *#uset#_UnionD(
00412 #uset# *set1,
00413 #uset# *set2,
00414 MEM_POOL *pool
00415 )
00416 {
00417 return (#uset#*) BS_UnionD((BS*) set1,(BS*) set2,pool);
00418 }
00419
00420 #uset# *#uset#_Union1(
00421 #uset# *set,
00422 #base_type# x,
00423 MEM_POOL *pool
00424 )
00425 {
00426 return (#uset#*) BS_Union1((BS*) set,#elt_num#(x),pool);
00427 }
00428
00429 #uset# *#uset#_Union1D(
00430 #uset# *set,
00431 #base_type# x,
00432 MEM_POOL *pool
00433 )
00434 {
00435 return (#uset#*) BS_Union1D((BS*) set,#elt_num#(x),pool);
00436 }
00437
00438 #uset# *#uset#_Union1D_Intersection( #uset# *set1, #uset# *set2, #uset# *set3,
00439 MEM_POOL *pool )
00440 {
00441 return (#uset#*) BS_UnionD_Intersection((BS*)set1,(BS*)set2,(BS*)set3,pool);
00442 }
00443
00444 BEGIN SUBUNIVERSES
00445 #uset# *#uset#_Union1S(
00446 #uset# *set,
00447 #base_type# x,
00448 MEM_POOL *pool,
00449 #uset#_SUBUNIVERSE *sub
00450 )
00451 {
00452 return (#uset#*) BS_Union1((BS*) set,#elt_num_sub#(x,sub),pool);
00453 }
00454
00455 #uset# *#uset#_Union1DS(
00456 #uset# *set,
00457 #base_type# x,
00458 MEM_POOL *pool,
00459 #uset#_SUBUNIVERSE *sub
00460 )
00461 {
00462 return (#uset#*) BS_Union1D((BS*) set,#elt_num_sub#(x,sub),pool);
00463 }
00464
00465 END SUBUNIVERSES
00466 BOOL #uset#_ContainsP(
00467 #uset# *set1,
00468 #uset# *set2
00469 )
00470 {
00471 return BS_ContainsP((BS*) set1,(BS*) set2);
00472 }
00473
00474 BOOL #uset#_EmptyP(
00475 #uset# *set
00476 )
00477 {
00478 return BS_EmptyP((BS*) set);
00479 }
00480
00481 BOOL #uset#_EqualP(
00482 #uset# *set1,
00483 #uset# *set2
00484 )
00485 {
00486 return BS_EqualP((BS*) set1,(BS*) set2);
00487 }
00488
00489 BOOL #uset#_IntersectsP(
00490 #uset# *set1,
00491 #uset# *set2
00492 )
00493 {
00494 return BS_IntersectsP((BS*) set1,(BS*) set2);
00495 }
00496
00497 BOOL #uset#_MemberP(
00498 #uset# *set,
00499 #base_type# x
00500 )
00501 {
00502 return BS_MemberP((BS*) set,#elt_num#(x));
00503 }
00504
00505 BOOL #uset#_Intersection_MemberP(
00506 #uset# *set1,
00507 #uset# *set2,
00508 #base_type# x
00509 )
00510 {
00511 return BS_Intersection_MemberP((BS*) set1, (BS*) set2, #elt_num#(x));
00512 }
00513
00514 BEGIN SUBUNIVERSES
00515 BOOL #uset#_MemberPS(
00516 #uset# *set,
00517 #base_type# x,
00518 #uset#_SUBUNIVERSE *sub
00519 )
00520 {
00521 return BS_MemberP((BS*) set,#elt_num_sub#(x,sub));
00522 }
00523
00524 BOOL #uset#_Intersection_MemberPS(
00525 #uset# *set1,
00526 #uset# *set2,
00527 #base_type# x,
00528 #uset#_SUBUNIVERSE *sub
00529 )
00530 {
00531 return BS_Intersection_MemberP((BS*) set1, (BS*) set2, #elt_num_sub#(x,sub));
00532 }
00533
00534 END SUBUNIVERSES
00535
00536 void #uset#_Print(
00537 #uset# *set,
00538 FILE *f
00539 )
00540 {
00541 BS_Print((BS*) set,f);
00542 }