source: trunk/packages/optimizer/src/pgapack/pgapack/source/debug.c @ 1271

Last change on this file since 1271 was 1271, checked in by liveletlive, 15 years ago

Changes made to API and pgapack for addition of new stoppage criteria. TIMEElapsed criteria is not yet added.

File size: 64.3 KB
Line 
1/*
2 * 
3 *  *********************************************************************
4 *  (C) COPYRIGHT 1995 UNIVERSITY OF CHICAGO
5 *  *********************************************************************
6 * 
7 *  This software was authored by
8 * 
9 *  D. Levine
10 *  Mathematics and Computer Science Division Argonne National Laboratory
11 *  Argonne IL 60439
12 *  levine@mcs.anl.gov
13 *  (708) 252-6735
14 *  (708) 252-5986 (FAX)
15 * 
16 *  with programming assistance of participants in Argonne National
17 *  Laboratory's SERS program.
18 * 
19 *  This program contains material protectable under copyright laws of the
20 *  United States.  Permission is hereby granted to use it, reproduce it,
21 *  to translate it into another language, and to redistribute it to
22 *  others at no charge except a fee for transferring a copy, provided
23 *  that you conspicuously and appropriately publish on each copy the
24 *  University of Chicago's copyright notice, and the disclaimer of
25 *  warranty and Government license included below.  Further, permission
26 *  is hereby granted, subject to the same provisions, to modify a copy or
27 *  copies or any portion of it, and to distribute to others at no charge
28 *  materials containing or derived from the material.
29 * 
30 *  The developers of the software ask that you acknowledge its use in any
31 *  document referencing work based on the  program, such as published
32 *  research.  Also, they ask that you supply to Argonne National
33 *  Laboratory a copy of any published research referencing work based on
34 *  the software.
35 * 
36 *  Any entity desiring permission for further use must contact:
37 * 
38 *  J. Gleeson
39 *  Industrial Technology Development Center Argonne National Laboratory
40 *  Argonne IL 60439
41 *  gleesonj@smtplink.eid.anl.gov
42 *  (708) 252-6055
43 * 
44 *  ********************************************************************
45 *  DISCLAIMER
46 * 
47 *  THIS PROGRAM WAS PREPARED AS AN ACCOUNT OF WORK SPONSORED BY AN AGENCY
48 *  OF THE UNITED STATES GOVERNMENT.  NEITHER THE UNIVERSITY OF CHICAGO,
49 *  THE UNITED STATES GOVERNMENT NOR ANY OF THEIR EMPLOYEES MAKE ANY
50 *  WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR
51 *  RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY
52 *  INFORMATION OR PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT
53 *  INFRINGE PRIVATELY OWNED RIGHTS.
54 * 
55 *  **********************************************************************
56 *  GOVERNMENT LICENSE
57 * 
58 *  The Government is granted for itself and others acting on its behalf a
59 *  paid-up, non-exclusive, irrevocable worldwide license in this computer
60 *  software to reproduce, prepare derivative works, and perform publicly
61 *  and display publicly.
62 */
63
64/*****************************************************************************
65*     FILE: debug.c: This file contains routines for debugging
66*
67*     Authors: David M. Levine, Philip L. Hallstrom, David M. Noelle,
68*              Brian P. Walenz
69******************************************************************************/
70
71#include "pgapack.h"
72
73/******************************************************************************
74 We need two numbering schemes:
75
76   (1) A list of debug levels (numbers) the user types to get certain types
77       of prints
78   (2) A unique integer debug value for each routine
79
80 The way this works is that the user specified debug level, which we
81 arbitrarily restrict to be an integer between 1--100, is mapped to a
82 set of actual debug values which are in the range of 101--inf
83
84 Note that the set of debuglevels we define for the user are between 0--100,
85 and that all *real* values for a routine (each routine has a debug value
86 associated with it) are > 100 and < PGA_DEBUG_NUMFLAGS
87
88  0 Trace all debug prints
89
90  1 Reserved for the user
91    :                   :
92 10 Reserved for the user
93 11 Trace high-level functions
94 12 Trace all function entries
95 13 Trace all function exits
96
97 20 Trace high-level parallel functions
98 21 Trace all parallel functions
99 22 Trace all send calls (PGA_DEBUG_SEND)
100 23 Trace all receive calls (PGA_DEBUG_RECV)
101
102 30 Trace BINARY    functions
103 32 Trace INTEGER   functions
104 34 Trace REAL      functions
105 36 Trace CHARACTER functions
106
107 40 Trace population creation functions
108 42 Trace select functions
109 44 Trace mutation functions
110 46 Trace crossover functions
111 48 Trace function evaluation functions
112 50 Trace fitness calculation  functions
113 52 Trace duplicate checking functions
114 54 Trace restart functions
115 56 Trace reporting functions
116 58 Trace stopping functions
117 60 Trace sorting functions
118 62 Trace random number functions
119 64 Trace system routines
120 66 Trace utility functions
121
122 80 Trace memory allocations
123 82 Trace variable print statements
124******************************************************************************/
125
126#if OPTIMIZE==0
127typedef struct
128{
129        char    PGAFuncName[36];
130        int     PGAFuncNum;
131} PGAFuncRec;
132
133int        PGANumFcns;
134
135PGAFuncRec PGAFuncIndex[PGA_DEBUG_MAXPGAPACKFUNCTIONS] =
136{
137/* Binary Routines 100 - 149 */
138        { "PGABinaryCreateString",          100 },
139        { "PGABinaryMutation",              101 },
140        { "PGABinaryOneptCrossover",        102 },
141        { "PGABinaryTwoptCrossover",        103 },
142        { "PGABinaryUniformCrossover",      104 },
143        { "PGABinaryPrintString",           105 },
144        { "PGABinaryCopyString",            106 },
145        { "PGABinaryDuplicate",             107 },
146        { "PGABinaryInitString",            108 },
147        { "PGABinaryBuildDatatype",         109 },
148        { "PGASetBinaryAllele",             110 },
149        { "PGAGetBinaryAllele",             111 },
150        { "PGABinaryHammingDistance",       120 },
151        { "PGABinaryPrint",                 121 },
152        { "PGAGetBinaryInitProb",           122 },
153        { "PGASetBinaryInitProb",           123 },
154
155/* Integer Routines 150 - 199 */
156        { "PGAIntegerCreateString",         150 },
157        { "PGAIntegerMutation",             151 },
158        { "PGAIntegerOneptCrossover",       152 },
159        { "PGAIntegerTwoptCrossover",       153 },
160        { "PGAIntegerUniformCrossover",     154 },
161        { "PGAIntegerPrintString",          155 },
162        { "PGAIntegerCopyString",           156 },
163        { "PGAIntegerDuplicate",            157 },
164        { "PGAIntegerInitString",           158 },
165        { "PGAIntegerBuildDatatype",        159 },
166        { "PGASetIntegerAllele",            160 },
167        { "PGAGetIntegerAllele",            161 },
168        { "PGASetIntegerInitPermute",       170 },
169        { "PGASetIntegerInitRange",         171 },
170        { "PGAGetIntegerInitType",          172 },
171        { "PGAGetMinIntegerInitValue",      173 },
172        { "PGAGetMaxIntegerInitValue",      174 },
173
174/* Real Routines 200 - 249 */
175        { "PGARealCreateString",            200 },
176        { "PGARealMutation",                201 },
177        { "PGARealOneptCrossover",          202 },
178        { "PGARealTwoptCrossover",          203 },
179        { "PGARealUniformCrossover",        204 },
180        { "PGARealPrintString",             205 },
181        { "PGARealCopyString",              206 },
182        { "PGARealDuplicate",               207 },
183        { "PGARealInitString",              208 },
184        { "PGARealBuildDatatype",           209 },
185        { "PGASetRealAllele",               210 },
186        { "PGAGetRealAllele",               211 },
187        { "PGASetRealInitPercent",          220 },
188        { "PGASetRealInitRange",            221 },
189        { "PGAGetMinRealInitValue",         222 },
190        { "PGAGetMaxRealInitValue",         223 },
191
192/* Character Routines 250 - 299 */
193        { "PGACharacterCreateString",       250 },
194        { "PGACharacterMutation",           251 },
195        { "PGACharacterOneptCrossover",     252 },
196        { "PGACharacterTwoptCrossover",     253 },
197        { "PGACharacterUniformCrossover",   254 },
198        { "PGACharacterPrintString",        255 },
199        { "PGACharacterCopyString",         256 },
200        { "PGACharacterDuplicate",          257 },
201        { "PGACharacterInitString",         258 },
202        { "PGACharacterBuildDatatype",      259 },
203        { "PGASetCharacterAllele",          260 },
204        { "PGAGetCharacterAllele",          261 },
205        { "PGASetCharacterInitType",        270 },
206
207/* Operators Routines 300 - 499 */
208        /* create.c */
209        { "PGACreate",                      300 },
210        { "PGASetUp",                       301 },
211        { "PGACreatePop",                   302 },
212        { "PGACreateIndividual",            303 },
213        { "PGAGetRandomInitFlag",           304 },
214        { "PGASetRandomInitFlag",           305 },
215
216        /* cross.c */
217        { "PGACrossover",                   310 },
218        { "PGAGetCrossoverType",            311 },
219        { "PGAGetCrossoverProb",            312 },
220        { "PGAGetUniformCrossoverProb",     313 },
221        { "PGASetCrossoverType",            314 },
222        { "PGASetCrossoverProb",            315 },
223        { "PGASetUniformCrossoverProb",     316 },
224
225        /* pop.c */
226        { "PGASortPop",                     320 },
227        { "PGAGetPopSize",                  321 },
228        { "PGAGetNumReplaceValue",          322 },
229        { "PGAGetPopReplaceType",           323 },
230        { "PGAGetSortedPopIndex",           324 },
231        { "PGASetPopSize",                  325 },
232        { "PGASetNumReplaceValue",          326 },
233        { "PGASetPopReplaceType",           327 },
234
235        /* mutation.c */
236        { "PGAMutate",                      330 },
237        { "PGAGetMutationType",             331 },
238        { "PGAGetMutationRealValue",        332 },
239        { "PGAGetMutationIntegerValue",     333 },
240        { "PGAGetMutationProb",             334 },
241        { "PGASetMutationType",             335 },
242        { "PGASetMutationRealValue",        336 },
243        { "PGASetMutationIntegerValue",     337 },
244        { "PGASetMutationProb",             338 },
245        { "PGASetMutationBoundedFlag",      400 },  /* 400--499 */
246        { "PGAGetMutationBoundedFlag",      401 },  /* 400--499 */
247
248        /* duplcate.c */
249        { "PGADuplicate",                   340 },
250        { "PGAChange",                      341 },
251        { "PGASetNoDuplicatesFlag",         342 },
252        { "PGAGetNoDuplicatesFlag",         343 },
253
254        /* pga.c */
255        { "PGARunMutationAndCrossover",     350 },
256        { "PGARunMutationOrCrossover",      351 },
257        { "PGAUpdateGeneration",            352 },
258        { "PGAGetDataType",                 353 },
259        { "PGAGetOptDirFlag",               354 },
260        { "PGAGetStringLength",             355 },
261        { "PGAGetGAIterValue",              356 },
262        { "PGAGetMutationOrCrossoverFlag",  357 },
263        { "PGAGetMutationAndCrossoverFlag", 358 },
264        { "PGASetMutationOrCrossoverFlag",  359 },
265        { "PGASetMutationAndCrossoverFlag", 360 },
266        { "PGARun",                         361 },
267
268        /* restart.c */
269        { "PGARestart",                     370 },
270        { "PGAGetRestartFlag",              371 },
271        { "PGAGetRestartFrequencyValue",    372 },
272        { "PGAGetRestartAlleleChangeProb",  373 },
273        { "PGASetRestartFlag",              374 },
274        { "PGASetRestartFrequencyValue",    375 },
275        { "PGASetRestartAlleleChangeProb",  376 },
276
277        /* select.c */
278        { "PGASelect",                      380 },
279        { "PGASelectProportional",          381 },
280        { "PGASelectSUS",                   382 },
281        { "PGASelectTournament",            383 },
282        { "PGASelectPTournament",           384 },
283        { "PGASelectNextIndex",             385 },
284        { "PGAGetSelectType",               386 },
285        { "PGAGetPTournamentProb",          387 },
286        { "PGASetSelectType",               388 },
287        { "PGASetPTournamentProb",          389 },
288
289        /* stop.c */
290        { "PGAGetStoppingRuleType",         390 },
291        { "PGASetStoppingRuleType",         391 },
292        { "PGAGetMaxGAIterValue",           392 },
293        { "PGASetMaxGAIterValue",           393 },
294        { "PGACheckStoppingConditions",     394 },
295        { "PGASetMaxNoChangeValue",         395 },
296        { "PGASetMaxSimilarityValue",       396 },
297        { "PGASetTgtFitnessVal",                        398 },
298        { "PGASetFitnessTol",                           399 },
299        { "PGASetTgtFitnessVariance",           400 },
300        { "PGASetVarTol",                                       401 },
301        { "PGASetTgtElapsedTime",                       402 },
302        { "PGADone",                        397 },
303
304/* Fitness and Evaluation Routines 500 - 599 */
305        /* evaluate.c */
306        { "PGAGetRealFromBinary",           500 },
307        { "PGAGetRealFromGrayCode",         501 },
308        { "PGAEncodeRealAsBinary",          502 },
309        { "PGAEncodeRealAsGrayCode",        503 },
310        { "PGAMapIntegerToReal",            504 },
311        { "PGAMapRealToInteger",            505 },
312        { "PGAEncodeIntegerAsBinary",       506 },
313        { "PGAEncodeIntegerAsGrayCode",     507 },
314        { "PGAGetIntegerFromBinary",        508 },
315        { "PGAGetIntegerFromGrayCode",      509 },
316        { "PGAEvaluate",                    510 },
317        { "PGAEvaluateSeq",                 515 },
318        { "PGAEvaluateCoop",                516 },
319        { "PGAEvaluateSlave",               517 },
320        { "PGASetEvaluation",               511 },
321        { "PGASetEvaluationUpToDateFlag",   512 },
322        { "PGAGetEvaluation",               513 },
323        { "PGAGetEvaluationUpToDateFlag",   514 },
324
325        /* fitness.c */
326        { "PGAFitness",                     520 },
327        { "PGAFitnessLinearNormal",         521 },
328        { "PGAFitnessLinearRank",           522 },
329        { "PGAFitnessMinReciprocal",        523 },
330        { "PGAFitnessMinCmax",              524 },
331        { "PGARank",                        525 },
332        { "PGAGetFitness",                  526 },
333        { "PGAGetFitnessType",              527 },
334        { "PGAGetFitnessMinType",           528 },
335        { "PGAGetMaxFitnessRank",           529 },
336        { "PGASetFitnessType",              530 },
337        { "PGASetFitnessMinType",           531 },
338        { "PGASetMaxFitnessRank",           532 },
339        { "PGASetFitnessCmaxValue",         533 },
340        { "PGAGetFitnessCmaxValue",         534 },
341
342/* Parallel Routines 600 - 699 */
343        { "PGABuildDatatype",               600 },
344        { "PGASendIndividual",              601 },
345        { "PGAReceiveIndividual",           602 },
346        { "PGASendReceiveIndividual",       603 },
347        { "PGAEvaluateMS",                  605 },
348        { "PGAGetRank",                     607 },
349        { "PGAGetNumProcs",                 608 },
350        { "PGASetCommunicator",             609 },
351        { "PGAGetCommunicator",             610 },
352        { "PGASetNumIslands",               611 },
353        { "PGAGetNumIslands",               612 },
354        { "PGASetNumDemes",                 613 },
355        { "PGAGetNumDemes",                 614 },
356        { "PGARunGM",                       615 },
357        { "PGARunIM",                       616 },
358        { "PGARunNM",                       617 },
359
360/* System and Utility 700 - 799 */
361        /* system.c */
362        { "PGAError",                       700 },
363        { "PGAUsage",                       702 },
364        { "PGAPrintVersionNumber",          703 },
365        { "PGAGetMaxMachineIntValue",       704 },
366        { "PGAGetMinMachineIntValue",       705 },
367        { "PGAGetMaxMachineDoubleValue",    706 },
368        { "PGAGetMinMachineDoubleValue",    707 },
369        { "PGADestroy",                     708 },
370
371        /* utility.c */
372        { "PGAMean",                        710 },
373        { "PGAStddev",                      711 },
374        { "PGACopyIndividual",              712 },
375        { "PGARound",                       713 },
376        { "PGACheckSum",                    714 },
377        { "PGAGetWorstIndex",               715 },
378        { "PGAGetBestIndex",                716 },
379        { "PGAGetIndividual",               717 },
380        { "PGAUpdateAverage",               718 },
381        { "PGAUpdateOnline",                719 },
382        { "PGAUpdateOffline",               720 },
383        { "PGAComputeSimilarity",           721 },
384
385        /* cmdline.c */
386        { "PGAReadCmdLine",                 730 },
387        { "PGAParseDebugArg",               731 },
388        { "PGAStripArgs",                   732 },
389
390        /* debug.c */
391        { "PGADebugPrint",                  740 },
392        { "PGAGetDebugFlag",                741 },
393        { "PGAPrintDebugOptions",           743 },
394        { "PGASetDebugLevel",               744 },
395
396        /* random.c */
397        { "PGARandomFlip",                  750 },
398        { "PGARandomInterval",              751 },
399        { "PGARandom01",                    752 },
400        { "PGARandomUniform",               753 },
401        { "PGARandomGaussian",              754 },
402        { "PGAGetRandomSeed",               755 },
403        { "PGASetRandomSeed",               756 },
404
405/* Miscellaneous Routines 800 - 899 */
406        /* hamming.c */
407        { "PGAHammingDistance",             800 },
408
409        /* heap.c */
410        { "PGADblHeapSort",                 810 },
411        { "PGADblHeapify",                  811 },
412        { "PGADblAdjustHeap",               812 },
413        { "PGAIntHeapSort",                 813 },
414        { "PGAIntHeapify",                  814 },
415        { "PGAIntAdjustHeap",               815 },
416
417        /* report.c */
418        { "PGAPrintPopulation",             820 },
419        { "PGAPrintIndividual",             821 },
420        { "PGAPrintReport",                 822 },
421        { "PGAPrintContextVariable",        823 },
422        { "PGAPrintString",                 824 },
423        { "PGAGetPrintFrequencyValue",      825 },
424        { "PGASetPrintFrequencyValue",      826 },
425        { "PGASetPrintOptions",             827 },
426
427        /* user.c */
428        { "PGASetUserFunction",             830 }
429};
430
431
432/*I****************************************************************************
433   PGASortDebugIndex - Sort the index of function names alphabetically.
434
435   Inputs:
436
437   Output:
438
439   Example:
440
441****************************************************************************I*/
442void PGASortFuncNameIndex(PGAContext *ctx)
443{
444
445    /*  See how many functions are in the index */
446    for (PGANumFcns=0; PGAFuncIndex[PGANumFcns].PGAFuncName[0]; PGANumFcns++) ;
447
448    qsort(PGAFuncIndex, PGANumFcns, sizeof(PGAFuncRec),
449          (int (*) (const void *, const void *)) &strcmp);
450}
451
452
453/*U****************************************************************************
454  PGADebugPrint - Write debugging information
455
456  Category: Debugging
457
458  Inputs:
459     ctx       - context variable
460     level     - a symbolic constant that maps to the type of print requested
461                 (e.g., an entry or exit print).  Valid values are
462                 PGA_DEBUG_ENTERED, PGA_DEBUG_EXIT, PGA_DEBUG_MALLOC,
463                 PGA_DEBUG_PRINTVAR, PGA_DEBUG_SEND, and PGA_DEBUG_RECV.
464     funcname  - the name of the function that called this routine
465     msg       - message to print
466     datatype  - a symbolic constant that maps to the data type of the
467                 parameter data.  Valid choices are PGA_INT, PGA_DOUBLE,
468                 PGA_CHAR and PGA_VOID (no data).
469     data      - a pointer, whose contents will be interpreted based upon the
470                 datatype parameter (or NULL, if PGA_VOID).
471
472  Outputs:
473     The debugging information is printed to stderr.
474
475  Example:
476     If the debugging level includes printing variables (level 82), print the
477     value of the integer variable num as a debugging tool in the routine
478     Add2Nums
479
480     PGAContext *ctx;
481     int num;
482     :
483     PGADebugPrint(ctx, PGA_DEBUG_PRINTVAR, "Add2Nums", "num = ", PGA_INT,
484                   (void *) &num);
485
486****************************************************************************U*/
487void PGADebugPrint( PGAContext *ctx, int level, char *funcname,
488                   char *msg, int datatype, void *data )
489{
490     int rank;
491
492     /*  Added check if level > 10 so that PGAGetDebugFlag is only called
493      *  if it is _not_ a user debug level.
494      */
495
496     if (ctx->debug.PGADebugFlags[0]     ||
497         ctx->debug.PGADebugFlags[level] ||
498         ((level > 10) && PGAGetDebugFlag (ctx, funcname)))
499     {
500          MPI_Comm_rank(MPI_COMM_WORLD, &rank);
501          switch (datatype)
502          {
503          case PGA_VOID:
504               fprintf(stdout, "%4d: %-32s: %s\n", rank, funcname, msg);
505               break;
506          case PGA_INT:
507               switch (*(int *) data)
508               {
509               case PGA_TEMP1:
510                    fprintf(stdout, "%4d: %-32s: %s PGA_TEMP1\n", rank,
511                            funcname, msg);
512                    break;
513               case PGA_TEMP2:
514                    fprintf(stdout, "%4d: %-32s: %s PGA_TEMP2\n", rank,
515                            funcname, msg);
516                    break;
517               case PGA_OLDPOP:
518                    fprintf(stdout, "%4d: %-32s: %s PGA_OLDPOP\n", rank,
519                            funcname, msg);
520                    break;
521               case PGA_NEWPOP:
522                    fprintf(stdout, "%4d: %-32s: %s PGA_NEWPOP\n", rank,
523                            funcname, msg);
524                    break;
525               default:
526                    fprintf(stdout, "%4d: %-32s: %s %d\n", rank, funcname, msg,
527                            *(int *) data);
528                    break;
529               }
530               break;
531          case PGA_DOUBLE:
532               fprintf(stdout, "%4d: %-32s: %s %e\n", rank,
533                       funcname, msg, *(double *) data);
534               break;
535          case PGA_CHAR:
536               fprintf(stdout, "%4d: %-32s: %s %s\n", rank,
537                       funcname, msg,  (char *) data);
538               break;
539          default:
540               fprintf(stderr, "PGADebugPrint: Invalid value of datatype: %d",
541                       datatype);
542               exit(-1);
543               break;
544          }
545     }
546}
547
548/*U****************************************************************************
549   PGASetDebugLevel - Turn on a debug level.  Only valid if PGAPack
550   was compiled to include debugging calls.  See the user guide for details.
551
552   Category: Debugging
553
554   Inputs:
555      ctx   - context variable
556      level - the debug level to set to PGA_TRUE.
557
558   Outputs:
559      None
560
561   Example:
562      PGAContext *ctx;
563      :
564      PGASetDebugLevel(ctx, 70)
565
566****************************************************************************U*/
567void PGASetDebugLevel(PGAContext *ctx, int level)
568{
569    if ((level < 11) || (level > 100)) {
570        ctx->debug.PGADebugFlags[level] = PGA_TRUE;
571    } else {
572        /*  Call the appropriate routine to clear the set of levels.  */
573        switch (level) {
574        case 11:  PGASetDebugFlag11(ctx, PGA_TRUE); break;
575        case 20:  PGASetDebugFlag20(ctx, PGA_TRUE); break;
576        case 21:  PGASetDebugFlag21(ctx, PGA_TRUE); break;
577        case 30:  PGASetDebugFlag30(ctx, PGA_TRUE); break;
578        case 32:  PGASetDebugFlag32(ctx, PGA_TRUE); break;
579        case 34:  PGASetDebugFlag34(ctx, PGA_TRUE); break;
580        case 36:  PGASetDebugFlag36(ctx, PGA_TRUE); break;
581        case 40:  PGASetDebugFlag40(ctx, PGA_TRUE); break;
582        case 42:  PGASetDebugFlag42(ctx, PGA_TRUE); break;
583        case 44:  PGASetDebugFlag44(ctx, PGA_TRUE); break;
584        case 46:  PGASetDebugFlag46(ctx, PGA_TRUE); break;
585        case 48:  PGASetDebugFlag48(ctx, PGA_TRUE); break;
586        case 50:  PGASetDebugFlag50(ctx, PGA_TRUE); break;
587        case 52:  PGASetDebugFlag52(ctx, PGA_TRUE); break;
588        case 54:  PGASetDebugFlag54(ctx, PGA_TRUE); break;
589        case 56:  PGASetDebugFlag56(ctx, PGA_TRUE); break;
590        case 58:  PGASetDebugFlag58(ctx, PGA_TRUE); break;
591        case 60:  PGASetDebugFlag60(ctx, PGA_TRUE); break;
592        case 62:  PGASetDebugFlag62(ctx, PGA_TRUE); break;
593        case 64:  PGASetDebugFlag64(ctx, PGA_TRUE); break;
594        case 66:  PGASetDebugFlag66(ctx, PGA_TRUE); break;
595        }
596    }
597}
598
599/*U****************************************************************************
600   PGAClearDebugLevel - Turn off a debul level.  Only valid if PGAPack
601   was compiled to include debugging calls.  See the user guide for details.
602
603   Category: Debugging
604
605   Inputs:
606      ctx   - context variable
607      level - the debug level to set to PGA_FALSE.
608
609   Outputs:
610      None
611
612   Example:
613      PGAContext *ctx;
614      :
615      PGAClearDebugLevel(ctx, 70)
616
617****************************************************************************U*/
618void PGAClearDebugLevel(PGAContext *ctx, int level)
619{
620    if ((level < 11) || (level > 100)) {
621        ctx->debug.PGADebugFlags[level] = PGA_FALSE;
622    } else {
623        /*  Call the appropriate routine to clear the set of levels.  */
624        switch (level) {
625        case 11:  PGASetDebugFlag11(ctx, PGA_FALSE); break;
626        case 20:  PGASetDebugFlag20(ctx, PGA_FALSE); break;
627        case 21:  PGASetDebugFlag21(ctx, PGA_FALSE); break;
628        case 30:  PGASetDebugFlag30(ctx, PGA_FALSE); break;
629        case 32:  PGASetDebugFlag32(ctx, PGA_FALSE); break;
630        case 34:  PGASetDebugFlag34(ctx, PGA_FALSE); break;
631        case 36:  PGASetDebugFlag36(ctx, PGA_FALSE); break;
632        case 40:  PGASetDebugFlag40(ctx, PGA_FALSE); break;
633        case 42:  PGASetDebugFlag42(ctx, PGA_FALSE); break;
634        case 44:  PGASetDebugFlag44(ctx, PGA_FALSE); break;
635        case 46:  PGASetDebugFlag46(ctx, PGA_FALSE); break;
636        case 48:  PGASetDebugFlag48(ctx, PGA_FALSE); break;
637        case 50:  PGASetDebugFlag50(ctx, PGA_FALSE); break;
638        case 52:  PGASetDebugFlag52(ctx, PGA_FALSE); break;
639        case 54:  PGASetDebugFlag54(ctx, PGA_FALSE); break;
640        case 56:  PGASetDebugFlag56(ctx, PGA_FALSE); break;
641        case 58:  PGASetDebugFlag58(ctx, PGA_FALSE); break;
642        case 60:  PGASetDebugFlag60(ctx, PGA_FALSE); break;
643        case 62:  PGASetDebugFlag62(ctx, PGA_FALSE); break;
644        case 64:  PGASetDebugFlag64(ctx, PGA_FALSE); break;
645        case 66:  PGASetDebugFlag66(ctx, PGA_FALSE); break;
646        }
647    }
648}
649
650/*U****************************************************************************
651   PGASetDebugLevelByName - Turn on debugging of the named function.
652
653   Category: Debugging
654
655   Inputs:
656       ctx        - context variable
657       funcname   - name of the function to turn on debugging output
658
659   Outputs:
660
661   Example:
662       PGAContext *ctx;
663       :
664       PGASetDebugLevelByName(ctx, "PGAGetBinaryAllele");
665
666****************************************************************************U*/
667void PGASetDebugLevelByName(PGAContext *ctx, char *funcname)
668{
669    int  level;
670
671    level = PGAGetDebugLevelOfName(ctx, funcname);
672    ctx->debug.PGADebugFlags[level] = PGA_TRUE;
673}
674
675/*U****************************************************************************
676   PGAClearDebugLevelByName - Turn off debugging of the named function.
677
678   Category: Debugging
679
680   Inputs:
681       ctx        - context variable
682       funcname   - name of the function to turn on debugging output
683
684   Outputs:
685
686   Example:
687       PGAContext *ctx;
688       :
689       PGAClearDebugLevelByName(ctx, "PGAGetBinaryAllele");
690
691****************************************************************************U*/
692void PGAClearDebugLevelByName(PGAContext *ctx, char *funcname)
693{
694    int  level;
695
696    level = PGAGetDebugLevelOfName(ctx, funcname);
697    ctx->debug.PGADebugFlags[level] = PGA_FALSE;
698}
699
700
701/*I****************************************************************************
702   PGAGetDebugLevelOfName - returns the debug level of the named function
703   Internally, it performs a binary search on the run-time sorted list of
704   fucntions in PGAFuncIndex.
705
706   Inputs:
707       ctx       - context variable
708       funcname  - the name of the function
709
710   Outputs:
711       The debug level value of the function.  That is, PGAFuncNum associated
712       with funcname in PGAFuncIndex.
713
714   Example:
715
716
717****************************************************************************I*/
718int PGAGetDebugLevelOfName(PGAContext *ctx, char *funcname)
719{
720    int     l, h;
721    int     m, missing;
722
723    /*  Binary Search  */
724    l = 0;
725    h = PGANumFcns-1;
726    while (l <= h) {
727        m = (l+h)/2 + (l+h)%2;  /*  Actually, floor((l+h)/2)  */
728        missing = strcmp(funcname, PGAFuncIndex[m].PGAFuncName);
729
730        if (missing == 0) {
731            break;
732        } else {
733            if (missing < 0) {
734                h = m - 1;
735            } else {
736                l = m + 1;
737            }
738        }
739    }
740
741    if (missing) {
742        fprintf(stderr, "PGAGetDebugFlag: Function missing from "
743                "PGAFuncIndex: '%s'\n", funcname);
744        PGADestroy(ctx);
745        exit(-1);
746    }
747
748    return(PGAFuncIndex[m].PGAFuncNum);
749}
750
751/*I****************************************************************************
752  PGAGetDebugFlag - checks whether the flag to do a debug print in routine
753  funcname has been set.  Returns PGA_TRUE if so, otherwise PGA_FALSE.
754  If the name is not in the function name database, an error message is
755  printed and the program terminates.
756
757  Inputs:
758     ctx      - context variable
759     funcname - name of the function in question
760
761  Outputs:
762
763  Example:
764     PGAContext *ctx;
765     int IsItSet;
766
767     IsItSet = PGAGetDebugFlag(ctx, "PGAGetDebugFlags");
768
769****************************************************************************I*/
770int PGAGetDebugFlag(PGAContext *ctx, char *funcname)
771{
772     int level;
773
774     level = PGAGetDebugLevelOfName(ctx, funcname);
775     return ctx->debug.PGADebugFlags[level];
776}
777
778
779/*I****************************************************************************
780   PGASetDebugFlag11 - Set the debug flags for all functions at debug level 11
781
782   Inputs:
783       ctx  - Context variable
784       Flag - PGA_TRUE to enable or PGA_FALSE to disable
785
786   Outputs:
787
788   Example:
789
790****************************************************************************I*/
791void PGASetDebugFlag11(PGAContext *ctx, int Flag)
792{
793   ctx->debug.PGADebugFlags[300] = Flag; /*PGACreate*/
794   ctx->debug.PGADebugFlags[301] = Flag; /*PGASetUp*/
795   ctx->debug.PGADebugFlags[304] = Flag; /*PGAGetRandomInitFlag*/
796   ctx->debug.PGADebugFlags[305] = Flag; /*PGASetRandomInitFlag*/
797
798   ctx->debug.PGADebugFlags[310] = Flag; /*PGACrossover*/
799   ctx->debug.PGADebugFlags[311] = Flag; /*PGAGetCrossoverType*/
800   ctx->debug.PGADebugFlags[312] = Flag; /*PGAGetCrossoverProb*/
801   ctx->debug.PGADebugFlags[313] = Flag; /*PGAGetUniformCrossoverProb*/
802   ctx->debug.PGADebugFlags[314] = Flag; /*PGASetCrossoverType*/
803   ctx->debug.PGADebugFlags[315] = Flag; /*PGASetCrossoverProb*/
804   ctx->debug.PGADebugFlags[316] = Flag; /*PGASetUniformCrossoverProb*/
805
806   ctx->debug.PGADebugFlags[320] = Flag; /*PGASort*/
807   ctx->debug.PGADebugFlags[321] = Flag; /*PGAGetPopSize*/
808   ctx->debug.PGADebugFlags[322] = Flag; /*PGAGetNumReplaceValue*/
809   ctx->debug.PGADebugFlags[323] = Flag; /*PGAGetPopReplaceType*/
810   ctx->debug.PGADebugFlags[325] = Flag; /*PGASetPopSize*/
811   ctx->debug.PGADebugFlags[326] = Flag; /*PGASetNumReplaceValue*/
812   ctx->debug.PGADebugFlags[327] = Flag; /*PGASetPopReplaceType*/
813
814   ctx->debug.PGADebugFlags[330] = Flag; /*PGAMutate*/
815   ctx->debug.PGADebugFlags[331] = Flag; /*PGAGetMutationType*/
816   ctx->debug.PGADebugFlags[332] = Flag; /*PGAGetMutationRealValue*/
817   ctx->debug.PGADebugFlags[333] = Flag; /*PGAGetMutationIntegerValue*/
818   ctx->debug.PGADebugFlags[334] = Flag; /*PGAGetMutationProb*/
819   ctx->debug.PGADebugFlags[335] = Flag; /*PGASetMutationType*/
820   ctx->debug.PGADebugFlags[336] = Flag; /*PGASetMutationRealValue*/
821   ctx->debug.PGADebugFlags[337] = Flag; /*PGASetMutationIntegerValue*/
822   ctx->debug.PGADebugFlags[338] = Flag; /*PGASetMutationProb*/
823   ctx->debug.PGADebugFlags[400] = Flag; /*PGASetMutationBoundedFlag*/
824   ctx->debug.PGADebugFlags[401] = Flag; /*PGAGetMutationBoundedFlag*/
825
826   ctx->debug.PGADebugFlags[340] = Flag; /*PGADuplicate*/
827   ctx->debug.PGADebugFlags[341] = Flag; /*PGAChange*/
828   ctx->debug.PGADebugFlags[342] = Flag; /*PGASetNoDuplicatesFlag*/
829   ctx->debug.PGADebugFlags[343] = Flag; /*PGAGetNoDuplicatesFlag*/
830
831   ctx->debug.PGADebugFlags[350] = Flag; /*PGARunMutationAndCrossover*/
832   ctx->debug.PGADebugFlags[351] = Flag; /*PGARunMutationOrCrossover*/
833   ctx->debug.PGADebugFlags[352] = Flag; /*PGAUpdateGeneration*/
834   ctx->debug.PGADebugFlags[353] = Flag; /*PGAGetDataType*/
835   ctx->debug.PGADebugFlags[354] = Flag; /*PGAGetOptDirFlag*/
836   ctx->debug.PGADebugFlags[355] = Flag; /*PGAGetStringLength*/
837   ctx->debug.PGADebugFlags[356] = Flag; /*PGAGetGAIterValue*/
838   ctx->debug.PGADebugFlags[357] = Flag; /*PGAGetMutationOrCrossoverFlag*/
839   ctx->debug.PGADebugFlags[358] = Flag; /*PGAGetMutationAndCrossoverFlag*/
840   ctx->debug.PGADebugFlags[359] = Flag; /*PGASetMutationOrCrossoverFlag*/
841   ctx->debug.PGADebugFlags[360] = Flag; /*PGASetMutationAndCrossoverFlag*/
842   ctx->debug.PGADebugFlags[361] = Flag; /*PGARun*/
843
844   ctx->debug.PGADebugFlags[370] = Flag; /*PGARestart*/
845   ctx->debug.PGADebugFlags[371] = Flag; /*PGAGetRestartFlag*/
846   ctx->debug.PGADebugFlags[372] = Flag; /*PGAGetRestartFrequencyValue*/
847   ctx->debug.PGADebugFlags[373] = Flag; /*PGAGetRestartAlleleChangeProb*/
848   ctx->debug.PGADebugFlags[374] = Flag; /*PGASetRestartFlag*/
849   ctx->debug.PGADebugFlags[375] = Flag; /*PGASetRestartFrequencyValue*/
850   ctx->debug.PGADebugFlags[376] = Flag; /*PGASetRestartAlleleChangeProb*/
851
852   ctx->debug.PGADebugFlags[380] = Flag; /*PGASelect*/
853   ctx->debug.PGADebugFlags[386] = Flag; /*PGAGetSelectType*/
854   ctx->debug.PGADebugFlags[387] = Flag; /*PGAGetPTournamentProb*/
855   ctx->debug.PGADebugFlags[388] = Flag; /*PGASetSelectType*/
856   ctx->debug.PGADebugFlags[389] = Flag; /*PGASetPTournamentProb*/
857
858   ctx->debug.PGADebugFlags[390] = Flag; /*PGAGetStoppingRuleType*/
859   ctx->debug.PGADebugFlags[391] = Flag; /*PGASetStoppingRuleType*/
860   ctx->debug.PGADebugFlags[392] = Flag; /*PGAGetMaxGAIterValue*/
861   ctx->debug.PGADebugFlags[393] = Flag; /*PGASetMaxGAIterValue*/
862   ctx->debug.PGADebugFlags[394] = Flag; /*PGACheckStoppingConditions*/
863   ctx->debug.PGADebugFlags[395] = Flag; /*PGASetMaxNoChangeValue*/
864   ctx->debug.PGADebugFlags[396] = Flag; /*PGASetMaxSimilarityValue*/
865   ctx->debug.PGADebugFlags[397] = Flag; /*PGADone*/
866
867   ctx->debug.PGADebugFlags[510] = Flag; /*PGAEvaluate*/
868
869   ctx->debug.PGADebugFlags[520] = Flag; /*PGAFitness*/
870   ctx->debug.PGADebugFlags[527] = Flag; /*PGAGetFitnessType*/
871   ctx->debug.PGADebugFlags[528] = Flag; /*PGAGetFitnessMinType*/
872   ctx->debug.PGADebugFlags[529] = Flag; /*PGAGetMaxFitnessRank*/
873   ctx->debug.PGADebugFlags[530] = Flag; /*PGASetFitnessType*/
874   ctx->debug.PGADebugFlags[531] = Flag; /*PGASetFitnessMinType*/
875   ctx->debug.PGADebugFlags[532] = Flag; /*PGASetMaxFitnessRank*/
876   ctx->debug.PGADebugFlags[533] = Flag; /*PGASetFitnessCmaxValue*/
877   ctx->debug.PGADebugFlags[534] = Flag; /*PGAGetFitnessCmaxValue*/
878
879   ctx->debug.PGADebugFlags[604] = Flag; /*PGARunMS*/
880   ctx->debug.PGADebugFlags[605] = Flag; /*PGAEvaluateMS*/
881   ctx->debug.PGADebugFlags[606] = Flag; /*PGAEvaluateDoneMS*/
882   ctx->debug.PGADebugFlags[607] = Flag; /*PGAGetRank*/
883   ctx->debug.PGADebugFlags[608] = Flag; /*PGAGetNumProcs*/
884   ctx->debug.PGADebugFlags[609] = Flag; /*PGASetCommunicator*/
885   ctx->debug.PGADebugFlags[610] = Flag; /*PGAGetCommunicator*/
886   ctx->debug.PGADebugFlags[611] = Flag; /*PGASetNumIslands*/
887   ctx->debug.PGADebugFlags[612] = Flag; /*PGAGetNumIslands*/
888   ctx->debug.PGADebugFlags[613] = Flag; /*PGASetNumDemes*/
889   ctx->debug.PGADebugFlags[614] = Flag; /*PGAGetNumDemes*/
890   ctx->debug.PGADebugFlags[615] = Flag; /*PGARunSeq*/
891   ctx->debug.PGADebugFlags[616] = Flag; /*PGARunIM*/
892   ctx->debug.PGADebugFlags[617] = Flag; /*PGARunNM*/
893
894   ctx->debug.PGADebugFlags[700] = Flag; /*PGAError*/
895   ctx->debug.PGADebugFlags[702] = Flag; /*PGAUsage*/
896   ctx->debug.PGADebugFlags[703] = Flag; /*PGAPrintVersionNumber*/
897   ctx->debug.PGADebugFlags[704] = Flag; /*PGAGetMaxMachineIntValue*/
898   ctx->debug.PGADebugFlags[705] = Flag; /*PGAGetMinMachineIntValue*/
899   ctx->debug.PGADebugFlags[706] = Flag; /*PGAGetMaxMachineRealValue*/
900   ctx->debug.PGADebugFlags[707] = Flag; /*PGAGetMinMachineRealValue*/
901   ctx->debug.PGADebugFlags[708] = Flag; /*PGADestroy*/
902
903   ctx->debug.PGADebugFlags[741] = Flag; /*PGAGetDebugFlag*/
904   ctx->debug.PGADebugFlags[742] = Flag; /*PGASetDebugFlag*/
905   ctx->debug.PGADebugFlags[743] = Flag; /*PGAPrintDebugOptions*/
906
907   ctx->debug.PGADebugFlags[800] = Flag; /*PGAHammingDistance*/
908
909   ctx->debug.PGADebugFlags[820] = Flag; /*PGAPrintPopulation*/
910   ctx->debug.PGADebugFlags[822] = Flag; /*PGAPrintReport*/
911   ctx->debug.PGADebugFlags[823] = Flag; /*PGAContextVariable*/
912   ctx->debug.PGADebugFlags[825] = Flag; /*PGAGetPrintFrequencyValue*/
913   ctx->debug.PGADebugFlags[826] = Flag; /*PGASetPrintFrequencyValue*/
914   ctx->debug.PGADebugFlags[827] = Flag; /*PGASetPrintOptions*/
915
916   ctx->debug.PGADebugFlags[830] = Flag; /*PGASetUserFunction*/
917}
918
919/*I****************************************************************************
920   PGASetDebugFlag20 - Set the debug flags for all functions at debug level 20
921
922   Inputs:
923       ctx  - Context variable
924       Flag - PGA_TRUE to enable or PGA_FALSE to disable
925
926   Outputs:
927
928   Example:
929
930****************************************************************************I*/
931void PGASetDebugFlag20(PGAContext *ctx, int Flag)
932{
933   ctx->debug.PGADebugFlags[604] = Flag; /*PGARunMS*/
934   ctx->debug.PGADebugFlags[605] = Flag; /*PGAEvaluateMS*/
935   ctx->debug.PGADebugFlags[606] = Flag; /*PGAEvaluateDoneMS*/
936   ctx->debug.PGADebugFlags[607] = Flag; /*PGAGetRank*/
937   ctx->debug.PGADebugFlags[608] = Flag; /*PGAGetNumProcs*/
938   ctx->debug.PGADebugFlags[609] = Flag; /*PGASetCommunicator*/
939   ctx->debug.PGADebugFlags[610] = Flag; /*PGAGetCommunicator*/
940   ctx->debug.PGADebugFlags[611] = Flag; /*PGASetNumIslands*/
941   ctx->debug.PGADebugFlags[612] = Flag; /*PGAGetNumIslands*/
942   ctx->debug.PGADebugFlags[613] = Flag; /*PGASetNumDemes*/
943   ctx->debug.PGADebugFlags[614] = Flag; /*PGAGetNumDemes*/
944   ctx->debug.PGADebugFlags[616] = Flag; /*PGARunIM*/
945   ctx->debug.PGADebugFlags[617] = Flag; /*PGARunNM*/
946}
947
948/*I****************************************************************************
949   PGASetDebugFlag21 - Set the debug flags for all functions at debug level 21
950
951   Inputs:
952       ctx  - Context variable
953       Flag - PGA_TRUE to enable or PGA_FALSE to disable
954
955   Outputs:
956
957   Example:
958
959****************************************************************************I*/
960void PGASetDebugFlag21(PGAContext *ctx, int Flag)
961{
962   ctx->debug.PGADebugFlags[600] = Flag; /*PGABuildDataType*/
963   ctx->debug.PGADebugFlags[601] = Flag; /*PGASendIndividual*/
964   ctx->debug.PGADebugFlags[602] = Flag; /*PGAReceiveIndividual*/
965   ctx->debug.PGADebugFlags[603] = Flag; /*PGASendReceiveIndividual*/
966   ctx->debug.PGADebugFlags[604] = Flag; /*PGARunMS*/
967   ctx->debug.PGADebugFlags[605] = Flag; /*PGAEvaluateMS*/
968   ctx->debug.PGADebugFlags[606] = Flag; /*PGAEvaluateDoneMS*/
969   ctx->debug.PGADebugFlags[607] = Flag; /*PGAGetRank*/
970   ctx->debug.PGADebugFlags[608] = Flag; /*PGAGetNumProcs*/
971   ctx->debug.PGADebugFlags[609] = Flag; /*PGASetCommunicator*/
972   ctx->debug.PGADebugFlags[610] = Flag; /*PGAGetCommunicator*/
973   ctx->debug.PGADebugFlags[611] = Flag; /*PGASetNumIslands*/
974   ctx->debug.PGADebugFlags[612] = Flag; /*PGAGetNumIslands*/
975   ctx->debug.PGADebugFlags[613] = Flag; /*PGASetNumDemes*/
976   ctx->debug.PGADebugFlags[614] = Flag; /*PGAGetNumDemes*/
977   ctx->debug.PGADebugFlags[616] = Flag; /*PGARunIM*/
978   ctx->debug.PGADebugFlags[617] = Flag; /*PGARunNM*/
979   ctx->debug.PGADebugFlags[714] = Flag; /*PGACheckSum*/
980}
981
982/*I****************************************************************************
983   PGASetDebugFlag30 - Set the debug flags for all functions at debug level 30
984
985   Inputs:
986       ctx  - Context variable
987       Flag - PGA_TRUE to enable or PGA_FALSE to disable
988
989   Outputs:
990
991   Example:
992
993****************************************************************************I*/
994void PGASetDebugFlag30(PGAContext *ctx, int Flag)
995{
996   ctx->debug.PGADebugFlags[100] = Flag; /*PGABinaryCreateString*/
997   ctx->debug.PGADebugFlags[101] = Flag; /*PGABinaryMutation*/
998   ctx->debug.PGADebugFlags[102] = Flag; /*PGABinaryOneptCrossover*/
999   ctx->debug.PGADebugFlags[103] = Flag; /*PGABinaryTwoptCrossover*/
1000   ctx->debug.PGADebugFlags[104] = Flag; /*PGABinaryUniformCrossover*/
1001   ctx->debug.PGADebugFlags[105] = Flag; /*PGABinaryPrintString*/
1002   ctx->debug.PGADebugFlags[106] = Flag; /*PGABinaryCopyString*/
1003   ctx->debug.PGADebugFlags[107] = Flag; /*PGABinaryDuplicate*/
1004   ctx->debug.PGADebugFlags[108] = Flag; /*PGABinaryInitString*/
1005   ctx->debug.PGADebugFlags[109] = Flag; /*PGABinaryBuildDatatype*/
1006   ctx->debug.PGADebugFlags[110] = Flag; /*PGASetBinaryAllele*/
1007   ctx->debug.PGADebugFlags[111] = Flag; /*PGAGetBinaryAllele*/
1008   ctx->debug.PGADebugFlags[120] = Flag; /*PGABinaryHammingDistance*/
1009   ctx->debug.PGADebugFlags[121] = Flag; /*PGABinaryPrint*/
1010   ctx->debug.PGADebugFlags[122] = Flag; /*PGAGetBinaryInitProb*/
1011   ctx->debug.PGADebugFlags[123] = Flag; /*PGASetBinaryInitProb*/
1012}
1013
1014/*I****************************************************************************
1015   PGASetDebugFlag32 - Set the debug flags for all functions at debug level 32
1016
1017   Inputs:
1018       ctx  - Context variable
1019       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1020
1021   Outputs:
1022
1023   Example:
1024
1025****************************************************************************I*/
1026void PGASetDebugFlag32(PGAContext *ctx, int Flag)
1027{
1028   ctx->debug.PGADebugFlags[150] = Flag; /*PGAIntegerCreateString*/
1029   ctx->debug.PGADebugFlags[151] = Flag; /*PGAIntegerMutation*/
1030   ctx->debug.PGADebugFlags[152] = Flag; /*PGAIntegerOneptCrossover*/
1031   ctx->debug.PGADebugFlags[153] = Flag; /*PGAIntegerTwoptCrossover*/
1032   ctx->debug.PGADebugFlags[154] = Flag; /*PGAIntegerUniformCrossover*/
1033   ctx->debug.PGADebugFlags[155] = Flag; /*PGAIntegerPrintString*/
1034   ctx->debug.PGADebugFlags[156] = Flag; /*PGAIntegerCopyString*/
1035   ctx->debug.PGADebugFlags[157] = Flag; /*PGAIntegerDuplicate*/
1036   ctx->debug.PGADebugFlags[158] = Flag; /*PGAIntegerInitString*/
1037   ctx->debug.PGADebugFlags[159] = Flag; /*PGAIntegerBuildDatatype*/
1038   ctx->debug.PGADebugFlags[160] = Flag; /*PGASetIntegerAllele*/
1039   ctx->debug.PGADebugFlags[161] = Flag; /*PGAGetIntegerAllele*/
1040   ctx->debug.PGADebugFlags[170] = Flag; /*PGASetIntegerInitPermute*/
1041   ctx->debug.PGADebugFlags[171] = Flag; /*PGASetIntegerInitRange*/
1042   ctx->debug.PGADebugFlags[172] = Flag; /*PGAGetIntegerInitType*/
1043   ctx->debug.PGADebugFlags[173] = Flag; /*PGAGetMinIntegerInitValue*/
1044   ctx->debug.PGADebugFlags[174] = Flag; /*PGAGetMaxIntegerInitValue*/
1045   ctx->debug.PGADebugFlags[400] = Flag; /*PGASetMutationBoundedFlag*/
1046   ctx->debug.PGADebugFlags[401] = Flag; /*PGAGetMutationBoundedFlag*/
1047}
1048
1049/*I****************************************************************************
1050   PGASetDebugFlag34 - Set the debug flags for all functions at debug level 34
1051
1052   Inputs:
1053       ctx  - Context variable
1054       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1055
1056   Outputs:
1057
1058   Example:
1059
1060****************************************************************************I*/
1061void PGASetDebugFlag34(PGAContext *ctx, int Flag)
1062{
1063   ctx->debug.PGADebugFlags[200] = Flag; /*PGARealCreateString*/
1064   ctx->debug.PGADebugFlags[201] = Flag; /*PGARealMutation*/
1065   ctx->debug.PGADebugFlags[202] = Flag; /*PGARealOneptCrossover*/
1066   ctx->debug.PGADebugFlags[203] = Flag; /*PGARealTwoptCrossover*/
1067   ctx->debug.PGADebugFlags[204] = Flag; /*PGARealUniformCrossover*/
1068   ctx->debug.PGADebugFlags[205] = Flag; /*PGARealPrintString*/
1069   ctx->debug.PGADebugFlags[206] = Flag; /*PGARealCopyString*/
1070   ctx->debug.PGADebugFlags[207] = Flag; /*PGARealDuplicate*/
1071   ctx->debug.PGADebugFlags[208] = Flag; /*PGARealInitString*/
1072   ctx->debug.PGADebugFlags[209] = Flag; /*PGARealBuildDatatype*/
1073   ctx->debug.PGADebugFlags[210] = Flag; /*PGASetRealAllele*/
1074   ctx->debug.PGADebugFlags[211] = Flag; /*PGAGetRealAllele*/
1075   ctx->debug.PGADebugFlags[220] = Flag; /*PGASetRealInitPercent*/
1076   ctx->debug.PGADebugFlags[221] = Flag; /*PGASetRealInitRange*/
1077   ctx->debug.PGADebugFlags[222] = Flag; /*PGAGetMinRealInitValue*/
1078   ctx->debug.PGADebugFlags[223] = Flag; /*PGAGetMaxRealInitValue*/
1079}
1080
1081/*I****************************************************************************
1082   PGASetDebugFlag36 - Set the debug flags for all functions at debug level 36
1083
1084   Inputs:
1085       ctx  - Context variable
1086       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1087
1088   Outputs:
1089
1090   Example:
1091
1092****************************************************************************I*/
1093void PGASetDebugFlag36(PGAContext *ctx, int Flag)
1094{
1095   ctx->debug.PGADebugFlags[250] = Flag; /*PGACharacterCreateString*/
1096   ctx->debug.PGADebugFlags[251] = Flag; /*PGACharacterMutation*/
1097   ctx->debug.PGADebugFlags[252] = Flag; /*PGACharacterOneptCrossover*/
1098   ctx->debug.PGADebugFlags[253] = Flag; /*PGACharacterTwoptCrossover*/
1099   ctx->debug.PGADebugFlags[254] = Flag; /*PGACharacterUniformCrossover*/
1100   ctx->debug.PGADebugFlags[255] = Flag; /*PGACharacterPrintString*/
1101   ctx->debug.PGADebugFlags[256] = Flag; /*PGACharacterCopyString*/
1102   ctx->debug.PGADebugFlags[257] = Flag; /*PGACharacterDuplicate*/
1103   ctx->debug.PGADebugFlags[258] = Flag; /*PGACharacterInitString*/
1104   ctx->debug.PGADebugFlags[259] = Flag; /*PGACharacterBuildDatatype*/
1105   ctx->debug.PGADebugFlags[260] = Flag; /*PGASetCharacterAllele*/
1106   ctx->debug.PGADebugFlags[261] = Flag; /*PGAGetCharacterAllele*/
1107   ctx->debug.PGADebugFlags[270] = Flag; /*PGASetCharacterInitType*/
1108}
1109
1110/*I****************************************************************************
1111   PGASetDebugFlag40 - Set the debug flags for all functions at debug level 40
1112
1113   Inputs:
1114       ctx  - Context variable
1115       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1116
1117   Outputs:
1118
1119   Example:
1120
1121****************************************************************************I*/
1122void PGASetDebugFlag40(PGAContext *ctx, int Flag)
1123{
1124   ctx->debug.PGADebugFlags[100] = Flag; /*PGABinaryCreateString*/
1125   ctx->debug.PGADebugFlags[108] = Flag; /*PGABinaryInitString*/
1126   ctx->debug.PGADebugFlags[122] = Flag; /*PGAGetBinaryInitProb*/
1127   ctx->debug.PGADebugFlags[123] = Flag; /*PGASetBinaryInitProb*/
1128   ctx->debug.PGADebugFlags[250] = Flag; /*PGACharacterCreateString*/
1129   ctx->debug.PGADebugFlags[258] = Flag; /*PGACharacterInitString*/
1130   ctx->debug.PGADebugFlags[270] = Flag; /*PGASetCharacterInitType*/
1131   ctx->debug.PGADebugFlags[300] = Flag; /*PGACreate*/
1132   ctx->debug.PGADebugFlags[301] = Flag; /*PGASetUp*/
1133   ctx->debug.PGADebugFlags[302] = Flag; /*PGACreatePop*/
1134   ctx->debug.PGADebugFlags[303] = Flag; /*PGACreateIndividual*/
1135   ctx->debug.PGADebugFlags[304] = Flag; /*PGAGetRandomInitFlag*/
1136   ctx->debug.PGADebugFlags[305] = Flag; /*PGASetRandomInitFlag*/
1137   ctx->debug.PGADebugFlags[150] = Flag; /*PGAIntegerCreateString*/
1138   ctx->debug.PGADebugFlags[158] = Flag; /*PGAIntegerInitString*/
1139   ctx->debug.PGADebugFlags[170] = Flag; /*PGASetIntegerInitPermute*/
1140   ctx->debug.PGADebugFlags[171] = Flag; /*PGASetIntegerInitRange*/
1141   ctx->debug.PGADebugFlags[172] = Flag; /*PGAGetIntegerInitType*/
1142   ctx->debug.PGADebugFlags[173] = Flag; /*PGAGetMinIntegerInitValue*/
1143   ctx->debug.PGADebugFlags[174] = Flag; /*PGAGetMaxIntegerInitValue*/
1144   ctx->debug.PGADebugFlags[200] = Flag; /*PGARealCreateString*/
1145   ctx->debug.PGADebugFlags[208] = Flag; /*PGARealInitString*/
1146   ctx->debug.PGADebugFlags[220] = Flag; /*PGASetRealInitPercent*/
1147   ctx->debug.PGADebugFlags[221] = Flag; /*PGASetRealInitRange*/
1148   ctx->debug.PGADebugFlags[222] = Flag; /*PGAGetMinRealInitValue*/
1149   ctx->debug.PGADebugFlags[223] = Flag; /*PGAGetMaxRealInitValue*/
1150}
1151
1152/*I****************************************************************************
1153   PGASetDebugFlag42 - Set the debug flags for all functions at debug level 42
1154
1155   Inputs:
1156       ctx  - Context variable
1157       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1158
1159   Outputs:
1160
1161   Example:
1162
1163****************************************************************************I*/
1164void PGASetDebugFlag42(PGAContext *ctx, int Flag)
1165{
1166   ctx->debug.PGADebugFlags[380] = Flag; /*PGASelect*/
1167   ctx->debug.PGADebugFlags[381] = Flag; /*PGASelectProportional*/
1168   ctx->debug.PGADebugFlags[382] = Flag; /*PGASelectSUS*/
1169   ctx->debug.PGADebugFlags[383] = Flag; /*PGASelectTournament*/
1170   ctx->debug.PGADebugFlags[384] = Flag; /*PGASelectPTournament*/
1171   ctx->debug.PGADebugFlags[385] = Flag; /*PGASelectNextIndex*/
1172   ctx->debug.PGADebugFlags[386] = Flag; /*PGAGetSelectType*/
1173   ctx->debug.PGADebugFlags[387] = Flag; /*PGAGetPTournamentProb*/
1174   ctx->debug.PGADebugFlags[388] = Flag; /*PGASetSelectType*/
1175   ctx->debug.PGADebugFlags[389] = Flag; /*PGASetPTournamentProb*/
1176}
1177
1178/*I****************************************************************************
1179   PGASetDebugFlag44 - Set the debug flags for all functions at debug level 44
1180
1181   Inputs:
1182       ctx  - Context variable
1183       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1184
1185   Outputs:
1186
1187   Example:
1188
1189****************************************************************************I*/
1190void PGASetDebugFlag44(PGAContext *ctx, int Flag)
1191{
1192   ctx->debug.PGADebugFlags[101] = Flag; /*PGABinaryMutation*/
1193   ctx->debug.PGADebugFlags[151] = Flag; /*PGAIntegerMutation*/
1194   ctx->debug.PGADebugFlags[201] = Flag; /*PGARealMutation*/
1195   ctx->debug.PGADebugFlags[251] = Flag; /*PGACharacterMutation*/
1196   ctx->debug.PGADebugFlags[330] = Flag; /*PGAMutate*/
1197   ctx->debug.PGADebugFlags[331] = Flag; /*PGAGetMutationType*/
1198   ctx->debug.PGADebugFlags[332] = Flag; /*PGAGetMutationRealValue*/
1199   ctx->debug.PGADebugFlags[333] = Flag; /*PGAGetMutationIntegerValue*/
1200   ctx->debug.PGADebugFlags[334] = Flag; /*PGAGetMutationProb*/
1201   ctx->debug.PGADebugFlags[335] = Flag; /*PGASetMutationType*/
1202   ctx->debug.PGADebugFlags[336] = Flag; /*PGASetMutationRealValue*/
1203   ctx->debug.PGADebugFlags[337] = Flag; /*PGASetMutationIntegerValue*/
1204   ctx->debug.PGADebugFlags[338] = Flag; /*PGASetMutationProb*/
1205   ctx->debug.PGADebugFlags[400] = Flag; /*PGASetMutationBoundedFlag*/
1206   ctx->debug.PGADebugFlags[401] = Flag; /*PGAGetMutationBoundedFlag*/
1207}
1208
1209/*I****************************************************************************
1210   PGASetDebugFlag46 - Set the debug flags for all functions at debug level 46
1211
1212   Inputs:
1213       ctx  - Context variable
1214       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1215
1216   Outputs:
1217
1218   Example:
1219
1220****************************************************************************I*/
1221void PGASetDebugFlag46(PGAContext *ctx, int Flag)
1222{
1223   ctx->debug.PGADebugFlags[102] = Flag; /*PGABinaryOneptCrossover*/
1224   ctx->debug.PGADebugFlags[103] = Flag; /*PGABinaryTwoptCrossover*/
1225   ctx->debug.PGADebugFlags[104] = Flag; /*PGABinaryUniformCrossover*/
1226   ctx->debug.PGADebugFlags[152] = Flag; /*PGAIntegerOneptCrossover*/
1227   ctx->debug.PGADebugFlags[153] = Flag; /*PGAIntegerTwoptCrossover*/
1228   ctx->debug.PGADebugFlags[154] = Flag; /*PGAIntegerUniformCrossover*/
1229   ctx->debug.PGADebugFlags[202] = Flag; /*PGARealOneptCrossover*/
1230   ctx->debug.PGADebugFlags[203] = Flag; /*PGARealTwoptCrossover*/
1231   ctx->debug.PGADebugFlags[204] = Flag; /*PGARealUniformCrossover*/
1232   ctx->debug.PGADebugFlags[252] = Flag; /*PGACharacterOneptCrossover*/
1233   ctx->debug.PGADebugFlags[253] = Flag; /*PGACharacterTwoptCrossover*/
1234   ctx->debug.PGADebugFlags[254] = Flag; /*PGACharacterUniformCrossover*/
1235   ctx->debug.PGADebugFlags[310] = Flag; /*PGACrossover*/
1236   ctx->debug.PGADebugFlags[311] = Flag; /*PGAGetCrossoverType*/
1237   ctx->debug.PGADebugFlags[312] = Flag; /*PGAGetCrossoverProb*/
1238   ctx->debug.PGADebugFlags[313] = Flag; /*PGAGetUniformCrossoverProb*/
1239   ctx->debug.PGADebugFlags[314] = Flag; /*PGASetCrossoverType*/
1240   ctx->debug.PGADebugFlags[315] = Flag; /*PGASetCrossoverProb*/
1241   ctx->debug.PGADebugFlags[316] = Flag; /*PGASetUniformCrossoverProb*/
1242}
1243
1244/*I****************************************************************************
1245   PGASetDebugFlag48 - Set the debug flags for all functions at debug level 48
1246
1247   Inputs:
1248       ctx  - Context variable
1249       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1250
1251   Outputs:
1252
1253   Example:
1254
1255****************************************************************************I*/
1256void PGASetDebugFlag48(PGAContext *ctx, int Flag)
1257{
1258   ctx->debug.PGADebugFlags[110] = Flag; /*PGASetBinaryAllele*/
1259   ctx->debug.PGADebugFlags[111] = Flag; /*PGAGetBinaryAllele*/
1260   ctx->debug.PGADebugFlags[160] = Flag; /*PGASetIntegerAllele*/
1261   ctx->debug.PGADebugFlags[161] = Flag; /*PGAGetIntegerAllele*/
1262   ctx->debug.PGADebugFlags[210] = Flag; /*PGASetRealAllele*/
1263   ctx->debug.PGADebugFlags[211] = Flag; /*PGAGetRealAllele*/
1264   ctx->debug.PGADebugFlags[260] = Flag; /*PGASetCharacterAllele*/
1265   ctx->debug.PGADebugFlags[261] = Flag; /*PGAGetCharacterAllele*/
1266   ctx->debug.PGADebugFlags[500] = Flag; /*PGAGetRealFromBinary*/
1267   ctx->debug.PGADebugFlags[501] = Flag; /*PGAGetRealFromGrayCode*/
1268   ctx->debug.PGADebugFlags[502] = Flag; /*PGAEncodeRealAsBinary*/
1269   ctx->debug.PGADebugFlags[503] = Flag; /*PGAEncodeRealAsGrayCode*/
1270   ctx->debug.PGADebugFlags[504] = Flag; /*PGAMapIntegerToReal*/
1271   ctx->debug.PGADebugFlags[505] = Flag; /*PGAMapRealToInteger*/
1272   ctx->debug.PGADebugFlags[506] = Flag; /*PGAEncodeIntegerAsBinary*/
1273   ctx->debug.PGADebugFlags[507] = Flag; /*PGAEncodeIntegerAsGrayCode*/
1274   ctx->debug.PGADebugFlags[508] = Flag; /*PGAGetIntegerFromBinary*/
1275   ctx->debug.PGADebugFlags[509] = Flag; /*PGAGetIntegerFromGrayCode*/
1276   ctx->debug.PGADebugFlags[510] = Flag; /*PGAEvaluate*/
1277   ctx->debug.PGADebugFlags[511] = Flag; /*PGASetEvaluation*/
1278   ctx->debug.PGADebugFlags[512] = Flag; /*PGASetEvaluationUpToDateFlag*/
1279   ctx->debug.PGADebugFlags[513] = Flag; /*PGAGetEvaluation*/
1280   ctx->debug.PGADebugFlags[514] = Flag; /*PGAGetEvaluationUpToDateFlag*/
1281   ctx->debug.PGADebugFlags[605] = Flag; /*PGAEvaluateMS*/
1282   ctx->debug.PGADebugFlags[715] = Flag; /*PGAGetWorstIndex*/
1283   ctx->debug.PGADebugFlags[716] = Flag; /*PGAGetBestIndex*/
1284}
1285
1286/*I****************************************************************************
1287   PGASetDebugFlag50 - Set the debug flags for all functions at debug level 50
1288
1289   Inputs:
1290       ctx  - Context variable
1291       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1292
1293   Outputs:
1294
1295   Example:
1296
1297****************************************************************************I*/
1298void PGASetDebugFlag50(PGAContext *ctx, int Flag)
1299{
1300   ctx->debug.PGADebugFlags[520] = Flag; /*PGAFitness*/
1301   ctx->debug.PGADebugFlags[521] = Flag; /*PGAFitnessLinearNormal*/
1302   ctx->debug.PGADebugFlags[522] = Flag; /*PGAFitnessLinearRank*/
1303   ctx->debug.PGADebugFlags[523] = Flag; /*PGAFitnessMinReciprocal*/
1304   ctx->debug.PGADebugFlags[524] = Flag; /*PGAFitnessMinCmax*/
1305   ctx->debug.PGADebugFlags[525] = Flag; /*PGARank*/
1306   ctx->debug.PGADebugFlags[526] = Flag; /*PGAGetFitness*/
1307   ctx->debug.PGADebugFlags[527] = Flag; /*PGAGetFitnessType*/
1308   ctx->debug.PGADebugFlags[528] = Flag; /*PGAGetFitnessMinType*/
1309   ctx->debug.PGADebugFlags[529] = Flag; /*PGAGetMaxFitnessRank*/
1310   ctx->debug.PGADebugFlags[530] = Flag; /*PGASetFitnessType*/
1311   ctx->debug.PGADebugFlags[531] = Flag; /*PGASetFitnessMinType*/
1312   ctx->debug.PGADebugFlags[532] = Flag; /*PGASetMaxFitnessRank*/
1313   ctx->debug.PGADebugFlags[533] = Flag; /*PGASetFitnessCmaxValue*/
1314   ctx->debug.PGADebugFlags[534] = Flag; /*PGAGetFitnessCmaxValue*/
1315}
1316
1317/*I****************************************************************************
1318   PGASetDebugFlag52 - Set the debug flags for all functions at debug level 52
1319
1320   Inputs:
1321       ctx  - Context variable
1322       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1323
1324   Outputs:
1325
1326   Example:
1327
1328****************************************************************************I*/
1329void PGASetDebugFlag52(PGAContext *ctx, int Flag)
1330{
1331   ctx->debug.PGADebugFlags[107] = Flag; /*PGABinaryDuplicate*/
1332   ctx->debug.PGADebugFlags[157] = Flag; /*PGAIntegerDuplicate*/
1333   ctx->debug.PGADebugFlags[207] = Flag; /*PGARealDuplicate*/
1334   ctx->debug.PGADebugFlags[257] = Flag; /*PGACharacterDuplicate*/
1335   ctx->debug.PGADebugFlags[340] = Flag; /*PGADuplicate*/
1336   ctx->debug.PGADebugFlags[341] = Flag; /*PGAChange*/
1337   ctx->debug.PGADebugFlags[342] = Flag; /*PGASetNoDuplicatesFlag*/
1338   ctx->debug.PGADebugFlags[343] = Flag; /*PGAGetNoDuplicatesFlag*/
1339}
1340
1341/*I****************************************************************************
1342   PGASetDebugFlag54 - Set the debug flags for all functions at debug level 54
1343
1344   Inputs:
1345       ctx  - Context variable
1346       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1347
1348   Outputs:
1349
1350   Example:
1351
1352****************************************************************************I*/
1353void PGASetDebugFlag54(PGAContext *ctx, int Flag)
1354{
1355   ctx->debug.PGADebugFlags[370] = Flag; /*PGARestart*/
1356   ctx->debug.PGADebugFlags[371] = Flag; /*PGAGetRestartFlag*/
1357   ctx->debug.PGADebugFlags[372] = Flag; /*PGAGetRestartFrequencyValue*/
1358   ctx->debug.PGADebugFlags[373] = Flag; /*PGAGetRestartAlleleChangeProb*/
1359   ctx->debug.PGADebugFlags[374] = Flag; /*PGASetRestartFlag*/
1360   ctx->debug.PGADebugFlags[375] = Flag; /*PGASetRestartFrequencyValue*/
1361   ctx->debug.PGADebugFlags[376] = Flag; /*PGASetRestartAlleleChangeProb*/
1362}
1363
1364/*I****************************************************************************
1365   PGASetDebugFlag56 - Set the debug flags for all functions at debug level 56
1366
1367   Inputs:
1368       ctx  - Context variable
1369       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1370
1371   Outputs:
1372
1373   Example:
1374
1375****************************************************************************I*/
1376void PGASetDebugFlag56(PGAContext *ctx, int Flag)
1377{
1378   ctx->debug.PGADebugFlags[105] = Flag; /*PGABinaryPrintString*/
1379   ctx->debug.PGADebugFlags[121] = Flag; /*PGABinaryPrint*/
1380   ctx->debug.PGADebugFlags[155] = Flag; /*PGAIntegerPrintString*/
1381   ctx->debug.PGADebugFlags[205] = Flag; /*PGARealPrintString*/
1382   ctx->debug.PGADebugFlags[255] = Flag; /*PGACharacterPrintString*/
1383   ctx->debug.PGADebugFlags[820] = Flag; /*PGAPrintPopulation*/
1384   ctx->debug.PGADebugFlags[821] = Flag; /*PGAPrintIndividual*/
1385   ctx->debug.PGADebugFlags[822] = Flag; /*PGAPrintReport*/
1386   ctx->debug.PGADebugFlags[823] = Flag; /*PGAPrintContextVariable*/
1387   ctx->debug.PGADebugFlags[824] = Flag; /*PGAPrintString*/
1388   ctx->debug.PGADebugFlags[825] = Flag; /*PGAGetPrintFrequencyValue*/
1389   ctx->debug.PGADebugFlags[826] = Flag; /*PGASetPrintFrequencyValue*/
1390   ctx->debug.PGADebugFlags[827] = Flag; /*PGASetPrintOptions*/
1391}
1392
1393/*I****************************************************************************
1394   PGASetDebugFlag58 - Set the debug flags for all functions at debug level 58
1395
1396   Inputs:
1397       ctx  - Context variable
1398       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1399
1400   Outputs:
1401
1402   Example:
1403
1404****************************************************************************I*/
1405void PGASetDebugFlag58(PGAContext *ctx, int Flag)
1406{
1407   ctx->debug.PGADebugFlags[390] = Flag; /*PGAGetStoppingRuleType*/
1408   ctx->debug.PGADebugFlags[391] = Flag; /*PGASetStoppingRuleType*/
1409   ctx->debug.PGADebugFlags[392] = Flag; /*PGAGetMaxGAIterValue*/
1410   ctx->debug.PGADebugFlags[393] = Flag; /*PGASetMaxGAIterValue*/
1411   ctx->debug.PGADebugFlags[394] = Flag; /*PGACheckStoppingConditions*/
1412   ctx->debug.PGADebugFlags[395] = Flag; /*PGASetMaxNoChangeValue*/
1413   ctx->debug.PGADebugFlags[396] = Flag; /*PGASetMaxSimilarityValue*/
1414   ctx->debug.PGADebugFlags[397] = Flag; /*PGADone*/
1415}
1416
1417/*I****************************************************************************
1418   PGASetDebugFlag60 - Set the debug flags for all functions at debug level 60
1419
1420   Inputs:
1421       ctx  - Context variable
1422       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1423
1424   Outputs:
1425
1426   Example:
1427
1428****************************************************************************I*/
1429void PGASetDebugFlag60(PGAContext *ctx, int Flag)
1430{
1431   ctx->debug.PGADebugFlags[320] = Flag; /*PGASortPop*/
1432   ctx->debug.PGADebugFlags[324] = Flag; /*PGAGetSortedPopIndex*/
1433   ctx->debug.PGADebugFlags[810] = Flag; /*PGADblHeapSort*/
1434   ctx->debug.PGADebugFlags[811] = Flag; /*PGADblHeapify*/
1435   ctx->debug.PGADebugFlags[812] = Flag; /*PGADblAdjustHeap*/
1436   ctx->debug.PGADebugFlags[813] = Flag; /*PGAIntHeapSort*/
1437   ctx->debug.PGADebugFlags[814] = Flag; /*PGAIntHeapify*/
1438   ctx->debug.PGADebugFlags[815] = Flag; /*PGAIntAdjustHeap*/
1439}
1440
1441/*I****************************************************************************
1442   PGASetDebugFlag62 - Set the debug flags for all functions at debug level 62
1443
1444   Inputs:
1445       ctx  - Context variable
1446       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1447
1448   Outputs:
1449
1450   Example:
1451
1452****************************************************************************I*/
1453void PGASetDebugFlag62(PGAContext *ctx, int Flag)
1454{
1455   ctx->debug.PGADebugFlags[750] = Flag; /*PGARandomFlip*/
1456   ctx->debug.PGADebugFlags[751] = Flag; /*PGARandomInterval*/
1457   ctx->debug.PGADebugFlags[752] = Flag; /*PGARandom01*/
1458   ctx->debug.PGADebugFlags[753] = Flag; /*PGARandomUniform*/
1459   ctx->debug.PGADebugFlags[754] = Flag; /*PGARandomGaussian*/
1460   ctx->debug.PGADebugFlags[755] = Flag; /*PGAGetRandomSeed*/
1461   ctx->debug.PGADebugFlags[756] = Flag; /*PGASetRandomSeed*/
1462}
1463
1464/*I****************************************************************************
1465   PGASetDebugFlag64 - Set the debug flags for all functions at debug level 64
1466
1467   Inputs:
1468       ctx  - Context variable
1469       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1470
1471   Outputs:
1472
1473   Example:
1474
1475****************************************************************************I*/
1476void PGASetDebugFlag64(PGAContext *ctx, int Flag)
1477{
1478   ctx->debug.PGADebugFlags[700] = Flag; /*PGAError*/
1479   ctx->debug.PGADebugFlags[702] = Flag; /*PGAUsage*/
1480   ctx->debug.PGADebugFlags[703] = Flag; /*PGAPrintVersionNumber*/
1481   ctx->debug.PGADebugFlags[704] = Flag; /*PGAGetMaxMachineIntValue*/
1482   ctx->debug.PGADebugFlags[705] = Flag; /*PGAGetMinMachineIntValue*/
1483   ctx->debug.PGADebugFlags[706] = Flag; /*PGAGetMaxMachineDoubleValue*/
1484   ctx->debug.PGADebugFlags[707] = Flag; /*PGAGetMinMachineDoubleValue*/
1485   ctx->debug.PGADebugFlags[708] = Flag; /*PGADestroy*/
1486   ctx->debug.PGADebugFlags[730] = Flag; /*PGAReadCmdLine*/
1487   ctx->debug.PGADebugFlags[731] = Flag; /*PGAParseDebugArg*/
1488   ctx->debug.PGADebugFlags[732] = Flag; /*PGAStripArgs*/
1489}
1490
1491/*I****************************************************************************
1492   PGASetDebugFlag66 - Set the debug flags for all functions at debug level 66
1493
1494   Inputs:
1495       ctx  - Context variable
1496       Flag - PGA_TRUE to enable or PGA_FALSE to disable
1497
1498   Outputs:
1499
1500   Example:
1501
1502****************************************************************************I*/
1503void PGASetDebugFlag66(PGAContext *ctx, int Flag)
1504{
1505   ctx->debug.PGADebugFlags[710] = Flag; /*PGAMean*/
1506   ctx->debug.PGADebugFlags[711] = Flag; /*PGAStddev*/
1507   ctx->debug.PGADebugFlags[712] = Flag; /*PGACopyIndividual*/
1508   ctx->debug.PGADebugFlags[713] = Flag; /*PGARound*/
1509   ctx->debug.PGADebugFlags[714] = Flag; /*PGACheckSum*/
1510   ctx->debug.PGADebugFlags[715] = Flag; /*PGAGetWorstIndex*/
1511   ctx->debug.PGADebugFlags[716] = Flag; /*PGAGetBestIndex*/
1512   ctx->debug.PGADebugFlags[717] = Flag; /*PGAGetIndividual*/
1513   ctx->debug.PGADebugFlags[718] = Flag; /*PGAUpdateAverage*/
1514   ctx->debug.PGADebugFlags[719] = Flag; /*PGAUpdateOnline*/
1515   ctx->debug.PGADebugFlags[720] = Flag; /*PGAUpdateOffline*/
1516   ctx->debug.PGADebugFlags[721] = Flag; /*PGAComputeSimilarity*/
1517}
1518#endif
1519
1520/*I****************************************************************************
1521   PGAPrintDebugOptions - prints the list of available debug options
1522
1523   Inputs:
1524      ctx - context variable
1525
1526   Outputs:
1527      list of available debug options
1528
1529   Example:
1530      PGAContext ctx;
1531      :
1532      PGAPrintDebugOptions(ctx);
1533     
1534****************************************************************************I*/
1535void PGAPrintDebugOptions(PGAContext *ctx)
1536{
1537    PGADebugEntered("PGAPrintDebugOptions");
1538   
1539#if OPTIMIZE==0
1540    fprintf(stderr, "  0 Trace all debug prints\n");
1541    fprintf(stderr, "\n");
1542    fprintf(stderr, "  1 Reserved for the user\n");
1543    fprintf(stderr, "    :                   :\n");
1544    fprintf(stderr, " 10 Reserved for the user\n");
1545    fprintf(stderr, " 11 Trace high-level functions\n");
1546    fprintf(stderr, "\n");
1547    fprintf(stderr, " 20 Trace high-level parallel functions\n");
1548    fprintf(stderr, " 21 Trace all parallel functions\n");
1549    fprintf(stderr, "\n");
1550    fprintf(stderr, " 30 Trace BINARY    functions\n");
1551    fprintf(stderr, " 32 Trace INTEGER   functions\n");
1552    fprintf(stderr, " 34 Trace REAL      functions\n");
1553    fprintf(stderr, " 36 Trace CHARACTER functions\n");
1554    fprintf(stderr, "\n");
1555    fprintf(stderr, " 40 Trace population creation functions\n");
1556    fprintf(stderr, " 42 Trace select functions\n");
1557    fprintf(stderr, " 44 Trace mutation functions\n");
1558    fprintf(stderr, " 46 Trace crossover functions\n");
1559    fprintf(stderr, " 48 Trace function evaluation functions\n");
1560    fprintf(stderr, " 50 Trace fitness calculation  functions\n");
1561    fprintf(stderr, " 52 Trace duplicate checking functions\n");
1562    fprintf(stderr, " 54 Trace restart functions\n");
1563    fprintf(stderr, " 56 Trace reporting functions\n");
1564    fprintf(stderr, " 58 Trace stopping functions\n");
1565    fprintf(stderr, " 60 Trace sorting functions\n");
1566    fprintf(stderr, " 62 Trace random number functions\n");
1567    fprintf(stderr, " 64 Trace system routines\n");
1568    fprintf(stderr, " 66 Trace utility functions\n");
1569    fprintf(stderr, "\n");
1570    fprintf(stderr, " 80 Trace memory allocations\n");
1571    fprintf(stderr, " 82 Trace variable print statements\n");
1572#else
1573    fprintf(stderr, " Optimized version; no debug options.\n");
1574#endif
1575    PGADestroy(ctx);
1576    exit(0);
1577}
1578
Note: See TracBrowser for help on using the repository browser.