Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite delta matrix in rust #595

Open
wants to merge 138 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
615fc27
wip delta matrix
AviAvni Mar 25, 2024
b1ef4a1
Merge branch 'master' into delta-matrix
AviAvni Mar 25, 2024
fa17331
fix tabs and comments
AviAvni Mar 25, 2024
cbbb241
fix tests
AviAvni Mar 26, 2024
89d6c98
update
AviAvni Mar 26, 2024
33940a5
fix build
AviAvni Mar 28, 2024
abdfff5
update
AviAvni Mar 28, 2024
f3e5f01
update
AviAvni Mar 28, 2024
ace5c2b
update
AviAvni Apr 2, 2024
5c9f4d8
Merge branch 'master' into delta-matrix
AviAvni Apr 2, 2024
81f5a8d
Merge branch 'master' into delta-matrix
AviAvni Apr 7, 2024
d8b72a7
Merge branch 'master' into delta-matrix
AviAvni Apr 9, 2024
4937899
address review
AviAvni Apr 16, 2024
f5ac937
Merge branch 'master' into delta-matrix
AviAvni Apr 16, 2024
4cf3f0d
rename RG to Delta
AviAvni Apr 16, 2024
7111fc4
address review
AviAvni May 5, 2024
70e02f0
address review
AviAvni May 5, 2024
a25da1c
Merge branch 'master' into delta-matrix
AviAvni May 5, 2024
b53a776
fix merge
AviAvni May 5, 2024
eeb387b
address review
AviAvni May 5, 2024
d6332b1
address review
AviAvni May 5, 2024
5ab1b5a
implement new incident matrix approach
AviAvni May 8, 2024
f1b57ab
Merge branch 'master' into delta-matrix
AviAvni May 15, 2024
2ae6ed8
address review
AviAvni May 15, 2024
def1a16
address review
AviAvni May 16, 2024
ebfe445
address review
AviAvni May 16, 2024
09d1b7a
fix
AviAvni May 16, 2024
903c00a
address review
AviAvni May 19, 2024
4f340b4
Merge branch 'master' into delta-matrix
AviAvni May 19, 2024
a558020
address review
AviAvni May 19, 2024
7ebafeb
address review
AviAvni May 20, 2024
b5d14f7
address review
AviAvni May 20, 2024
a58a624
address review
AviAvni May 20, 2024
f8b3713
Merge branch 'master' into delta-matrix
AviAvni May 20, 2024
41ec2d2
address review
AviAvni May 20, 2024
a05199b
Merge branch 'delta-matrix' of https://github.com/FalkorDB/FalkorDB i…
AviAvni May 20, 2024
2aa805f
iterators mutch more efficient
AviAvni May 21, 2024
fec36c1
run rust unit tests
AviAvni May 21, 2024
980eb5a
rewrite test
AviAvni May 21, 2024
3bcf342
rewrite tests
AviAvni May 22, 2024
b7b5dda
address review
AviAvni May 22, 2024
93088e6
rewrite tests
AviAvni May 26, 2024
e7deba3
fix make file
AviAvni May 26, 2024
96508e8
rewrite tests
AviAvni May 28, 2024
144d546
update
AviAvni May 29, 2024
d04f36e
address review
AviAvni May 29, 2024
81e21f6
address review
AviAvni May 29, 2024
7e1dbab
fix
AviAvni May 29, 2024
fdcf95e
Merge branch 'master' into delta-matrix
AviAvni May 30, 2024
23d5056
Merge branch 'master' into delta-matrix
AviAvni Jun 6, 2024
eb46032
address review
AviAvni Jun 16, 2024
929bf84
improve perf
AviAvni Jun 17, 2024
43308cf
fix
AviAvni Jun 17, 2024
7be62f0
fix cond
AviAvni Jun 17, 2024
4173e3c
address review
AviAvni Jun 24, 2024
72966f8
fix
AviAvni Jun 24, 2024
5834e29
fix
AviAvni Jun 24, 2024
1be8df0
fix
AviAvni Jun 24, 2024
0fe7f41
fix
AviAvni Jun 24, 2024
ad90708
fix
AviAvni Jun 24, 2024
621705a
fix
AviAvni Jun 25, 2024
b589b9e
fix
AviAvni Jun 25, 2024
c84f9bf
fix
AviAvni Jun 25, 2024
b7082bc
fix
AviAvni Jun 26, 2024
f5f92bd
fix
AviAvni Jun 26, 2024
ed1d2fa
fix
AviAvni Jun 27, 2024
e47b26b
fix
AviAvni Jun 27, 2024
118b556
reuse multi edge ids
AviAvni Jun 27, 2024
0b24001
Merge branch 'master' into delta-matrix
AviAvni Jun 27, 2024
37bf3fb
fix performance
AviAvni Jun 27, 2024
618809c
run rust unit tests
AviAvni Jun 30, 2024
aa485bb
address review
AviAvni Jun 30, 2024
e00437d
install llvm 17
AviAvni Jun 30, 2024
524e454
fix
AviAvni Jun 30, 2024
f8a0ec8
fix
AviAvni Jun 30, 2024
ddbc68b
fix for llvm 17
AviAvni Jun 30, 2024
739c054
Merge branch 'delta-matrix' of https://github.com/FalkorDB/FalkorDB i…
AviAvni Jun 30, 2024
abd9e02
fix
AviAvni Jun 30, 2024
a2b61a3
fix
AviAvni Jun 30, 2024
c03bb4e
fix
AviAvni Jun 30, 2024
ac930e2
fix coverage
AviAvni Jun 30, 2024
5990b1c
fix for gcov
AviAvni Jun 30, 2024
660ff65
fix
AviAvni Jun 30, 2024
93d44bb
Merge branch 'delta-matrix' of https://github.com/FalkorDB/FalkorDB i…
AviAvni Jun 30, 2024
5f0be1a
Merge branch 'master' into delta-matrix
AviAvni Jul 1, 2024
b8fdb68
address review
AviAvni Jul 1, 2024
abde67d
address review
AviAvni Jul 4, 2024
066cb3d
address review
AviAvni Jul 4, 2024
172c65d
fix build
AviAvni Jul 7, 2024
4d7975e
update rs
AviAvni Jul 7, 2024
79dbeef
fix
AviAvni Jul 7, 2024
ec88e27
fix
AviAvni Jul 8, 2024
f75cc99
remove
AviAvni Jul 8, 2024
813699b
remove
AviAvni Jul 8, 2024
669799a
add
AviAvni Jul 8, 2024
204ee7b
change coverage flags
AviAvni Jul 8, 2024
d87fa12
fix
AviAvni Jul 8, 2024
969fbae
try
AviAvni Jul 8, 2024
deef8bb
try
AviAvni Jul 8, 2024
900a57f
fix
AviAvni Jul 8, 2024
d30a79e
Merge branch 'master' into delta-matrix
AviAvni Jul 9, 2024
58bb9e8
fix
AviAvni Jul 9, 2024
53adc1d
don't use cache
AviAvni Jul 9, 2024
a72b1c4
fix
AviAvni Jul 9, 2024
6af8548
fix
AviAvni Jul 9, 2024
b5b0927
fix
AviAvni Jul 9, 2024
95f5728
fix
AviAvni Jul 9, 2024
68d279c
fix coverage i think?
EmilyMatt Jul 10, 2024
ed3c07c
try new regex
EmilyMatt Jul 10, 2024
346db59
Merge branch 'master' into delta-matrix
AviAvni Jul 10, 2024
1545cad
upload relevant files only
EmilyMatt Jul 10, 2024
6ea4cab
Ok maybe the clean was excessive
EmilyMatt Jul 10, 2024
97bb2a6
disable search to avoid uploading gcov
EmilyMatt Jul 10, 2024
4c816c1
more options
EmilyMatt Jul 10, 2024
d6bfa46
try uploading lcov format
EmilyMatt Jul 10, 2024
03b8350
try uploading lcov format
EmilyMatt Jul 10, 2024
526d09d
why the hell does this continue
EmilyMatt Jul 10, 2024
0bc526c
simply add || true, but wait for llvm apt to be available again
EmilyMatt Jul 10, 2024
cb37636
Merge branch 'master' into delta-matrix
AviAvni Jul 17, 2024
f83385d
Merge branch 'master' into delta-matrix
AviAvni Aug 25, 2024
7b433f1
fix
AviAvni Aug 25, 2024
9ca6c21
bulk create edges
AviAvni Aug 27, 2024
0e5ce6a
fix leak
AviAvni Aug 27, 2024
5647024
fix leak and perf
AviAvni Aug 27, 2024
648fddd
fix build
AviAvni Sep 1, 2024
de46be7
fix
AviAvni Sep 1, 2024
8f8525a
clean
AviAvni Sep 1, 2024
9ed51b6
fix
AviAvni Sep 1, 2024
00b0638
change key
AviAvni Sep 1, 2024
1b729c3
cancel prev benchmark ci
AviAvni Sep 1, 2024
03dcfcb
change cache key
AviAvni Sep 1, 2024
93125d9
address review
AviAvni Sep 8, 2024
48c2d6c
address review
AviAvni Sep 8, 2024
a2f7fae
address review
AviAvni Sep 8, 2024
a077935
Merge branch 'master' into delta-matrix
AviAvni Sep 8, 2024
65dd69c
address review
AviAvni Sep 9, 2024
28f2a39
address review
AviAvni Sep 9, 2024
d8ff5cd
fix leak
AviAvni Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ set(FALKORDB_OBJECTS $<TARGET_OBJECTS:falkordb>)
find_package(OpenSSL)

