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

glasso_Gmat2Fmat_sparse <- function(Gmat, var_weights) {
    .Call(`_fdaSP_glasso_Gmat2Fmat_sparse`, Gmat, var_weights)
}

ovglasso_Gmat2Fmat_sparse <- function(Gmat, var_weights) {
    .Call(`_fdaSP_ovglasso_Gmat2Fmat_sparse`, Gmat, var_weights)
}

#' @name  fdaSP.internal
#' @keywords internal
.lm_dof_LASSO_1lambda <- function(X, coeff, lambda, Uvec, err_primal, err_dual, rho, toler_c, toler_d) {
    .Call(`_fdaSP_lm_dof_LASSO_1lambda`, X, coeff, lambda, Uvec, err_primal, err_dual, rho, toler_c, toler_d)
}

#' @name  fdaSP.internal
#' @keywords internal
.lm_dof_OVGLASSO_1lambda <- function(X, coeff, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d) {
    .Call(`_fdaSP_lm_dof_OVGLASSO_1lambda`, X, coeff, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d)
}

#' @name  fdaSP.internal
#' @keywords internal
.lm_cov_dof_OVGLASSO_1lambda <- function(X, Z, coeff_X, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d) {
    .Call(`_fdaSP_lm_cov_dof_OVGLASSO_1lambda`, X, Z, coeff_X, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d)
}

#' @name  fdaSP.internal
#' @keywords internal
.lm_adaptive_dof_OVGLASSO_1lambda <- function(X, coeff, coeff_LS, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d) {
    .Call(`_fdaSP_lm_adaptive_dof_OVGLASSO_1lambda`, X, coeff, coeff_LS, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d)
}

#' @name  fdaSP.internal
#' @keywords internal
.lm_cov_adaptive_dof_OVGLASSO_1lamba <- function(X, Z, coeff_X, coeff_X_LS, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d) {
    .Call(`_fdaSP_lm_cov_adaptive_dof_OVGLASSO_1lamba`, X, Z, coeff_X, coeff_X_LS, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d)
}

#' @name  fdaSP.internal
#' @keywords internal
.f2s_dof_1lambda <- function(W, coeff, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d) {
    .Call(`_fdaSP_f2s_dof_1lambda`, W, coeff, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d)
}

#' @name  fdaSP.internal
#' @keywords internal
.f2s_cov_dof_1lambda <- function(W, Z, coeff_W, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d) {
    .Call(`_fdaSP_f2s_cov_dof_1lambda`, W, Z, coeff_W, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d)
}

#' @name  fdaSP.internal
#' @keywords internal
.f2s_smo_dof_1lambda <- function(W, coeff, lambda, lambda2, diff_order, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d) {
    .Call(`_fdaSP_f2s_smo_dof_1lambda`, W, coeff, lambda, lambda2, diff_order, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d)
}

#' @name  fdaSP.internal
#' @keywords internal
.f2s_cov_smo_dof_1lambda <- function(W, Z, coeff_W, lambda, lambda2, diff_order, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d) {
    .Call(`_fdaSP_f2s_cov_smo_dof_1lambda`, W, Z, coeff_W, lambda, lambda2, diff_order, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d)
}

#' @name  fdaSP.internal
#' @keywords internal
.f2s_adaptive_dof_1lambda <- function(W, coeff, coeff_LS, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d) {
    .Call(`_fdaSP_f2s_adaptive_dof_1lambda`, W, coeff, coeff_LS, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d)
}

#' @name  fdaSP.internal
#' @keywords internal
.f2s_cov_adaptive_dof_1lambda <- function(W, Z, coeff_W, coeff_W_LS, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d) {
    .Call(`_fdaSP_f2s_cov_adaptive_dof_1lambda`, W, Z, coeff_W, coeff_W_LS, lambda, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d)
}

#' @name  fdaSP.internal
#' @keywords internal
.f2s_smo_adaptive_dof_1lambda <- function(W, coeff, coeff_LS, lambda, lambda2, diff_order, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d) {
    .Call(`_fdaSP_f2s_smo_adaptive_dof_1lambda`, W, coeff, coeff_LS, lambda, lambda2, diff_order, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d)
}

#' @name  fdaSP.internal
#' @keywords internal
.f2s_adaptive_cov_smo_dof_1lambda <- function(W, Z, coeff_W, coeff_W_LS, lambda, lambda2, diff_order, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d) {
    .Call(`_fdaSP_f2s_adaptive_cov_smo_dof_1lambda`, W, Z, coeff_W, coeff_W_LS, lambda, lambda2, diff_order, GRmat, group_weights, var_weights, Uvec, err_primal, err_dual, rho, toler_c, toler_d)
}

