File indexing completed on 2023-05-28 05:10:54 UTC
view on githubraw file Latest commit b4daa243 on 2023-05-28 03:53:22 UTC
b4daa24319 Shre*0001 #ifndef ADBINOMIAL_LOADED
0002 #define ADBINOMIAL_LOADED 1
0003
0004 #define PUSHSNAP 1
0005 #define LOOKSNAP 2
0006 #define POPSNAP 3
0007 #define ADVANCE 4
0008 #define FIRSTTURN 5
0009 #define TURN 6
0010
0011 /******************************* Exported Functions: */
0012
0013 /** Initializes a (possibly nested) binomial checkpointing
0014 * session for "length" steps using at most "nbSnap" snapshots.
0015 * "firstStep' is the offset, i.e. the index of the 1st step. */
0016 extern void adBinomial_init(int length, int nbSnap, int firstStep) ;
0017
0018 /** Returns in *action the code for the next binomial
0019 * checkpointing action to perform, and in *step the index of
0020 * the step to which this action refers to. If no action is left,
0021 * restores the stack to the enclosing binomial session (if any).
0022 * Returns 0 if some action is found, 0 otherwise. */
0023 extern int adBinomial_next(int *action, int *step) ;
0024
0025 /** Must be called when an "ADVANCE" order was issued,
0026 * but then the iterative loop reaches past its exit point. */
0027 extern void adBinomial_resize() ;
0028
0029 #endif