evaluate algebraic expression: prepends filter matrix as the left most operand perform multiplications set iterator over result matrix removed filter matrix from original expression clears filter matrix
| 46 | // removed filter matrix from original expression |
| 47 | // clears filter matrix |
| 48 | void _traverse(OpCondTraverse *op) { |
| 49 | // if op->F is null, this is the first time we are traversing |
| 50 | if(op->F == NULL) { |
| 51 | // create both filter and result matrices |
| 52 | size_t required_dim = Graph_RequiredMatrixDim(op->graph); |
| 53 | RG_Matrix_new(&op->M, GrB_BOOL, op->record_cap, required_dim); |
| 54 | RG_Matrix_new(&op->F, GrB_BOOL, op->record_cap, required_dim); |
| 55 | |
| 56 | // prepend filter matrix to algebraic expression as the leftmost operand |
| 57 | AlgebraicExpression_MultiplyToTheLeft(&op->ae, op->F); |
| 58 | |
| 59 | // optimize the expression tree |
| 60 | AlgebraicExpression_Optimize(&op->ae); |
| 61 | } |
| 62 | |
| 63 | // populate filter matrix |
| 64 | _populate_filter_matrix(op); |
| 65 | |
| 66 | // evaluate expression |
| 67 | AlgebraicExpression_Eval(op->ae, op->M); |
| 68 | |
| 69 | RG_MatrixTupleIter_attach(&op->iter, op->M); |
| 70 | } |
| 71 | |
| 72 | OpBase *NewCondTraverseOp |
| 73 | ( |
no test coverage detected