#' @name  fdaSP.internal
#' @keywords internal
.f2s_bic <- function(y, W, coeff_path, df) {
    .Call(`_fdaSP_f2s_bic`, y, W, coeff_path, df)
}

#' @name  fdaSP.internal
#' @keywords internal
.f2s_cov_bic <- function(y, W, Z, W_coeff_path, Z_coeff_path, df) {
    .Call(`_fdaSP_f2s_cov_bic`, y, W, Z, W_coeff_path, Z_coeff_path, df)
}

#' @name  fdaSP.internal
#' @keywords internal
.f2s_ebic <- function(y, X, coeff_path, df, kappa) {
    .Call(`_fdaSP_f2s_ebic`, y, X, coeff_path, df, kappa)
}

#' @name  fdaSP.internal
#' @keywords internal
.f2s_cov_ebic <- function(y, W, Z, W_coeff_path, Z_coeff_path, df, kappa) {
    .Call(`_fdaSP_f2s_cov_ebic`, y, W, Z, W_coeff_path, Z_coeff_path, df, kappa)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_glasso <- function(A, b, groups, group_weights, var_weights, u, z, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_glasso`, A, b, groups, group_weights, var_weights, u, z, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_glasso_cov <- function(W, Z, y, u, z, groups, group_weights, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_glasso_cov`, W, Z, y, u, z, groups, group_weights, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_glasso_fast <- function(A, b, groups, group_weights, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_glasso_fast`, A, b, groups, group_weights, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_glasso_cov_fast <- function(W, Z, y, groups, group_weights, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_glasso_cov_fast`, W, Z, y, groups, group_weights, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_spglasso <- function(A, b, groups, group_weights, var_weights, var_weights_L1, u, z, lambda1, lambda2, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_spglasso`, A, b, groups, group_weights, var_weights, var_weights_L1, u, z, lambda1, lambda2, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_spglasso_cov <- function(W, Z, y, groups, group_weights, var_weights, var_weights_L1, u, z, lambda1, lambda2, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_spglasso_cov`, W, Z, y, groups, group_weights, var_weights, var_weights_L1, u, z, lambda1, lambda2, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_spglasso_fast <- function(A, b, groups, group_weights, var_weights, var_weights_L1, lambda, alpha, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_spglasso_fast`, A, b, groups, group_weights, var_weights, var_weights_L1, lambda, alpha, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_spglasso_cov_fast <- function(W, Z, y, groups, group_weights, var_weights, var_weights_L1, lambda, alpha, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_spglasso_cov_fast`, W, Z, y, groups, group_weights, var_weights, var_weights_L1, lambda, alpha, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_lasso <- function(A, b, u, z, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_lasso`, A, b, u, z, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_lasso_cov <- function(W, Z, y, u, z, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_lasso_cov`, W, Z, y, u, z, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_adalasso <- function(A, b, var_weights, u, z, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_adalasso`, A, b, var_weights, u, z, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_adalasso_cov <- function(W, Z, y, var_weights, u, z, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_adalasso_cov`, W, Z, y, var_weights, u, z, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_lasso_fast <- function(A, b, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_lasso_fast`, A, b, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_lasso_cov_fast <- function(W, Z, y, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_lasso_cov_fast`, W, Z, y, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_adalasso_fast <- function(A, b, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_adalasso_fast`, A, b, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_adalasso_cov_fast <- function(W, Z, y, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_adalasso_cov_fast`, W, Z, y, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_ovglasso <- function(A, b, groups, group_weights, var_weights, u, z, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_ovglasso`, A, b, groups, group_weights, var_weights, u, z, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_ovglasso_smo <- function(A, b, groups, group_weights, var_weights, u, z, lambda, lambda2, diff_order, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_ovglasso_smo`, A, b, groups, group_weights, var_weights, u, z, lambda, lambda2, diff_order, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_ovglasso_cov <- function(W, Z, y, u, z, groups, group_weights, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_ovglasso_cov`, W, Z, y, u, z, groups, group_weights, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_ovglasso_cov_smo <- function(W, Z, y, u, z, groups, group_weights, var_weights, lambda, lambda2, diff_order, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_ovglasso_cov_smo`, W, Z, y, u, z, groups, group_weights, var_weights, lambda, lambda2, diff_order, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_ovglasso_fast <- function(A, b, groups, group_weights, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_ovglasso_fast`, A, b, groups, group_weights, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_ovglasso_smo_fast <- function(A, b, groups, group_weights, var_weights, lambda, lambda2, diff_order, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_ovglasso_smo_fast`, A, b, groups, group_weights, var_weights, lambda, lambda2, diff_order, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_ovglasso_cov_fast <- function(W, Z, y, groups, group_weights, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_ovglasso_cov_fast`, W, Z, y, groups, group_weights, var_weights, lambda, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_ovglasso_cov_smo_fast <- function(W, Z, y, groups, group_weights, var_weights, lambda, lambda2, diff_order, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_ovglasso_cov_smo_fast`, W, Z, y, groups, group_weights, var_weights, lambda, lambda2, diff_order, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_spovglasso <- function(A, b, groups, group_weights, var_weights, var_weights_L1, u, z, lambda, alpha, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_spovglasso`, A, b, groups, group_weights, var_weights, var_weights_L1, u, z, lambda, alpha, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_spovglasso_cov <- function(W, Z, y, u, z, groups, group_weights, var_weights, var_weights_L1, lambda, alpha, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_spovglasso_cov`, W, Z, y, u, z, groups, group_weights, var_weights, var_weights_L1, lambda, alpha, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_spovglasso_fast <- function(A, b, groups, group_weights, var_weights, var_weights_L1, lambda, alpha, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_spovglasso_fast`, A, b, groups, group_weights, var_weights, var_weights_L1, lambda, alpha, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @name  fdaSP.internal
#' @keywords internal
.admm_spovglasso_cov_fast <- function(W, Z, y, groups, group_weights, var_weights, var_weights_L1, lambda, alpha, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping) {
    .Call(`_fdaSP_admm_spovglasso_cov_fast`, W, Z, y, groups, group_weights, var_weights, var_weights_L1, lambda, alpha, rho_adaptation, rho, tau, mu, reltol, abstol, maxiter, ping)
}

#' @keywords internal
#' @noRd
NULL

#' @keywords internal
#' @noRd
NULL

#' @keywords internal
#' @noRd
NULL

#' @keywords internal
#' @noRd
NULL

#' @keywords internal
#' @noRd
NULL

#' @keywords internal
#' @noRd
NULL

#' @keywords internal
#' @noRd
NULL

#' @keywords internal
#' @noRd
NULL

#' @keywords internal
#' @noRd
NULL

#' @keywords internal
#' @noRd
NULL

#' @keywords internal
#' @noRd
NULL

#' @keywords internal
#' @noRd
NULL

#' Forward finite difference approximation of order d
#'
#' @param f Numeric vector containing function values.
#' @param h Step size (default = 1.0).
#' @param d Order of the derivative (integer >= 1).
#' @return Numeric vector of forward differences of order d (length n, last d elements = NA).
#' #@examples
#' #f <- c(0, 1, 4, 9, 16)
#' #forward_diff(f = f, h = 1, d = 2)
forward_diff <- function(f, h, d) {
    .Call(`_fdaSP_forward_diff`, f, h, d)
}

#' Compute the discrete difference penalty matrix Q = D^T D
#'
#' Constructs the d-th order forward-difference operator D (scaled by 1/h^d)
#' and returns Q = D^T D.
#'
#' @param n Length of the vector the operator acts on.
#' @param h Step size (default = 1.0).
#' @param d Derivative order (integer >= 1).
#' @return Symmetric n x n matrix Q = D^T D.
#' @examples
#' #Q1 <- forward_diff_penalty_matrix(5, h = 1, d = 1)
#' #Q2 <- forward_diff_penalty_matrix(5, h = 1, d = 2)
#' #Q1
#' @name  fdaSP.internal
#' @keywords internal
.forward_diff_penalty_matrix <- function(n, h, d) {
    .Call(`_fdaSP_forward_diff_penalty_matrix`, n, h, d)
}

#' @name  fdaSP.internal
#' @keywords internal
.forward_diff_difference_matrix <- function(n, h, d) {
    .Call(`_fdaSP_forward_diff_difference_matrix`, n, h, d)
}

svd_check <- function(X, U, V, s) {
    .Call(`_fdaSP_svd_check`, X, U, V, s)
}

pseudoinv <- function(X) {
    .Call(`_fdaSP_pseudoinv`, X)
}

lm_ols <- function(X, y) {
    .Call(`_fdaSP_lm_ols`, X, y)
}

lm_ols_fast <- function(XTX_CHOL, XTy) {
    .Call(`_fdaSP_lm_ols_fast`, XTX_CHOL, XTy)
}

lm_ols_FWL <- function(X, Z, y) {
    .Call(`_fdaSP_lm_ols_FWL`, X, Z, y)
}

lm_ols_FWL_fast <- function(L_ZZ, L_XMX, P_ZX, XMy, Zy) {
    .Call(`_fdaSP_lm_ols_FWL_fast`, L_ZZ, L_XMX, P_ZX, XMy, Zy)
}

gennorm <- function(x, type) {
    .Call(`_fdaSP_gennorm`, x, type)
}

