# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

lte_n_equal_rows <- function(matrix, n, tolerance = 1e-10) {
    .Call(`_glmGamPoi_lte_n_equal_rows`, matrix, n, tolerance)
}

get_row_groups <- function(matrix, n_groups, tolerance = 1e-10) {
    .Call(`_glmGamPoi_get_row_groups`, matrix, n_groups, tolerance)
}

fitBeta_fisher_scoring <- function(Y, model_matrix, exp_offset_matrix, thetas, beta_matSEXP, ridge_penalty_nl, tolerance, max_rel_mu_change, max_iter) {
    .Call(`_glmGamPoi_fitBeta_fisher_scoring`, Y, model_matrix, exp_offset_matrix, thetas, beta_matSEXP, ridge_penalty_nl, tolerance, max_rel_mu_change, max_iter)
}

fitBeta_diagonal_fisher_scoring <- function(Y, model_matrix, exp_offset_matrix, thetas, beta_matSEXP, tolerance, max_rel_mu_change, max_iter) {
    .Call(`_glmGamPoi_fitBeta_diagonal_fisher_scoring`, Y, model_matrix, exp_offset_matrix, thetas, beta_matSEXP, tolerance, max_rel_mu_change, max_iter)
}

fitBeta_one_group <- function(Y, offset_matrix, thetas, beta_start_values, tolerance, maxIter) {
    .Call(`_glmGamPoi_fitBeta_one_group`, Y, offset_matrix, thetas, beta_start_values, tolerance, maxIter)
}

compute_gp_deviance <- function(y, mu, theta) {
    .Call(`_glmGamPoi_compute_gp_deviance_mask`, y, mu, theta)
}

compute_gp_deviance_sum <- function(y, mu, theta) {
    .Call(`_glmGamPoi_compute_gp_deviance_sum_mask`, y, mu, theta)
}

compute_gp_deviance_residuals_matrix <- function(Y_SEXP, Mu, thetas) {
    .Call(`_glmGamPoi_compute_gp_deviance_residuals_matrix_mask`, Y_SEXP, Mu, thetas)
}

make_table_if_small <- function(x, stop_if_larger) {
    .Call(`_glmGamPoi_make_table_if_small`, x, stop_if_larger)
}

conventional_loglikelihood_fast <- function(y, mu, log_theta, model_matrix, do_cr_adj, unique_counts = as.numeric( c()), count_frequencies = as.numeric( c())) {
    .Call(`_glmGamPoi_conventional_loglikelihood_fast`, y, mu, log_theta, model_matrix, do_cr_adj, unique_counts, count_frequencies)
}

conventional_score_function_fast <- function(y, mu, log_theta, model_matrix, do_cr_adj, unique_counts = as.numeric( c()), count_frequencies = as.numeric( c())) {
    .Call(`_glmGamPoi_conventional_score_function_fast`, y, mu, log_theta, model_matrix, do_cr_adj, unique_counts, count_frequencies)
}

conventional_deriv_score_function_fast <- function(y, mu, log_theta, model_matrix, do_cr_adj, unique_counts = as.numeric( c()), count_frequencies = as.numeric( c())) {
    .Call(`_glmGamPoi_conventional_deriv_score_function_fast`, y, mu, log_theta, model_matrix, do_cr_adj, unique_counts, count_frequencies)
}

estimate_overdispersions_fast <- function(Y, mean_matrix, model_matrix, do_cox_reid_adjustment, n_subsamples, max_iter) {
    .Call(`_glmGamPoi_estimate_overdispersions_fast`, Y, mean_matrix, model_matrix, do_cox_reid_adjustment, n_subsamples, max_iter)
}

estimate_global_overdispersions_fast <- function(Y, mean_matrix, model_matrix, do_cox_reid_adjustment, log_thetas) {
    .Call(`_glmGamPoi_estimate_global_overdispersions_fast`, Y, mean_matrix, model_matrix, do_cox_reid_adjustment, log_thetas)
}

div_zbz_dbl <- function(a, b) {
    .Call(`_glmGamPoi_div_zbz_dbl`, a, b)
}

div_zbz_int <- function(a, b) {
    .Call(`_glmGamPoi_div_zbz_int`, a, b)
}

div_zbz_dbl_mat <- function(a, b) {
    .Call(`_glmGamPoi_div_zbz_dbl_mat`, a, b)
}

div_zbz_int_mat <- function(a, b) {
    .Call(`_glmGamPoi_div_zbz_int_mat`, a, b)
}