lists_from_env(GRAPHBLAS LIBXXHASH RAX LIBCYPHER_PARSER REDISEARCH_LIBS UTF8PROC ONIGURUMA FalkorDBRS)
set(FALKORDB_LIBS ${GRAPHBLAS} ${LIBXXHASH} ${RAX} ${LIBCYPHER_PARSER} ${REDISEARCH_LIBS} ${UTF8PROC} ${ONIGURUMA} ${FalkorDBRS} OpenSSL::SSL)
set(FALKORDB_LIBS ${FalkorDBRS} ${GRAPHBLAS} ${LIBXXHASH} ${RAX} ${LIBCYPHER_PARSER} ${REDISEARCH_LIBS} ${UTF8PROC} ${ONIGURUMA} OpenSSL::SSL)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Missing required library in deps/FalkorDB-core-rs.

The library libfalkordb_rs.a is missing in the deps/FalkorDB-core-rs directory. Please ensure that all required libraries are available for the integration to work correctly.

  • deps/FalkorDB-core-rs/libfalkordb_rs.a
Analysis chain

Verify the integration of the new dependency.

Ensure that the new dependency deps/FalkorDB-core-rs is correctly integrated and all required libraries are available.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the presence of the new dependency and its libraries.

# Test: Check for the presence of the new dependency directory.
if [ ! -d "deps/FalkorDB-core-rs" ]; then
  echo "Dependency directory deps/FalkorDB-core-rs is missing."
  exit 1
