We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent feb8ad7 commit 4813f42Copy full SHA for 4813f42
1 file changed
src/utils/sparse_matrix.c
@@ -63,5 +63,13 @@ 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
- return new_sparse_matrix(AT);
+ 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;
75
}
0 commit comments