00001
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _GAN_COMPARE_H
00030 #define _GAN_COMPARE_H
00031
00032 #include <gandalf/common/misc_defs.h>
00033
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037
00048
00049
00050 #define GAN_COMP_TYPE int
00051
00055 int gan_max2 ( int a, int b );
00056
00060 int gan_min2 ( int a, int b );
00061
00065 int gan_max3 ( int a, int b, int c );
00066
00070 int gan_min3 ( int a, int b, int c );
00071
00075 int gan_max4 ( int a, int b, int c,
00076 int d );
00077
00081 int gan_min4 ( int a, int b, int c,
00082 int d );
00083
00087 int gan_max5 ( int a, int b, int c,
00088 int d, int e );
00089
00093 int gan_min5 ( int a, int b, int c,
00094 int d, int e );
00095
00099 int gan_max6 ( int a, int b, int c,
00100 int d, int e, int f );
00101
00105 int gan_min6 ( int a, int b, int c,
00106 int d, int e, int f );
00107
00108 #undef GAN_COMP_TYPE
00109
00110
00111 #define GAN_COMP_TYPE unsigned char
00112 #define GAN_MAX2 gan_max2_uc
00113 #define GAN_MIN2 gan_min2_uc
00114 #define GAN_MAX3 gan_max3_uc
00115 #define GAN_MIN3 gan_min3_uc
00116 #define GAN_MAX4 gan_max4_uc
00117 #define GAN_MIN4 gan_min4_uc
00118 #define GAN_MAX5 gan_max5_uc
00119 #define GAN_MIN5 gan_min5_uc
00120 #define GAN_MAX6 gan_max6_uc
00121 #define GAN_MIN6 gan_min6_uc
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152 unsigned char gan_max2_uc ( unsigned char a, unsigned char b );
00153 unsigned char gan_min2_uc ( unsigned char a, unsigned char b );
00154 unsigned char gan_max3_uc ( unsigned char a, unsigned char b, unsigned char c );
00155 unsigned char gan_min3_uc ( unsigned char a, unsigned char b, unsigned char c );
00156 unsigned char gan_max4_uc ( unsigned char a, unsigned char b,
00157 unsigned char c, unsigned char d );
00158 unsigned char gan_min4_uc ( unsigned char a, unsigned char b,
00159 unsigned char c, unsigned char d );
00160 unsigned char gan_max5_uc ( unsigned char a, unsigned char b, unsigned char c,
00161 unsigned char d, unsigned char e );
00162 unsigned char gan_min5_uc ( unsigned char a, unsigned char b, unsigned char c,
00163 unsigned char d, unsigned char e );
00164 unsigned char gan_max6_uc ( unsigned char a, unsigned char b, unsigned char c,
00165 unsigned char d, unsigned char e, unsigned char f );
00166 unsigned char gan_min6_uc ( unsigned char a, unsigned char b, unsigned char c,
00167 unsigned char d, unsigned char e, unsigned char f );
00168
00169 #undef GAN_COMP_TYPE
00170 #undef GAN_MAX2
00171 #undef GAN_MIN2
00172 #undef GAN_MAX3
00173 #undef GAN_MIN3
00174 #undef GAN_MAX4
00175 #undef GAN_MIN4
00176 #undef GAN_MAX5
00177 #undef GAN_MIN5
00178 #undef GAN_MAX6
00179 #undef GAN_MIN6
00180
00181
00182 #define GAN_COMP_TYPE int
00183 #define GAN_MAX2 gan_max2_i
00184 #define GAN_MIN2 gan_min2_i
00185 #define GAN_MAX3 gan_max3_i
00186 #define GAN_MIN3 gan_min3_i
00187 #define GAN_MAX4 gan_max4_i
00188 #define GAN_MIN4 gan_min4_i
00189 #define GAN_MAX5 gan_max5_i
00190 #define GAN_MIN5 gan_min5_i
00191 #define GAN_MAX6 gan_max6_i
00192 #define GAN_MIN6 gan_min6_i
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223 int gan_max2_i ( int a, int b );
00224 int gan_min2_i ( int a, int b );
00225 int gan_max3_i ( int a, int b, int c );
00226 int gan_min3_i ( int a, int b, int c );
00227 int gan_max4_i ( int a, int b,
00228 int c, int d );
00229 int gan_min4_i ( int a, int b,
00230 int c, int d );
00231 int gan_max5_i ( int a, int b, int c,
00232 int d, int e );
00233 int gan_min5_i ( int a, int b, int c,
00234 int d, int e );
00235 int gan_max6_i ( int a, int b, int c,
00236 int d, int e, int f );
00237 int gan_min6_i ( int a, int b, int c,
00238 int d, int e, int f );
00239
00240 #undef GAN_COMP_TYPE
00241 #undef GAN_MAX2
00242 #undef GAN_MIN2
00243 #undef GAN_MAX3
00244 #undef GAN_MIN3
00245 #undef GAN_MAX4
00246 #undef GAN_MIN4
00247 #undef GAN_MAX5
00248 #undef GAN_MIN5
00249 #undef GAN_MAX6
00250 #undef GAN_MIN6
00251
00252
00253 #define GAN_COMP_TYPE unsigned int
00254 #define GAN_MAX2 gan_max2_ui
00255 #define GAN_MIN2 gan_min2_ui
00256 #define GAN_MAX3 gan_max3_ui
00257 #define GAN_MIN3 gan_min3_ui
00258 #define GAN_MAX4 gan_max4_ui
00259 #define GAN_MIN4 gan_min4_ui
00260 #define GAN_MAX5 gan_max5_ui
00261 #define GAN_MIN5 gan_min5_ui
00262 #define GAN_MAX6 gan_max6_ui
00263 #define GAN_MIN6 gan_min6_ui
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294 unsigned int gan_max2_ui ( unsigned int a, unsigned int b );
00295 unsigned int gan_min2_ui ( unsigned int a, unsigned int b );
00296 unsigned int gan_max3_ui ( unsigned int a, unsigned int b, unsigned int c );
00297 unsigned int gan_min3_ui ( unsigned int a, unsigned int b, unsigned int c );
00298 unsigned int gan_max4_ui ( unsigned int a, unsigned int b,
00299 unsigned int c, unsigned int d );
00300 unsigned int gan_min4_ui ( unsigned int a, unsigned int b,
00301 unsigned int c, unsigned int d );
00302 unsigned int gan_max5_ui ( unsigned int a, unsigned int b, unsigned int c,
00303 unsigned int d, unsigned int e );
00304 unsigned int gan_min5_ui ( unsigned int a, unsigned int b, unsigned int c,
00305 unsigned int d, unsigned int e );
00306 unsigned int gan_max6_ui ( unsigned int a, unsigned int b, unsigned int c,
00307 unsigned int d, unsigned int e, unsigned int f );
00308 unsigned int gan_min6_ui ( unsigned int a, unsigned int b, unsigned int c,
00309 unsigned int d, unsigned int e, unsigned int f );
00310
00311 #undef GAN_COMP_TYPE
00312 #undef GAN_MAX2
00313 #undef GAN_MIN2
00314 #undef GAN_MAX3
00315 #undef GAN_MIN3
00316 #undef GAN_MAX4
00317 #undef GAN_MIN4
00318 #undef GAN_MAX5
00319 #undef GAN_MIN5
00320 #undef GAN_MAX6
00321 #undef GAN_MIN6
00322
00323
00324 #define GAN_COMP_TYPE long
00325 #define GAN_MAX2 gan_max2_l
00326 #define GAN_MIN2 gan_min2_l
00327 #define GAN_MAX3 gan_max3_l
00328 #define GAN_MIN3 gan_min3_l
00329 #define GAN_MAX4 gan_max4_l
00330 #define GAN_MIN4 gan_min4_l
00331 #define GAN_MAX5 gan_max5_l
00332 #define GAN_MIN5 gan_min5_l
00333 #define GAN_MAX6 gan_max6_l
00334 #define GAN_MIN6 gan_min6_l
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365 long gan_max2_l ( long a, long b );
00366 long gan_min2_l ( long a, long b );
00367 long gan_max3_l ( long a, long b, long c );
00368 long gan_min3_l ( long a, long b, long c );
00369 long gan_max4_l ( long a, long b,
00370 long c, long d );
00371 long gan_min4_l ( long a, long b,
00372 long c, long d );
00373 long gan_max5_l ( long a, long b, long c,
00374 long d, long e );
00375 long gan_min5_l ( long a, long b, long c,
00376 long d, long e );
00377 long gan_max6_l ( long a, long b, long c,
00378 long d, long e, long f );
00379 long gan_min6_l ( long a, long b, long c,
00380 long d, long e, long f );
00381
00382 #undef GAN_COMP_TYPE
00383 #undef GAN_MAX2
00384 #undef GAN_MIN2
00385 #undef GAN_MAX3
00386 #undef GAN_MIN3
00387 #undef GAN_MAX4
00388 #undef GAN_MIN4
00389 #undef GAN_MAX5
00390 #undef GAN_MIN5
00391 #undef GAN_MAX6
00392 #undef GAN_MIN6
00393
00394
00395 #define GAN_COMP_TYPE unsigned long
00396 #define GAN_MAX2 gan_max2_ul
00397 #define GAN_MIN2 gan_min2_ul
00398 #define GAN_MAX3 gan_max3_ul
00399 #define GAN_MIN3 gan_min3_ul
00400 #define GAN_MAX4 gan_max4_ul
00401 #define GAN_MIN4 gan_min4_ul
00402 #define GAN_MAX5 gan_max5_ul
00403 #define GAN_MIN5 gan_min5_ul
00404 #define GAN_MAX6 gan_max6_ul
00405 #define GAN_MIN6 gan_min6_ul
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436 unsigned long gan_max2_ul ( unsigned long a, unsigned long b );
00437 unsigned long gan_min2_ul ( unsigned long a, unsigned long b );
00438 unsigned long gan_max3_ul ( unsigned long a, unsigned long b, unsigned long c );
00439 unsigned long gan_min3_ul ( unsigned long a, unsigned long b, unsigned long c );
00440 unsigned long gan_max4_ul ( unsigned long a, unsigned long b,
00441 unsigned long c, unsigned long d );
00442 unsigned long gan_min4_ul ( unsigned long a, unsigned long b,
00443 unsigned long c, unsigned long d );
00444 unsigned long gan_max5_ul ( unsigned long a, unsigned long b, unsigned long c,
00445 unsigned long d, unsigned long e );
00446 unsigned long gan_min5_ul ( unsigned long a, unsigned long b, unsigned long c,
00447 unsigned long d, unsigned long e );
00448 unsigned long gan_max6_ul ( unsigned long a, unsigned long b, unsigned long c,
00449 unsigned long d, unsigned long e, unsigned long f );
00450 unsigned long gan_min6_ul ( unsigned long a, unsigned long b, unsigned long c,
00451 unsigned long d, unsigned long e, unsigned long f );
00452
00453 #undef GAN_COMP_TYPE
00454 #undef GAN_MAX2
00455 #undef GAN_MIN2
00456 #undef GAN_MAX3
00457 #undef GAN_MIN3
00458 #undef GAN_MAX4
00459 #undef GAN_MIN4
00460 #undef GAN_MAX5
00461 #undef GAN_MIN5
00462 #undef GAN_MAX6
00463 #undef GAN_MIN6
00464
00465
00466 #define GAN_COMP_TYPE double
00467 #define GAN_MAX2 gan_max2_d
00468 #define GAN_MIN2 gan_min2_d
00469 #define GAN_MAX3 gan_max3_d
00470 #define GAN_MIN3 gan_min3_d
00471 #define GAN_MAX4 gan_max4_d
00472 #define GAN_MIN4 gan_min4_d
00473 #define GAN_MAX5 gan_max5_d
00474 #define GAN_MIN5 gan_min5_d
00475 #define GAN_MAX6 gan_max6_d
00476 #define GAN_MIN6 gan_min6_d
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507 double gan_max2_d ( double a, double b );
00508 double gan_min2_d ( double a, double b );
00509 double gan_max3_d ( double a, double b, double c );
00510 double gan_min3_d ( double a, double b, double c );
00511 double gan_max4_d ( double a, double b,
00512 double c, double d );
00513 double gan_min4_d ( double a, double b,
00514 double c, double d );
00515 double gan_max5_d ( double a, double b, double c,
00516 double d, double e );
00517 double gan_min5_d ( double a, double b, double c,
00518 double d, double e );
00519 double gan_max6_d ( double a, double b, double c,
00520 double d, double e, double f );
00521 double gan_min6_d ( double a, double b, double c,
00522 double d, double e, double f );
00523
00524 #undef GAN_COMP_TYPE
00525 #undef GAN_MAX2
00526 #undef GAN_MIN2
00527 #undef GAN_MAX3
00528 #undef GAN_MIN3
00529 #undef GAN_MAX4
00530 #undef GAN_MIN4
00531 #undef GAN_MAX5
00532 #undef GAN_MIN5
00533 #undef GAN_MAX6
00534 #undef GAN_MIN6
00535
00536
00537 #define GAN_COMP_TYPE float
00538 #define GAN_MAX2 gan_max2_f
00539 #define GAN_MIN2 gan_min2_f
00540 #define GAN_MAX3 gan_max3_f
00541 #define GAN_MIN3 gan_min3_f
00542 #define GAN_MAX4 gan_max4_f
00543 #define GAN_MIN4 gan_min4_f
00544 #define GAN_MAX5 gan_max5_f
00545 #define GAN_MIN5 gan_min5_f
00546 #define GAN_MAX6 gan_max6_f
00547 #define GAN_MIN6 gan_min6_f
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578 float gan_max2_f ( float a, float b );
00579 float gan_min2_f ( float a, float b );
00580 float gan_max3_f ( float a, float b, float c );
00581 float gan_min3_f ( float a, float b, float c );
00582 float gan_max4_f ( float a, float b,
00583 float c, float d );
00584 float gan_min4_f ( float a, float b,
00585 float c, float d );
00586 float gan_max5_f ( float a, float b, float c,
00587 float d, float e );
00588 float gan_min5_f ( float a, float b, float c,
00589 float d, float e );
00590 float gan_max6_f ( float a, float b, float c,
00591 float d, float e, float f );
00592 float gan_min6_f ( float a, float b, float c,
00593 float d, float e, float f );
00594
00595 #undef GAN_COMP_TYPE
00596 #undef GAN_MAX2
00597 #undef GAN_MIN2
00598 #undef GAN_MAX3
00599 #undef GAN_MIN3
00600 #undef GAN_MAX4
00601 #undef GAN_MIN4
00602 #undef GAN_MAX5
00603 #undef GAN_MIN5
00604 #undef GAN_MAX6
00605 #undef GAN_MIN6
00606
00615 #ifdef __cplusplus
00616 }
00617 #endif
00618
00619 #endif