| 181 | } |
| 182 | |
| 183 | AlgebraicExpression **build_algebraic_expression(const char *query, AST **master_ast) { |
| 184 | cypher_parse_result_t *parse_result = cypher_parse(query, NULL, NULL, CYPHER_PARSE_ONLY_STATEMENTS); |
| 185 | *master_ast = AST_Build(parse_result); |
| 186 | AST *ast = AST_NewSegment(*master_ast, 0, cypher_ast_query_nclauses((*master_ast)->root)); |
| 187 | QueryGraph *qg = BuildQueryGraph(ast); |
| 188 | AlgebraicExpression **ae = AlgebraicExpression_FromQueryGraph(qg); |
| 189 | _AlgebraicExpression_RemoveRedundentOperands(ae, qg); |
| 190 | |
| 191 | uint exp_count = array_len(ae); |
| 192 | for(uint i = 0; i < exp_count; i++) { |
| 193 | AlgebraicExpression_Optimize(ae + i); |
| 194 | } |
| 195 | |
| 196 | QueryGraph_Free(qg); |
| 197 | AST_Free(ast); |
| 198 | |
| 199 | return ae; |
| 200 | } |
| 201 | |
| 202 | void _print_matrix(GrB_Matrix mat) { |
| 203 | GrB_Index ncols, nrows, nvals; |
no test coverage detected