[med-svn] [Git][med-team/pplacer][master] Keep on migrating ...

Andreas Tille (@tille) gitlab at salsa.debian.org
Fri Dec 13 17:18:12 GMT 2024



Andreas Tille pushed to branch master at Debian Med / pplacer


Commits:
afbcd0ea by Andreas Tille at 2024-12-13T18:17:54+01:00
Keep on migrating ...

- - - - -


1 changed file:

- debian/patches/caml_bigarray.patch


Changes:

=====================================
debian/patches/caml_bigarray.patch
=====================================
@@ -40,31 +40,67 @@ Last-Update: 2024-12-13
    gsl_matrix_view m;
    gsl_vector_char_view v;
    double work;
-@@ -34,7 +34,7 @@ CAMLprim value caml_pam(value k_value, v
+@@ -26,15 +26,16 @@ CAMLprim value caml_pam(value k_value, v
+   intnat *res_ptr;
+   int i, k;
+ 
+-  nrow = Bigarray_val(dist_value)->dim[0];
+-  ncol = Bigarray_val(dist_value)->dim[1];
++  struct caml_ba_array *ba = Caml_ba_array_val(dist_value);
++  nrow = ba->dim[0];
++  ncol = ba->dim[1];
+   m = gsl_matrix_view_array(dist, nrow, ncol);
+   v = gsl_vector_char_view_array(keep, nrow);
+   k = Int_val(k_value);
    medoids = pam(&m.matrix, k, &v.vector, &work);
  
-   res_bigarr = alloc_bigarray_dims(BIGARRAY_CAML_INT | BIGARRAY_C_LAYOUT, 1, NULL, k);
+-  res_bigarr = alloc_bigarray_dims(BIGARRAY_CAML_INT | BIGARRAY_C_LAYOUT, 1, NULL, k);
 -  res_ptr = Data_bigarray_val(res_bigarr);
++  res_bigarr = caml_ba_alloc_dims(CAML_BA_INT32 | CAML_BA_C_LAYOUT, 1, NULL, k);
 +  res_ptr = Caml_ba_array_val(res_bigarr);
    medoids_ptr = medoids;
    for (i = 0; i < k; ++i) {
      *res_ptr++ = *medoids_ptr++;
 --- a/pplacer_src/linear_c.c
 +++ b/pplacer_src/linear_c.c
-@@ -29,9 +29,9 @@
+@@ -29,18 +29,26 @@
  CAMLprim value gemmish_c(value dst_value, value a_value, value b_value)
  {
    CAMLparam3(dst_value, a_value, b_value);
 -  double *dst = Data_bigarray_val(dst_value);
 -  double *a = Data_bigarray_val(a_value);
 -  double *b = Data_bigarray_val(b_value);
-+  double *dst = Caml_ba_array_val(dst_value);
-+  double *a = Caml_ba_array_val(a_value);
-+  double *b = Caml_ba_array_val(b_value);
-   int n_states = Bigarray_val(a_value)->dim[0];
-   int n_sites = Bigarray_val(b_value)->dim[0];
+-  int n_states = Bigarray_val(a_value)->dim[0];
+-  int n_sites = Bigarray_val(b_value)->dim[0];
++  struct caml_ba_array *dst_ba = Caml_ba_array_val(dst_value);
++  struct caml_ba_array *a_ba = Caml_ba_array_val(a_value);
++  struct caml_ba_array *b_ba = Caml_ba_array_val(b_value);
++  double *dst = (double *)Caml_ba_data_val(dst_ba);
++  double *a = (double *)Caml_ba_data_val(a_ba);
++  double *b = (double *)Caml_ba_data_val(b_ba);
++
++  int n_states = a_ba->dim[0];
++  int n_sites = b_ba->dim[0];
++
    int site, i, j;
-@@ -92,10 +92,10 @@ CAMLprim value gemmish_c(value dst_value
+   double *a_start = a;
+-  if( n_states != Bigarray_val(a_value)->dim[1] ||
+-      n_sites  != Bigarray_val(dst_value)->dim[0] ||
+-      n_states != Bigarray_val(dst_value)->dim[1] ) {
+-    printf("bad input dimensions!");
+-  };
++
++  // Assuming n_states == a_ba->dim[1] for consistency
++  if (n_states != a_ba->dim[1] ||
++      n_sites  != dst_ba->dim[0] ||
++      n_states != dst_ba->dim[1]) {
++      printf("bad input dimensions!\n");
++  }
++
+   if(n_states == 4) {
+     for(site=0; site < n_sites; site++) {
+       // start back at the top of the matrix
+@@ -92,10 +100,10 @@ CAMLprim value gemmish_c(value dst_value
  CAMLprim value dediagonalize (value dst_value, value u_value, value lambda_value, value uit_value)
  {
    CAMLparam4(dst_value, u_value, lambda_value, uit_value);
@@ -79,7 +115,7 @@ Last-Update: 2024-12-13
    double *uit_p;
    int n = Bigarray_val(lambda_value)->dim[0];
    int i, j, k;
-@@ -152,7 +152,7 @@ CAMLprim value dediagonalize (value dst_
+@@ -152,7 +160,7 @@ CAMLprim value dediagonalize (value dst_
  CAMLprim value mat_print_c(value x_value)
  {
    CAMLparam1(x_value);
@@ -88,7 +124,7 @@ Last-Update: 2024-12-13
    int n_sites = (Bigarray_val(x_value)->dim[0]);
    int n_states = (Bigarray_val(x_value)->dim[1]);
    double *loc = x;
-@@ -171,10 +171,10 @@ CAMLprim value mat_log_like3_c(value sta
+@@ -171,10 +179,10 @@ CAMLprim value mat_log_like3_c(value sta
  {
    CAMLparam4(statd_value, x_value, y_value, z_value);
    CAMLlocal1(ml_ll_tot);
@@ -103,7 +139,7 @@ Last-Update: 2024-12-13
    int n_sites = Bigarray_val(x_value)->dim[0];
    int n_states = Bigarray_val(x_value)->dim[1];
    int site, state;
-@@ -218,9 +218,9 @@ CAMLprim value mat_log_like3_c(value sta
+@@ -218,9 +226,9 @@ CAMLprim value mat_log_like3_c(value sta
  CAMLprim value mat_pairwise_prod_c(value dst_value, value x_value, value y_value)
  {
    CAMLparam3(dst_value, x_value, y_value);
@@ -116,7 +152,7 @@ Last-Update: 2024-12-13
    int size = (Bigarray_val(x_value)->dim[0]) * (Bigarray_val(x_value)->dim[1]);
    int i;
    for(i=0; i < size; i++) {
-@@ -232,10 +232,10 @@ CAMLprim value mat_pairwise_prod_c(value
+@@ -232,10 +240,10 @@ CAMLprim value mat_pairwise_prod_c(value
  CAMLprim value mat_statd_pairwise_prod_c(value statd_value, value dst_value, value a_value, value b_value)
  {
    CAMLparam4(statd_value, dst_value, a_value, b_value);
@@ -131,7 +167,7 @@ Last-Update: 2024-12-13
    int n_sites = Bigarray_val(a_value)->dim[0];
    int n_states = Bigarray_val(a_value)->dim[1];
    int site, state;
-@@ -252,9 +252,9 @@ CAMLprim value mat_masked_logdot_c(value
+@@ -252,9 +260,9 @@ CAMLprim value mat_masked_logdot_c(value
  {
    CAMLparam3(x_value, y_value, mask_value);
    CAMLlocal1(ml_ll_tot);
@@ -144,7 +180,7 @@ Last-Update: 2024-12-13
    int n_sites = (Bigarray_val(x_value)->dim[0]);
    int n_states = (Bigarray_val(x_value)->dim[1]);
    if(n_sites != Bigarray_val(mask_value)->dim[0])
-@@ -299,8 +299,8 @@ CAMLprim value mat_bounded_logdot_c(valu
+@@ -299,8 +307,8 @@ CAMLprim value mat_bounded_logdot_c(valu
  {
    CAMLparam4(x_value, y_value, first_value, last_value);
    CAMLlocal1(ml_ll_tot);
@@ -155,7 +191,7 @@ Last-Update: 2024-12-13
    int first = Int_val(first_value);
    int last = Int_val(last_value);
    int n_used = 1 + last - first;
-@@ -345,7 +345,7 @@ CAMLprim value mat_bounded_logdot_c(valu
+@@ -345,7 +353,7 @@ CAMLprim value mat_bounded_logdot_c(valu
  CAMLprim value ten_print_c(value x_value)
  {
    CAMLparam1(x_value);
@@ -164,7 +200,7 @@ Last-Update: 2024-12-13
    int n_rates = (Bigarray_val(x_value)->dim[0]);
    int n_sites = (Bigarray_val(x_value)->dim[1]);
    int n_states = (Bigarray_val(x_value)->dim[2]);
-@@ -368,11 +368,11 @@ CAMLprim value ten_log_like3_c(value sta
+@@ -368,11 +376,11 @@ CAMLprim value ten_log_like3_c(value sta
  {
    CAMLparam5(statd_value, x_value, y_value, z_value, util_value);
    CAMLlocal1(ml_ll_tot);
@@ -181,7 +217,7 @@ Last-Update: 2024-12-13
    int n_rates = Bigarray_val(x_value)->dim[0];
    int n_sites = Bigarray_val(x_value)->dim[1];
    int n_states = Bigarray_val(x_value)->dim[2];
-@@ -426,9 +426,9 @@ CAMLprim value ten_log_like3_c(value sta
+@@ -426,9 +434,9 @@ CAMLprim value ten_log_like3_c(value sta
  CAMLprim value ten_pairwise_prod_c(value dst_value, value x_value, value y_value)
  {
    CAMLparam3(dst_value, x_value, y_value);
@@ -194,7 +230,7 @@ Last-Update: 2024-12-13
    int size =
      (Bigarray_val(x_value)->dim[0])
      * (Bigarray_val(x_value)->dim[1])
-@@ -443,10 +443,10 @@ CAMLprim value ten_pairwise_prod_c(value
+@@ -443,10 +451,10 @@ CAMLprim value ten_pairwise_prod_c(value
  CAMLprim value ten_statd_pairwise_prod_c(value statd_value, value dst_value, value a_value, value b_value)
  {
    CAMLparam4(statd_value, dst_value, a_value, b_value);
@@ -209,7 +245,7 @@ Last-Update: 2024-12-13
    int n_rates = Bigarray_val(a_value)->dim[0];
    int n_sites = Bigarray_val(a_value)->dim[1];
    int n_states = Bigarray_val(a_value)->dim[2];
-@@ -466,10 +466,10 @@ CAMLprim value ten_masked_logdot_c(value
+@@ -466,10 +474,10 @@ CAMLprim value ten_masked_logdot_c(value
  {
    CAMLparam4(x_value, y_value, mask_value, util_value);
    CAMLlocal1(ml_ll_tot);
@@ -224,7 +260,7 @@ Last-Update: 2024-12-13
    int n_rates = Bigarray_val(x_value)->dim[0];
    int n_sites = Bigarray_val(x_value)->dim[1];
    int n_states = Bigarray_val(x_value)->dim[2];
-@@ -542,11 +542,11 @@ CAMLprim value ten_bounded_logdot_c(valu
+@@ -542,11 +550,11 @@ CAMLprim value ten_bounded_logdot_c(valu
  {
    CAMLparam5(x_value, y_value, first_value, last_value, util_value);
    CAMLlocal1(ml_ll_tot);
@@ -239,7 +275,7 @@ Last-Update: 2024-12-13
    int n_rates = Bigarray_val(x_value)->dim[0];
    int n_sites = Bigarray_val(x_value)->dim[1];
    int n_states = Bigarray_val(x_value)->dim[2];
-@@ -607,9 +607,9 @@ CAMLprim value ten_bounded_logdot_c(valu
+@@ -607,9 +615,9 @@ CAMLprim value ten_bounded_logdot_c(valu
  CAMLprim value vec_pairwise_prod_c(value dst_value, value x_value, value y_value)
  {
    CAMLparam3(dst_value, x_value, y_value);
@@ -252,7 +288,7 @@ Last-Update: 2024-12-13
    int i;
    for(i=0; i < Bigarray_val(x_value)->dim[0]; i++) {
      dst[i] = x[i] * y[i];
-@@ -620,7 +620,7 @@ CAMLprim value vec_pairwise_prod_c(value
+@@ -620,7 +628,7 @@ CAMLprim value vec_pairwise_prod_c(value
  CAMLprim value int_vec_tot_c(value x_value)
  {
    CAMLparam1(x_value);
@@ -261,7 +297,7 @@ Last-Update: 2024-12-13
    CAMLlocal1(ml_tot);
    int i, tot = 0;
    for(i=0; i < Bigarray_val(x_value)->dim[0]; i++)
-@@ -632,9 +632,9 @@ CAMLprim value int_vec_tot_c(value x_val
+@@ -632,9 +640,9 @@ CAMLprim value int_vec_tot_c(value x_val
  CAMLprim value int_vec_pairwise_prod_c(value dst_value, value x_value, value y_value)
  {
    CAMLparam3(dst_value, x_value, y_value);
@@ -274,7 +310,7 @@ Last-Update: 2024-12-13
    uint16_t *dst_end = dst + Bigarray_val(dst_value)->dim[0];
    while (dst < dst_end)
      *dst++ = *x++ * *y++;
-@@ -644,9 +644,9 @@ CAMLprim value int_vec_pairwise_prod_c(v
+@@ -644,9 +652,9 @@ CAMLprim value int_vec_pairwise_prod_c(v
  CAMLprim value float_mat_int_vec_mul_c(value dst_value, value mat_value, value vec_value)
  {
    CAMLparam3(dst_value, mat_value, vec_value);



View it on GitLab: https://salsa.debian.org/med-team/pplacer/-/commit/afbcd0ea9d6cc8296f76417e06a943f484970163

-- 
View it on GitLab: https://salsa.debian.org/med-team/pplacer/-/commit/afbcd0ea9d6cc8296f76417e06a943f484970163
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20241213/6568c460/attachment-0001.htm>


More information about the debian-med-commit mailing list