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

wE_adj <- function(E, FE, W, I) {
    .Call(`_fect_wE_adj`, E, FE, W, I)
}

loglh <- function(Y_fit, Y) {
    .Call(`_fect_loglh`, Y_fit, Y)
}

loglh_ub <- function(Y_fit, Y, I) {
    .Call(`_fect_loglh_ub`, Y_fit, Y, I)
}

data_ub_adj <- function(I_data, data) {
    .Call(`_fect_data_ub_adj`, I_data, data)
}

XXinv <- function(X) {
    .Call(`_fect_XXinv`, X)
}

wXXinv <- function(X, w) {
    .Call(`_fect_wXXinv`, X, w)
}

panel_beta <- function(X, xxinv, Y, FE) {
    .Call(`_fect_panel_beta`, X, xxinv, Y, FE)
}

wpanel_beta <- function(X, xwxinv, w, Y, FE) {
    .Call(`_fect_wpanel_beta`, X, xwxinv, w, Y, FE)
}

panel_est <- function(X, Y, MF) {
    .Call(`_fect_panel_est`, X, Y, MF)
}

inter_fe_d_qr <- function(Y, Y_fit0, FE0, factor0, xi0, X, r, force, mniter = 5000L, w = 1.0, tol = 1e-5) {
    .Call(`_fect_inter_fe_d_qr`, Y, Y_fit0, FE0, factor0, xi0, X, r, force, mniter, w, tol)
}

inter_fe_d_qr_ub <- function(Y, Y_fit0, FE0, factor0, xi0, X, I, r, force, mniter = 5000L, w = 1.0, tol = 1e-5) {
    .Call(`_fect_inter_fe_d_qr_ub`, Y, Y_fit0, FE0, factor0, xi0, X, I, r, force, mniter, w, tol)
}

qr_factor <- function(F, L) {
    .Call(`_fect_qr_factor`, F, L)
}

IND <- function(I) {
    .Call(`_fect_IND`, I)
}

subfe <- function(Y, X, I, intercept) {
    .Call(`_fect_subfe`, Y, X, I, intercept)
}

l_ub <- function(Y, F, I, r, force) {
    .Call(`_fect_l_ub`, Y, F, I, r, force)
}

f_ub <- function(Y, L, I, r, force) {
    .Call(`_fect_f_ub`, Y, L, I, r, force)
}

fe <- function(E, F_old_in, xi_old, force, r) {
    .Call(`_fect_fe`, E, F_old_in, xi_old, force, r)
}

fe_ub <- function(E, I, F_old, xi_old, force, r) {
    .Call(`_fect_fe_ub`, E, I, F_old, xi_old, force, r)
}

inter_fe_d <- function(Y, Y_fit0, FE0, X, r, force, mniter = 5000L, w = 1.0, tol = 1e-5) {
    .Call(`_fect_inter_fe_d`, Y, Y_fit0, FE0, X, r, force, mniter, w, tol)
}

inter_fe_d_ub <- function(Y, Y_fit0, FE0, X, I, r, force, mniter = 5000L, w = 1.0, tol = 1e-5) {
    .Call(`_fect_inter_fe_d_ub`, Y, Y_fit0, FE0, X, I, r, force, mniter, w, tol)
}

complex_fe_ub <- function(Y, Y0, X_covariates, X_extra_FE, X_Z, X_Q, X_gamma, X_kappa, Zgamma_id, kappaQ_id, I, W_in, beta0, r, force, tol = 1e-5, max_iter = 1000L, fit_init = NULL) {
    .Call(`_fect_complex_fe_ub`, Y, Y0, X_covariates, X_extra_FE, X_Z, X_Q, X_gamma, X_kappa, Zgamma_id, kappaQ_id, I, W_in, beta0, r, force, tol, max_iter, fit_init)
}

YY_adj <- function(YYYY, EEE, I, use_weight, W) {
    .Call(`_fect_YY_adj`, YYYY, EEE, I, use_weight, W)
}

Demean <- function(E, force, X_extra_FE, extra_FE_index_cache) {
    .Call(`_fect_Demean`, E, force, X_extra_FE, extra_FE_index_cache)
}

fixed_effects_part <- function(E, force, X_extra_FE, extra_FE_index_cache) {
    .Call(`_fect_fixed_effects_part`, E, force, X_extra_FE, extra_FE_index_cache)
}

Gamma <- function(E, Z, zzinv, gamma_t_group) {
    .Call(`_fect_Gamma`, E, Z, zzinv, gamma_t_group)
}

