/ This function is used for block filter evaluation. We use here a */ fuzzy logic between the values returned by evaluation blocks: */ -2: the condition will be always false for the rest of the file. */ -1: the condition will be false for the whole group. */ 0: the condition may be true for some of the group values. */ 1: the condition will be true for the whole gr
| 115 | /* 2: the condition will be always true for the rest of the file. */ |
| 116 | /***********************************************************************/ |
| 117 | int BLKFILLOG::BlockEval(PGLOBAL g) |
| 118 | { |
| 119 | int i, rc; |
| 120 | |
| 121 | for (i = 0; i < N; i++) { |
| 122 | // 0: Means some block filter value may be True |
| 123 | rc = (Fil[i]) ? Fil[i]->BlockEval(g) : 0; |
| 124 | |
| 125 | if (!i) |
| 126 | Result = (Opc == OP_NOT) ? -rc : rc; |
| 127 | else switch (Opc) { |
| 128 | case OP_AND: |
| 129 | Result = MY_MIN(Result, rc); |
| 130 | break; |
| 131 | case OP_OR: |
| 132 | Result = MY_MAX(Result, rc); |
| 133 | break; |
| 134 | default: |
| 135 | // Should never happen |
| 136 | Result = 0; |
| 137 | return Result; |
| 138 | } // endswitch Opc |
| 139 | |
| 140 | } // endfor i |
| 141 | |
| 142 | return Result; |
| 143 | } // end of BlockEval |
| 144 | |
| 145 | /* ---------------------- Class BLKFILARI----------------------------- */ |
| 146 |