Skip to content

Commit

Permalink
Add macros to LsHmm_forward_matrix and LsHmm_backward_matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Oct 6, 2023
1 parent 25116f6 commit c5ccb42
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions python/_tskitmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -13254,8 +13254,10 @@ LsHmm_forward_matrix(LsHmm *self, PyObject *args)
PyExc_ValueError, "haplotype array must have dimension (num_sites,)");
goto out;
}
err = tsk_ls_hmm_forward(self->ls_hmm, PyArray_DATA(haplotype_array),
compressed_matrix->compressed_matrix, TSK_NO_INIT);
Py_BEGIN_ALLOW_THREADS err
= tsk_ls_hmm_forward(self->ls_hmm, PyArray_DATA(haplotype_array),
compressed_matrix->compressed_matrix, TSK_NO_INIT);
Py_END_ALLOW_THREADS;
if (err != 0) {
handle_library_error(err);
goto out;
Expand Down Expand Up @@ -13310,9 +13312,10 @@ LsHmm_backward_matrix(LsHmm *self, PyObject *args)
PyExc_ValueError, "forward_norm array must have dimension (num_sites,)");
goto out;
}
err = tsk_ls_hmm_backward(self->ls_hmm, PyArray_DATA(haplotype_array),
PyArray_DATA(forward_norm_array), compressed_matrix->compressed_matrix,
TSK_NO_INIT);
Py_BEGIN_ALLOW_THREADS err = tsk_ls_hmm_backward(self->ls_hmm,
PyArray_DATA(haplotype_array), PyArray_DATA(forward_norm_array),
compressed_matrix->compressed_matrix, TSK_NO_INIT);
Py_END_ALLOW_THREADS;
if (err != 0) {
handle_library_error(err);
goto out;
Expand Down Expand Up @@ -13353,8 +13356,9 @@ LsHmm_viterbi_matrix(LsHmm *self, PyObject *args)
PyExc_ValueError, "haplotype array must have dimension (num_sites,)");
goto out;
}
err = tsk_ls_hmm_viterbi(self->ls_hmm, PyArray_DATA(haplotype_array),
viterbi_matrix->viterbi_matrix, TSK_NO_INIT);
Py_BEGIN_ALLOW_THREADS err = tsk_ls_hmm_viterbi(self->ls_hmm,
PyArray_DATA(haplotype_array), viterbi_matrix->viterbi_matrix, TSK_NO_INIT);
Py_END_ALLOW_THREADS;
if (err != 0) {
handle_library_error(err);
goto out;
Expand Down

0 comments on commit c5ccb42

Please sign in to comment.