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

#include <RcppArmadillo.h>
#include <Rcpp.h>

using namespace Rcpp;

// signCPP
int signCPP(double x);
RcppExport SEXP _sparseKOS_signCPP(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(signCPP(x));
    return rcpp_result_gen;
END_RCPP
}
// SoftThreshCPP
double SoftThreshCPP(double x, double lambda);
RcppExport SEXP _sparseKOS_SoftThreshCPP(SEXP xSEXP, SEXP lambdaSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type x(xSEXP);
    Rcpp::traits::input_parameter< double >::type lambda(lambdaSEXP);
    rcpp_result_gen = Rcpp::wrap(SoftThreshCPP(x, lambda));
    return rcpp_result_gen;
END_RCPP
}
// CoordDesCPP
arma::Col<double> CoordDesCPP(arma::Col<double> w0, arma::Mat<double> Q, arma::Col<double> beta, double Lambda, double Epsilon, int Maxniter);
RcppExport SEXP _sparseKOS_CoordDesCPP(SEXP w0SEXP, SEXP QSEXP, SEXP betaSEXP, SEXP LambdaSEXP, SEXP EpsilonSEXP, SEXP MaxniterSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::Col<double> >::type w0(w0SEXP);
    Rcpp::traits::input_parameter< arma::Mat<double> >::type Q(QSEXP);
    Rcpp::traits::input_parameter< arma::Col<double> >::type beta(betaSEXP);
    Rcpp::traits::input_parameter< double >::type Lambda(LambdaSEXP);
    Rcpp::traits::input_parameter< double >::type Epsilon(EpsilonSEXP);
    Rcpp::traits::input_parameter< int >::type Maxniter(MaxniterSEXP);
    rcpp_result_gen = Rcpp::wrap(CoordDesCPP(w0, Q, beta, Lambda, Epsilon, Maxniter));
    return rcpp_result_gen;
END_RCPP
}
// SolveKOSCPP
arma::Col<double> SolveKOSCPP(arma::Mat<double> YTheta, arma::Mat<double> K, double Gamma, double Epsilon);
RcppExport SEXP _sparseKOS_SolveKOSCPP(SEXP YThetaSEXP, SEXP KSEXP, SEXP GammaSEXP, SEXP EpsilonSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::Mat<double> >::type YTheta(YThetaSEXP);
    Rcpp::traits::input_parameter< arma::Mat<double> >::type K(KSEXP);
    Rcpp::traits::input_parameter< double >::type Gamma(GammaSEXP);
    Rcpp::traits::input_parameter< double >::type Epsilon(EpsilonSEXP);
    rcpp_result_gen = Rcpp::wrap(SolveKOSCPP(YTheta, K, Gamma, Epsilon));
    return rcpp_result_gen;
END_RCPP
}
// DerivCPP
arma::Mat<double> DerivCPP(arma::Row<double> x, arma::Mat<double> Data, arma::Col<double> w0, double sigmaD);
RcppExport SEXP _sparseKOS_DerivCPP(SEXP xSEXP, SEXP DataSEXP, SEXP w0SEXP, SEXP sigmaDSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::Row<double> >::type x(xSEXP);
    Rcpp::traits::input_parameter< arma::Mat<double> >::type Data(DataSEXP);
    Rcpp::traits::input_parameter< arma::Col<double> >::type w0(w0SEXP);
    Rcpp::traits::input_parameter< double >::type sigmaD(sigmaDSEXP);
    rcpp_result_gen = Rcpp::wrap(DerivCPP(x, Data, w0, sigmaD));
    return rcpp_result_gen;
END_RCPP
}
// TMatCPP
arma::Mat<double> TMatCPP(arma::Mat<double> Data, arma::Col<double> A, arma::Col<double> w0, double sigmaTm);
RcppExport SEXP _sparseKOS_TMatCPP(SEXP DataSEXP, SEXP ASEXP, SEXP w0SEXP, SEXP sigmaTmSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::Mat<double> >::type Data(DataSEXP);
    Rcpp::traits::input_parameter< arma::Col<double> >::type A(ASEXP);
    Rcpp::traits::input_parameter< arma::Col<double> >::type w0(w0SEXP);
    Rcpp::traits::input_parameter< double >::type sigmaTm(sigmaTmSEXP);
    rcpp_result_gen = Rcpp::wrap(TMatCPP(Data, A, w0, sigmaTm));
    return rcpp_result_gen;
END_RCPP
}
// ObjectiveFuncCPP
double ObjectiveFuncCPP(arma::Col<double> w, arma::Mat<double> KwOF, arma::Mat<double> Data, arma::Col<double> DVectors, arma::Mat<double> YTheta, double LambdaOF, double GammaOF, double EpsilonOF);
RcppExport SEXP _sparseKOS_ObjectiveFuncCPP(SEXP wSEXP, SEXP KwOFSEXP, SEXP DataSEXP, SEXP DVectorsSEXP, SEXP YThetaSEXP, SEXP LambdaOFSEXP, SEXP GammaOFSEXP, SEXP EpsilonOFSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::Col<double> >::type w(wSEXP);
    Rcpp::traits::input_parameter< arma::Mat<double> >::type KwOF(KwOFSEXP);
    Rcpp::traits::input_parameter< arma::Mat<double> >::type Data(DataSEXP);
    Rcpp::traits::input_parameter< arma::Col<double> >::type DVectors(DVectorsSEXP);
    Rcpp::traits::input_parameter< arma::Mat<double> >::type YTheta(YThetaSEXP);
    Rcpp::traits::input_parameter< double >::type LambdaOF(LambdaOFSEXP);
    Rcpp::traits::input_parameter< double >::type GammaOF(GammaOFSEXP);
    Rcpp::traits::input_parameter< double >::type EpsilonOF(EpsilonOFSEXP);
    rcpp_result_gen = Rcpp::wrap(ObjectiveFuncCPP(w, KwOF, Data, DVectors, YTheta, LambdaOF, GammaOF, EpsilonOF));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_sparseKOS_signCPP", (DL_FUNC) &_sparseKOS_signCPP, 1},
    {"_sparseKOS_SoftThreshCPP", (DL_FUNC) &_sparseKOS_SoftThreshCPP, 2},
    {"_sparseKOS_CoordDesCPP", (DL_FUNC) &_sparseKOS_CoordDesCPP, 6},
    {"_sparseKOS_SolveKOSCPP", (DL_FUNC) &_sparseKOS_SolveKOSCPP, 4},
    {"_sparseKOS_DerivCPP", (DL_FUNC) &_sparseKOS_DerivCPP, 4},
    {"_sparseKOS_TMatCPP", (DL_FUNC) &_sparseKOS_TMatCPP, 4},
    {"_sparseKOS_ObjectiveFuncCPP", (DL_FUNC) &_sparseKOS_ObjectiveFuncCPP, 8},
    {NULL, NULL, 0}
};

RcppExport void R_init_sparseKOS(DllInfo *dll) {
    R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
    R_useDynamicSymbols(dll, FALSE);
}
