Skip to content

Commit feb8ad7

Browse files
committed
simplify constructor
1 parent cf8d2f2 commit feb8ad7

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

src/utils/sparse_matrix.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,5 @@ Matrix *new_sparse_matrix(const CSR_Matrix *A)
6363
Matrix *sparse_matrix_trans(const Sparse_Matrix *self, int *iwork)
6464
{
6565
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;
66+
return new_sparse_matrix(AT);
7567
}

0 commit comments

Comments
 (0)