We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cf8d2f2 commit feb8ad7Copy full SHA for feb8ad7
1 file changed
src/utils/sparse_matrix.c
@@ -63,13 +63,5 @@ Matrix *new_sparse_matrix(const CSR_Matrix *A)
63
Matrix *sparse_matrix_trans(const Sparse_Matrix *self, int *iwork)
64
{
65
CSR_Matrix *AT = transpose(self->csr, iwork);
66
- Sparse_Matrix *sm = (Sparse_Matrix *) calloc(1, sizeof(Sparse_Matrix));
67
- sm->base.m = AT->m;
68
- sm->base.n = AT->n;
69
- sm->base.block_left_mult_vec = sparse_block_left_mult_vec;
70
- sm->base.block_left_mult_sparsity = sparse_block_left_mult_sparsity;
71
- sm->base.block_left_mult_values = sparse_block_left_mult_values;
72
- sm->base.free_fn = sparse_free;
73
- sm->csr = AT;
74
- return &sm->base;
+ return new_sparse_matrix(AT);
75
}
0 commit comments