-
Notifications
You must be signed in to change notification settings - Fork 1
/
sfnf.h
75 lines (63 loc) · 2.41 KB
/
sfnf.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* sfnf.h
* 28 Apr 2000
* common routines for SF, RSF, NF
*/
/* #include before: "rat.h", "treedef.h" */
/* possible values for whichform */
enum Gameform { SFORM, NFORM, RSFORM } ;
/* vector of realization probabilities, one for each player */
extern Rat *realplan[PLAYERS];
/* allocate realpl[0..PLAYERS-1],
* which must be declared as Rat * realpl[PLAYERS]
* assumes nseqs[] set
* free after use again with freerealplan(realplan)
*/
void allocrealplan (Rat * realpl[PLAYERS]);
/* to be called before next call to allocrealplan()
* to avoid memory leaks
*/
void freerealplan(Rat * realpl[PLAYERS]);
/* for player pl: for each move ->realprob from ->behavprob
* seqin for pl's isets must be defined, see genseqin()
* requires top-down ordering of moves
*/
void behavtorealprob (int pl);
/* for player pl: returns that rplan1 and rplan2 agree,
* gives offending disagreements to stdout if bcomplain==1
*/
Bool eqrealplans(int pl, Rat *rplan1, Rat *rplan2, Bool bcomplain);
/* copy frommatr[i][j][plminusone]
* (negated if bnegate)
* for 0<= i < nfromrows, 0<= j < nfromcols
* if (btranspfrommatr==0)
* to: targetmatr[i + targrowoffset][j + targcoloffset]
* and if (btranspfrommatr):
* to: targetmatr[j + targrowoffset][i + targcoloffset]
*/
void payratmatcpy(Payvec ** frommatr, int plminusone, Bool bnegate,
Bool btranspfrommatr, int nfromrows, int nfromcols,
Rat ** targetmatr, int targrowoffset, int targcoloffset);
/* copy frommatr[i][j]
* (negated if bnegate)
* for 0<= i < nfromrows, 0<= j < nfromcols
* if (btranspfrommatr==0)
* to: targetmatr[i + targrowoffset][j + targcoloffset]
* and if (btranspfrommatr):
* to: targetmatr[j + targrowoffset][i + targcoloffset]
*/
void intratmatcpy(int ** frommatr, Bool bnegate,
Bool btranspfrommatr, int nfromrows, int nfromcols,
Rat ** targetmatr, int targrowoffset, int targcoloffset);
/* generate covering vector
* whichform: SFCODE, NFCODE, RSFCODE
* rhsq in LCP assumed to be given already
* assume prior has been generated by genprior() and
* stored in moves[]->behavprob
*/
void covvector(int whichform);
/* show equilibrium computed in solz[] by runlemke()
* whichform: SFCODE, NFCODE, RSFCODE
* bshortequil: output equilibrium in single line only
* docuseed: what seed to output for short equilibrium output
*/
void showeq(int whichform, Bool bshortequil, int docuseed);