gamma_part <- function(E, Z, zzinv, gamma_t_group) {
    .Call(`_fect_gamma_part`, E, Z, zzinv, gamma_t_group)
}

Kappa <- function(E, Q, qqinv, kappa_i_group) {
    .Call(`_fect_Kappa`, E, Q, qqinv, kappa_i_group)
}

kappa_part <- function(E, Q, qqinv, kappa_i_group) {
    .Call(`_fect_kappa_part`, E, Q, qqinv, kappa_i_group)
}

Beta <- function(X, xxinv, E) {
    .Call(`_fect_Beta`, X, xxinv, E)
}

WBeta <- function(X, xwxinv, w, E) {
    .Call(`_fect_WBeta`, X, xwxinv, w, E)
}

beta_part <- function(E, XX, xxinv, W, use_weight) {
    .Call(`_fect_beta_part`, E, XX, xxinv, W, use_weight)
}

ife_part <- function(E, r) {
    .Call(`_fect_ife_part`, E, r)
}

cfe_iter <- function(XX, xxinv, X_extra_FE, X_Z, X_Q, X_gamma, X_kappa, Zgamma_id, kappaQ_id, Y, Y0, I, W, beta0, force, r, tolerate, max_iter, fit_init = NULL) {
    .Call(`_fect_cfe_iter`, XX, xxinv, X_extra_FE, X_Z, X_Q, X_gamma, X_kappa, Zgamma_id, kappaQ_id, Y, Y0, I, W, beta0, force, r, tolerate, max_iter, fit_init)
}

Y_demean <- function(Y, force) {
    .Call(`_fect_Y_demean`, Y, force)
}

Y_wdemean <- function(Y, W, force) {
    .Call(`_fect_Y_wdemean`, Y, W, force)
}

fe_add <- function(alpha_Y, xi_Y, mu_Y, T, N, force) {
    .Call(`_fect_fe_add`, alpha_Y, xi_Y, mu_Y, T, N, force)
}

panel_factor <- function(E, r) {
    .Call(`_fect_panel_factor`, E, r)
}

panel_FE <- function(E, lambda, hard) {
    .Call(`_fect_panel_FE`, E, lambda, hard)
}

ife <- function(E, force, mc, r, hard, lambda) {
    .Call(`_fect_ife`, E, force, mc, r, hard, lambda)
}

inter_fe <- function(Y, X, r, force, beta0_in, tol = 1e-5, max_iter = 500L) {
    .Call(`_fect_inter_fe`, Y, X, r, force, beta0_in, tol, max_iter)
}

inter_fe_ub <- function(Y, Y0, X, I, W_in, beta0, r, force, tol = 1e-5, max_iter = 1000L, fit_init = NULL) {
    .Call(`_fect_inter_fe_ub`, Y, Y0, X, I, W_in, beta0, r, force, tol, max_iter, fit_init)
}

fe_ad_iter <- function(Y, Y0, I, W, force, tolerate, max_iter = 500L) {
    .Call(`_fect_fe_ad_iter`, Y, Y0, I, W, force, tolerate, max_iter)
}

fe_ad_covar_iter <- function(XX, xxinv, Y, Y0, I, beta0, W, force, tolerate, max_iter = 500L) {
    .Call(`_fect_fe_ad_covar_iter`, XX, xxinv, Y, Y0, I, beta0, W, force, tolerate, max_iter)
}

fe_ad_inter_iter <- function(Y, Y0, I, W, force, mc, r, hard, lambda, tolerate, max_iter = 1000L, fit_init = NULL) {
    .Call(`_fect_fe_ad_inter_iter`, Y, Y0, I, W, force, mc, r, hard, lambda, tolerate, max_iter, fit_init)
}

fe_ad_inter_covar_iter <- function(XX, xxinv, Y, Y0, I, W, beta0, force, mc, r, hard, lambda, tolerate, max_iter = 1000L, fit_init = NULL) {
    .Call(`_fect_fe_ad_inter_covar_iter`, XX, xxinv, Y, Y0, I, W, beta0, force, mc, r, hard, lambda, tolerate, max_iter, fit_init)
}

beta_iter <- function(X, xxinv, Y, r, tolerate, beta0, max_iter) {
    .Call(`_fect_beta_iter`, X, xxinv, Y, r, tolerate, beta0, max_iter)
}

inter_fe_mc <- function(Y, Y0, X, I, W_in, beta0, r, lambda, force, tol = 1e-5, max_iter = 1000L, fit_init = NULL) {
    .Call(`_fect_inter_fe_mc`, Y, Y0, X, I, W_in, beta0, r, lambda, force, tol, max_iter, fit_init)
}