fi

# Test: Check for the presence of the required libraries in the new dependency.
required_libs=("libfalkordb_rs.a" "libfalkordb_rs.so")
for lib in "${required_libs[@]}"; do
  if ! find deps/FalkorDB-core-rs -name "$lib" | grep -q .; then
    echo "Required library $lib is missing in deps/FalkorDB-core-rs."
    exit 1
  fi
done

echo "All required libraries are present."

Length of output: 354


target_link_options(falkordb PRIVATE ${CMAKE_LD_FLAGS_LIST} ${CMAKE_SO_LD_FLAGS_LIST})
target_link_libraries(falkordb PRIVATE ${FALKORDB_LIBS} ${CMAKE_LD_LIBS})
Expand Down
2 changes: 1 addition & 1 deletion deps/FalkorDB-rs
28 changes: 14 additions & 14 deletions src/algorithms/all_neighbors.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ static void _AllNeighborsCtx_CollectNeighbors
) {
ctx->current_level++;
if(ctx->current_level == array_len(ctx->levels)) {
RG_MatrixTupleIter iter = {0};
RG_MatrixTupleIter_AttachRange(&iter, ctx->M, id, id);
Delta_MatrixTupleIter iter = {0};
Delta_MatrixTupleIter_AttachRange(&iter, ctx->M, id, id);
array_append(ctx->levels, iter);
} else {
RG_MatrixTupleIter_iterate_row(&ctx->levels[ctx->current_level], id);
Delta_MatrixTupleIter_iterate_row(&ctx->levels[ctx->current_level], id);
}
}

void AllNeighborsCtx_Reset
(
AllNeighborsCtx *ctx, // all neighbors context to reset
EntityID src, // source node from which to traverse
RG_Matrix M, // matrix describing connections
Delta_Matrix M, // matrix describing connections
uint minLen, // minimum traversal depth
uint maxLen // maximum traversal depth
) {
Expand All @@ -53,15 +53,15 @@ void AllNeighborsCtx_Reset
ctx->visited_nodes = HashTableCreate(&def_dt);

// dummy iterator at level 0
array_append(ctx->levels, (RG_MatrixTupleIter) {0});
array_append(ctx->levels, (Delta_MatrixTupleIter) {0});
}

