| 1 |
|
|---|
| 2 | #include "ad_rev.h"
|
|---|
| 3 |
|
|---|
| 4 | __ADIC_RevType our_rev_mode = {0,0,0,0,0,0,0};
|
|---|
| 5 | //__ADIC_RevType our_rev_mode = {0};
|
|---|
| 6 |
|
|---|
| 7 | /*
|
|---|
| 8 | int isRevModePlain(__ADIC_RevType our_rev_mode)
|
|---|
| 9 | {
|
|---|
| 10 | return our_rev_mode.plain;
|
|---|
| 11 | }
|
|---|
| 12 |
|
|---|
| 13 | int isRevModeTape(__ADIC_RevType our_rev_mode)
|
|---|
| 14 | {
|
|---|
| 15 | return our_rev_mode.tape;
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | int isRevModeAdjoint(__ADIC_RevType our_rev_mode)
|
|---|
| 19 | {
|
|---|
| 20 | return our_rev_mode.adjoint;
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | int isRevModeArgStore(__ADIC_RevType our_rev_mode)
|
|---|
| 24 | {
|
|---|
| 25 | return our_rev_mode.arg_store;
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | int isRevModeArgRestore(__ADIC_RevType our_rev_mode)
|
|---|
| 29 | {
|
|---|
| 30 | return our_rev_mode.arg_restore;
|
|---|
| 31 | }
|
|---|
| 32 |
|
|---|
| 33 | int isRevModeRedStore(__ADIC_RevType our_rev_mode)
|
|---|
| 34 | {
|
|---|
| 35 | return our_rev_mode.res_store;
|
|---|
| 36 | }
|
|---|
| 37 |
|
|---|
| 38 | int isRevModeResRestore(__ADIC_RevType our_rev_mode)
|
|---|
| 39 | {
|
|---|
| 40 | return our_rev_mode.res_restore;
|
|---|
| 41 | }
|
|---|
| 42 |
|
|---|
| 43 | __ADIC_RevType getRevMode()
|
|---|
| 44 | {
|
|---|
| 45 | return our_rev_mode;
|
|---|
| 46 | }*/
|
|---|
| 47 |
|
|---|
| 48 | void __ADIC_RevInit(__ADIC_RevType *adic_rev)
|
|---|
| 49 | {
|
|---|
| 50 | adic_rev->arg_store = FALSE;
|
|---|
| 51 | adic_rev->arg_restore = FALSE;
|
|---|
| 52 | adic_rev->res_store = FALSE;
|
|---|
| 53 | adic_rev->res_restore = FALSE;
|
|---|
| 54 | adic_rev->plain = TRUE;
|
|---|
| 55 | adic_rev->tape = FALSE;
|
|---|
| 56 | adic_rev->adjoint = FALSE;
|
|---|
| 57 | }
|
|---|
| 58 |
|
|---|
| 59 | void __ADIC_RevPlain(__ADIC_RevType *adic_rev)
|
|---|
| 60 | {
|
|---|
| 61 | adic_rev->arg_store = FALSE;
|
|---|
| 62 | adic_rev->arg_restore = FALSE;
|
|---|
| 63 | adic_rev->res_store = FALSE;
|
|---|
| 64 | adic_rev->res_restore = FALSE;
|
|---|
| 65 | adic_rev->plain = TRUE;
|
|---|
| 66 | adic_rev->tape = FALSE;
|
|---|
| 67 | adic_rev->adjoint = FALSE;
|
|---|
| 68 | }
|
|---|
| 69 | void __ADIC_RevTape(__ADIC_RevType *adic_rev)
|
|---|
| 70 | {
|
|---|
| 71 | adic_rev->arg_store = FALSE;
|
|---|
| 72 | adic_rev->arg_restore = FALSE;
|
|---|
| 73 | adic_rev->res_store = FALSE;
|
|---|
| 74 | adic_rev->res_restore = FALSE;
|
|---|
| 75 | adic_rev->plain = FALSE;
|
|---|
| 76 | adic_rev->tape = TRUE;
|
|---|
| 77 | adic_rev->adjoint = FALSE;
|
|---|
| 78 | }
|
|---|
| 79 | void __ADIC_RevAdjoint(__ADIC_RevType *adic_rev)
|
|---|
| 80 | {
|
|---|
| 81 | adic_rev->arg_store = FALSE;
|
|---|
| 82 | adic_rev->arg_restore = FALSE;
|
|---|
| 83 | adic_rev->res_store = FALSE;
|
|---|
| 84 | adic_rev->res_restore = FALSE;
|
|---|
| 85 | adic_rev->plain = FALSE;
|
|---|
| 86 | adic_rev->tape = FALSE;
|
|---|
| 87 | adic_rev->adjoint = TRUE;
|
|---|
| 88 | }
|
|---|
| 89 | void __ADIC_RevStorePlain(__ADIC_RevType *adic_rev)
|
|---|
| 90 | {
|
|---|
| 91 | adic_rev->arg_store = TRUE;
|
|---|
| 92 | adic_rev->arg_restore = FALSE;
|
|---|
| 93 | adic_rev->res_store = FALSE;
|
|---|
| 94 | adic_rev->res_restore = FALSE;
|
|---|
| 95 | adic_rev->plain = TRUE;
|
|---|
| 96 | adic_rev->tape = FALSE;
|
|---|
| 97 | adic_rev->adjoint = FALSE;
|
|---|
| 98 | }
|
|---|
| 99 | void __ADIC_RevRestoreTape(__ADIC_RevType *adic_rev)
|
|---|
| 100 | {
|
|---|
| 101 | adic_rev->arg_store = FALSE;
|
|---|
| 102 | adic_rev->arg_restore = TRUE;
|
|---|
| 103 | adic_rev->res_store = FALSE;
|
|---|
| 104 | adic_rev->res_restore = FALSE;
|
|---|
| 105 | adic_rev->plain = FALSE;
|
|---|
| 106 | adic_rev->tape = TRUE;
|
|---|
| 107 | adic_rev->adjoint = FALSE;
|
|---|
| 108 | }
|
|---|
| 109 |
|
|---|