Skip to content

Commit

Permalink
Merge pull request #405 from jeanlucf22/ellblock_fixes
Browse files Browse the repository at this point in the history
Fix a couple of bugs in ellblock
  • Loading branch information
nicolasbock authored Aug 10, 2020
2 parents f02d00f + e86bb01 commit 7cb1ce7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/C-interface/ellblock/bml_allocate_ellblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ bml_get_block_sizes(
{
s_default_bsize[ib] = s_default_block_dim;
}
s_default_bsize[s_nb - 1] = N % s_default_block_dim;
s_default_bsize[s_nb - 1] = N - s_default_block_dim * (s_nb - 1);
}
return s_default_bsize;
}
Expand Down Expand Up @@ -224,6 +224,8 @@ bml_zero_matrix_ellblock(
int M,
bml_distribution_mode_t distrib_mode)
{
assert(N >= M);

bml_matrix_ellblock_t *A = NULL;

switch (matrix_precision)
Expand Down
4 changes: 3 additions & 1 deletion src/C-interface/ellblock/bml_allocate_ellblock_typed.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ void TYPED_FUNC(
A->indexb[ind - 1] = A->indexb[ind];
A->ptr_value[ind - 1] = A->ptr_value[ind];
}
A->ptr_value[A->nnzb[ib] - 1] = NULL;
int ind = ROWMAJOR(ib, A->nnzb[ib] - 1, A->NB, A->MB);
A->ptr_value[ind] = NULL;
A->indexb[ind] = -1;
break;
}
}
Expand Down

0 comments on commit 7cb1ce7

Please sign in to comment.