AllNeighborsCtx *AllNeighborsCtx_New
(
EntityID src, // source node from which to traverse
RG_Matrix M, // matrix describing connections
uint minLen, // minimum traversal depth
uint maxLen // maximum traversal depth
EntityID src, // source node from which to traverse
Delta_Matrix M, // matrix describing connections
uint minLen, // minimum traversal depth
uint maxLen // maximum traversal depth
) {
ASSERT(M != NULL);
ASSERT(src != INVALID_ENTITY_ID);
Expand All @@ -72,14 +72,14 @@ AllNeighborsCtx *AllNeighborsCtx_New
ctx->src = src;
ctx->minLen = minLen;
ctx->maxLen = maxLen;
ctx->levels = array_new(RG_MatrixTupleIter, 1);
ctx->levels = array_new(Delta_MatrixTupleIter, 1);
ctx->visited = array_new(EntityID, 1);
ctx->first_pull = true;
ctx->current_level = 0;
ctx->visited_nodes = HashTableCreate(&def_dt);

// Dummy iterator at level 0
array_append(ctx->levels, (RG_MatrixTupleIter) {0});
array_append(ctx->levels, (Delta_MatrixTupleIter) {0});

return ctx;
}
Expand Down Expand Up @@ -112,10 +112,10 @@ EntityID AllNeighborsCtx_NextNeighbor

