@@ -305,6 +305,7 @@ NumericVector cpp_mutual_clustering_all_pairs(
305305 const int n_tip,
306306 const int n_threads = 1
307307) {
308+ TreeDist::check_ntip (n_tip);
308309 const int N = splits_list.size ();
309310 if (N < 2 ) return NumericVector (0 );
310311
@@ -397,6 +398,7 @@ NumericVector cpp_rf_info_all_pairs(
397398 const int n_tip,
398399 const int n_threads = 1
399400) {
401+ TreeDist::check_ntip (n_tip);
400402 const int N = splits_list.size ();
401403 if (N < 2 ) return NumericVector (0 );
402404 const int n_pairs = N * (N - 1 ) / 2 ;
@@ -516,6 +518,7 @@ NumericVector cpp_msd_all_pairs(
516518 const int n_tip,
517519 const int n_threads = 1
518520) {
521+ TreeDist::check_ntip (n_tip);
519522 const int N = splits_list.size ();
520523 if (N < 2 ) return NumericVector (0 );
521524 const int n_pairs = N * (N - 1 ) / 2 ;
@@ -618,6 +621,7 @@ NumericVector cpp_msi_all_pairs(
618621 const int n_tip,
619622 const int n_threads = 1
620623) {
624+ TreeDist::check_ntip (n_tip);
621625 const int N = splits_list.size ();
622626 if (N < 2 ) return NumericVector (0 );
623627 const int n_pairs = N * (N - 1 ) / 2 ;
@@ -710,6 +714,7 @@ NumericVector cpp_shared_phylo_all_pairs(
710714 const int n_tip,
711715 const int n_threads = 1
712716) {
717+ TreeDist::check_ntip (n_tip);
713718 const int N = splits_list.size ();
714719 if (N < 2 ) return NumericVector (0 );
715720 const int n_pairs = N * (N - 1 ) / 2 ;
@@ -875,6 +880,7 @@ NumericVector cpp_jaccard_all_pairs(
875880 const bool allow_conflict = true ,
876881 const int n_threads = 1
877882) {
883+ TreeDist::check_ntip (n_tip);
878884 const int N = splits_list.size ();
879885 if (N < 2 ) return NumericVector (0 );
880886 const int n_pairs = N * (N - 1 ) / 2 ;
@@ -944,6 +950,7 @@ NumericMatrix cpp_mutual_clustering_cross_pairs(
944950 const List& splits_a, const List& splits_b,
945951 const int n_tip, const int n_threads = 1
946952) {
953+ TreeDist::check_ntip (n_tip);
947954 const int nA = splits_a.size ();
948955 const int nB = splits_b.size ();
949956 if (nA == 0 || nB == 0 ) return NumericMatrix (nA, nB);
@@ -987,6 +994,7 @@ NumericMatrix cpp_rf_info_cross_pairs(
987994 const List& splits_a, const List& splits_b,
988995 const int n_tip, const int n_threads = 1
989996) {
997+ TreeDist::check_ntip (n_tip);
990998 const int nA = splits_a.size ();
991999 const int nB = splits_b.size ();
9921000 if (nA == 0 || nB == 0 ) return NumericMatrix (nA, nB);
@@ -1027,6 +1035,7 @@ NumericMatrix cpp_msd_cross_pairs(
10271035 const List& splits_a, const List& splits_b,
10281036 const int n_tip, const int n_threads = 1
10291037) {
1038+ TreeDist::check_ntip (n_tip);
10301039 const int nA = splits_a.size ();
10311040 const int nB = splits_b.size ();
10321041 if (nA == 0 || nB == 0 ) return NumericMatrix (nA, nB);
@@ -1070,6 +1079,7 @@ NumericMatrix cpp_msi_cross_pairs(
10701079 const List& splits_a, const List& splits_b,
10711080 const int n_tip, const int n_threads = 1
10721081) {
1082+ TreeDist::check_ntip (n_tip);
10731083 const int nA = splits_a.size ();
10741084 const int nB = splits_b.size ();
10751085 if (nA == 0 || nB == 0 ) return NumericMatrix (nA, nB);
@@ -1110,6 +1120,7 @@ NumericMatrix cpp_shared_phylo_cross_pairs(
11101120 const List& splits_a, const List& splits_b,
11111121 const int n_tip, const int n_threads = 1
11121122) {
1123+ TreeDist::check_ntip (n_tip);
11131124 const int nA = splits_a.size ();
11141125 const int nB = splits_b.size ();
11151126 if (nA == 0 || nB == 0 ) return NumericMatrix (nA, nB);
@@ -1153,6 +1164,7 @@ NumericMatrix cpp_jaccard_cross_pairs(
11531164 const bool allow_conflict = true ,
11541165 const int n_threads = 1
11551166) {
1167+ TreeDist::check_ntip (n_tip);
11561168 const int nA = splits_a.size ();
11571169 const int nB = splits_b.size ();
11581170 if (nA == 0 || nB == 0 ) return NumericMatrix (nA, nB);
@@ -1206,6 +1218,7 @@ NumericVector cpp_clustering_entropy_batch(
12061218 const List& splits_list,
12071219 const int n_tip
12081220) {
1221+ TreeDist::check_ntip (n_tip);
12091222 const int N = splits_list.size ();
12101223 NumericVector result (N);
12111224 if (N == 0 || n_tip <= 0 ) return result;
@@ -1239,6 +1252,7 @@ NumericVector cpp_splitwise_info_batch(
12391252 const List& splits_list,
12401253 const int n_tip
12411254) {
1255+ TreeDist::check_ntip (n_tip);
12421256 const int N = splits_list.size ();
12431257 NumericVector result (N);
12441258 if (N == 0 || n_tip < 4 ) return result;
0 commit comments