MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _traverse

Function _traverse

src/execution_plan/ops/op_conditional_traverse.c:48–70  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

46// removed filter matrix from original expression
47// clears filter matrix
48void _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
72OpBase *NewCondTraverseOp
73(

Callers 1

CondTraverseConsumeFunction · 0.70

Calls 7

Graph_RequiredMatrixDimFunction · 0.85
RG_Matrix_newFunction · 0.85
AlgebraicExpression_EvalFunction · 0.85
_populate_filter_matrixFunction · 0.70

Tested by

no test coverage detected