while(ctx->current_level > 0) {
ASSERT(ctx->current_level < array_len(ctx->levels));
RG_MatrixTupleIter *it = &ctx->levels[ctx->current_level];
Delta_MatrixTupleIter *it = &ctx->levels[ctx->current_level];

GrB_Index dest_id;
GrB_Info info = RG_MatrixTupleIter_next_UINT64(it, NULL, &dest_id, NULL);
GrB_Info info = Delta_MatrixTupleIter_next_BOOL(it, NULL, &dest_id, NULL);

if(info == GxB_EXHAUSTED) {
// backtrack
Expand Down Expand Up @@ -160,7 +160,7 @@ void AllNeighborsCtx_Free

uint count = array_len(ctx->levels);
for (uint i = 0; i < count; i++) {
RG_MatrixTupleIter_detach(ctx->levels + i);
Delta_MatrixTupleIter_detach(ctx->levels + i);
}
array_free(ctx->levels);
array_free(ctx->visited);
Expand Down
32 changes: 16 additions & 16 deletions src/algorithms/all_neighbors.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "../../deps/GraphBLAS/Include/GraphBLAS.h"
#include "../util/dict.h"
#include "../graph/rg_matrix/rg_matrix.h"
#include "../graph/rg_matrix/rg_matrix_iter.h"
#include "../graph/delta_matrix/delta_matrix.h"
#include "../graph/delta_matrix/delta_matrix_iter.h"
#include "../graph/entities/node.h"

// performs iterative DFS from 'src'
Expand All @@ -22,32 +22,32 @@
// current path

typedef struct {
EntityID src; // traverse begin here
RG_Matrix M; // adjacency matrix
uint minLen; // minimum required depth
uint maxLen; // maximum allowed depth
int current_level; // current depth
bool first_pull; // first call to Next
EntityID *visited; // visited nodes
RG_MatrixTupleIter *levels; // array of neighbors iterator
dict *visited_nodes; // visited nodes
EntityID src; // traverse begin here
Delta_Matrix M; // adjacency matrix
uint minLen; // minimum required depth
uint maxLen; // maximum allowed depth
int current_level; // current depth
bool first_pull; // first call to Next
EntityID *visited; // visited nodes
Delta_MatrixTupleIter *levels; // array of neighbors iterator
dict *visited_nodes; // visited nodes
} AllNeighborsCtx;

void AllNeighborsCtx_Reset
(
AllNeighborsCtx *ctx, // all neighbors context to reset
EntityID src, // source node from which to traverse
RG_Matrix M, // matrix describing connections
Delta_Matrix M, // matrix describing connections
uint minLen, // minimum traversal depth
uint maxLen // maximum traversal depth
);

AllNeighborsCtx *AllNeighborsCtx_New
(
EntityID src, // source node from which to traverse
RG_Matrix M, // matrix describing connections
uint minLen, // minimum traversal depth
uint maxLen // maximum traversal depth
EntityID src, // source node from which to traverse
Delta_Matrix M, // matrix describing connections
uint minLen, // minimum traversal depth
uint maxLen // maximum traversal depth
);

// produce next reachable destination node
Expand Down
18 changes: 9 additions & 9 deletions src/arithmetic/algebraic_expression.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "../graph/graph.h"
#include "../graph/query_graph.h"

static RG_Matrix IDENTITY_MATRIX = (RG_Matrix)0x31032017; // identity matrix
static Delta_Matrix IDENTITY_MATRIX = (Delta_Matrix)0x31032017; // identity matrix

// Matrix, vector operations
typedef enum {
Expand Down Expand Up @@ -40,7 +40,7 @@ struct AlgebraicExpression {
const char *dest; // alias given to operand's columns
const char *edge; // alias given to operand (edge)
const char *label; // label attached to matrix
RG_Matrix matrix; // matrix
Delta_Matrix matrix; // matrix
} operand;
struct {
AL_EXP_OP op; // operation: `*`,`+`,`transpose`
Expand Down Expand Up @@ -72,7 +72,7 @@ AlgebraicExpression *AlgebraicExpression_NewOperation
// Create a new AlgebraicExpression operand node.
AlgebraicExpression *AlgebraicExpression_NewOperand
(
RG_Matrix mat, // Matrix.
Delta_Matrix mat, // Matrix.
bool diagonal, // Is operand a diagonal matrix?
const char *src, // Operand row domain (src node).
const char *dest, // Operand column domain (destination node).
Expand Down Expand Up @@ -185,31 +185,31 @@ AlgebraicExpression *AlgebraicExpression_RemoveDest
void AlgebraicExpression_MultiplyToTheLeft
(
AlgebraicExpression **root,
RG_Matrix m
Delta_Matrix m
);

// Multiply expression to the right by operand
// (exp) * m
void AlgebraicExpression_MultiplyToTheRight
(
AlgebraicExpression **root,
RG_Matrix m
Delta_Matrix m
);

// Add expression to the left by operand
// m + (exp)
void AlgebraicExpression_AddToTheLeft
(
AlgebraicExpression **root,
RG_Matrix m
Delta_Matrix m
);

// Add expression to the right by operand
// (exp) + m
void AlgebraicExpression_AddToTheRight
(
AlgebraicExpression **root,
RG_Matrix m
Delta_Matrix m
);

// Transpose expression
Expand All @@ -220,10 +220,10 @@ void AlgebraicExpression_Transpose
);

// Evaluate expression tree.
RG_Matrix AlgebraicExpression_Eval
Delta_Matrix AlgebraicExpression_Eval
(
const AlgebraicExpression *exp, // Root node
RG_Matrix res // Result output
Delta_Matrix res // Result output
);

// locates operand based on row,column domain and edge or label
Expand Down
10 changes: 5 additions & 5 deletions src/arithmetic/algebraic_expression/algebraic_expression.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ AlgebraicExpression *AlgebraicExpression_NewOperation
// Create a new AlgebraicExpression operand node
AlgebraicExpression *AlgebraicExpression_NewOperand
(
RG_Matrix mat, // Matrix
Delta_Matrix mat, // Matrix
bool diagonal, // Is operand a diagonal matrix?
const char *src, // Operand row domain (src node)
const char *dest, // Operand column domain (destination node)
Expand Down Expand Up @@ -490,7 +490,7 @@ AlgebraicExpression *AlgebraicExpression_RemoveDest
void AlgebraicExpression_MultiplyToTheLeft
(
AlgebraicExpression **root,
RG_Matrix m
Delta_Matrix m
) {
ASSERT(root && m);
AlgebraicExpression *rhs = *root;
Expand All @@ -508,7 +508,7 @@ void AlgebraicExpression_MultiplyToTheLeft
void AlgebraicExpression_MultiplyToTheRight
(
AlgebraicExpression **root,
RG_Matrix m
Delta_Matrix m
) {
ASSERT(root && m);
AlgebraicExpression *lhs = *root;
Expand All @@ -526,7 +526,7 @@ void AlgebraicExpression_MultiplyToTheRight
void AlgebraicExpression_AddToTheLeft
(
AlgebraicExpression **root,
RG_Matrix m
Delta_Matrix m
) {
ASSERT(root && m);
AlgebraicExpression *rhs = *root;
Expand All @@ -545,7 +545,7 @@ void AlgebraicExpression_AddToTheLeft
void AlgebraicExpression_AddToTheRight
(
AlgebraicExpression **root,
RG_Matrix m
Delta_Matrix m
) {
ASSERT(root && m);
AlgebraicExpression *lhs = *root;
Expand Down
28 changes: 14 additions & 14 deletions src/arithmetic/algebraic_expression/algebraic_expression_add.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#include "../../query_ctx.h"
#include "../algebraic_expression.h"

RG_Matrix _Eval_Add
Delta_Matrix _Eval_Add
(
const AlgebraicExpression *exp,
RG_Matrix res
Delta_Matrix res
) {
ASSERT(exp);
ASSERT(AlgebraicExpression_ChildCount(exp) > 1);
Expand All @@ -22,9 +22,9 @@
GrB_Index ncols; // number of columns of operand

bool res_in_use = false; // can we use `res` for intermediate evaluation
RG_Matrix A = NULL; // left operand
RG_Matrix B = NULL; // right operand
RG_Matrix inter = NULL; // intermediate matrix
Delta_Matrix A = NULL; // left operand
Delta_Matrix B = NULL; // right operand
Delta_Matrix inter = NULL; // intermediate matrix

// get left and right operands
AlgebraicExpression *left = CHILD_AT(exp, 0);
Expand All @@ -45,9 +45,9 @@
if(right->type == AL_OPERATION) {
if(res_in_use) {
// `res` is in use, create an additional matrix
RG_Matrix_nrows(&nrows, res);
RG_Matrix_ncols(&ncols, res);
info = RG_Matrix_new(&inter, GrB_BOOL, nrows, ncols);
Delta_Matrix_nrows(&nrows, res);
Delta_Matrix_ncols(&ncols, res);
info = Delta_Matrix_new(&inter, GrB_BOOL, nrows, ncols, false);
ASSERT(info == GrB_SUCCESS);
B = AlgebraicExpression_Eval(right, inter);
} else {
Expand All @@ -62,7 +62,7 @@
// perform addition
//--------------------------------------------------------------------------

info = RG_eWiseAdd(res, GxB_ANY_PAIR_BOOL, A, B);
info = Delta_eWiseAdd(res, GxB_ANY_PAIR_BOOL, A, B);
ASSERT(info == GrB_SUCCESS);

uint child_count = AlgebraicExpression_ChildCount(exp);
Expand All @@ -76,21 +76,21 @@
// 'right' represents either + or * operation
if(inter == NULL) {
// can't use `res`, use an intermidate matrix
RG_Matrix_nrows(&nrows, res);
RG_Matrix_ncols(&ncols, res);
info = RG_Matrix_new(&inter, GrB_BOOL, nrows, ncols);
Delta_Matrix_nrows(&nrows, res);
Delta_Matrix_ncols(&ncols, res);
info = Delta_Matrix_new(&inter, GrB_BOOL, nrows, ncols, false);

Check warning on line 81 in src/arithmetic/algebraic_expression/algebraic_expression_add.c

View check run for this annotation

Codecov / codecov/patch

src/arithmetic/algebraic_expression/algebraic_expression_add.c#L79-L81

Added lines #L79 - L81 were not covered by tests
ASSERT(info == GrB_SUCCESS);
}
AlgebraicExpression_Eval(right, inter);
B = inter;
}

// perform addition
info = RG_eWiseAdd(res, GxB_ANY_PAIR_BOOL, res, B);
info = Delta_eWiseAdd(res, GxB_ANY_PAIR_BOOL, res, B);
ASSERT(info == GrB_SUCCESS);
}

if(inter != NULL) RG_Matrix_free(&inter);
if(inter != NULL) Delta_Matrix_free(&inter);
return res;
}

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ AlgebraicExpression *_AlgebraicExpression_FromString
int len = 0;
char *alias;
const char *operand;
RG_Matrix m;
Delta_Matrix m;
AlgebraicExpression *op;
AlgebraicExpression *rhs;
AlgebraicExpression *root = NULL;
Expand Down Expand Up @@ -83,7 +83,7 @@ AlgebraicExpression *_AlgebraicExpression_FromString

m = NULL;
if(matrices) {
m = (RG_Matrix)raxFind(matrices, (unsigned char *)alias, strlen(alias));
m = (Delta_Matrix)raxFind(matrices, (unsigned char *)alias, strlen(alias));
ASSERT(m != raxNotFound && "Missing matrix");
}
root = AlgebraicExpression_NewOperand(m, false, alias, alias, NULL, NULL);
Expand Down
Loading
Loading