// 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;

#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>&  Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// fast_diss
arma::mat fast_diss(NumericMatrix X, NumericMatrix Y, String method);
RcppExport SEXP _resemble_fast_diss(SEXP XSEXP, SEXP YSEXP, SEXP methodSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type X(XSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type Y(YSEXP);
    Rcpp::traits::input_parameter< String >::type method(methodSEXP);
    rcpp_result_gen = Rcpp::wrap(fast_diss(X, Y, method));
    return rcpp_result_gen;
END_RCPP
}
// fast_diss_vector
NumericVector fast_diss_vector(NumericVector X);
RcppExport SEXP _resemble_fast_diss_vector(SEXP XSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type X(XSEXP);
    rcpp_result_gen = Rcpp::wrap(fast_diss_vector(X));
    return rcpp_result_gen;
END_RCPP
}
// fast_self_euclid
Rcpp::NumericMatrix fast_self_euclid(const arma::mat& X);
RcppExport SEXP _resemble_fast_self_euclid(SEXP XSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type X(XSEXP);
    rcpp_result_gen = Rcpp::wrap(fast_self_euclid(X));
    return rcpp_result_gen;
END_RCPP
}
// moving_cor_diss_xy
arma::mat moving_cor_diss_xy(const arma::mat& X, const arma::mat& Y, int w, arma::uword block_x, arma::uword block_y);
RcppExport SEXP _resemble_moving_cor_diss_xy(SEXP XSEXP, SEXP YSEXP, SEXP wSEXP, SEXP block_xSEXP, SEXP block_ySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const arma::mat& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< int >::type w(wSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type block_x(block_xSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type block_y(block_ySEXP);
    rcpp_result_gen = Rcpp::wrap(moving_cor_diss_xy(X, Y, w, block_x, block_y));
    return rcpp_result_gen;
END_RCPP
}
// moving_cor_diss_self_f64
arma::mat moving_cor_diss_self_f64(const arma::mat& X, int w, arma::uword block_rows);
RcppExport SEXP _resemble_moving_cor_diss_self_f64(SEXP XSEXP, SEXP wSEXP, SEXP block_rowsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type X(XSEXP);
    Rcpp::traits::input_parameter< int >::type w(wSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type block_rows(block_rowsSEXP);
    rcpp_result_gen = Rcpp::wrap(moving_cor_diss_self_f64(X, w, block_rows));
    return rcpp_result_gen;
END_RCPP
}
// moving_cor_diss_self
arma::mat moving_cor_diss_self(const arma::mat& X, int w, arma::uword block_rows);
RcppExport SEXP _resemble_moving_cor_diss_self(SEXP XSEXP, SEXP wSEXP, SEXP block_rowsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type X(XSEXP);
    Rcpp::traits::input_parameter< int >::type w(wSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type block_rows(block_rowsSEXP);
    rcpp_result_gen = Rcpp::wrap(moving_cor_diss_self(X, w, block_rows));
    return rcpp_result_gen;
END_RCPP
}
// which_min
NumericVector which_min(NumericMatrix X);
RcppExport SEXP _resemble_which_min(SEXP XSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type X(XSEXP);
    rcpp_result_gen = Rcpp::wrap(which_min(X));
    return rcpp_result_gen;
END_RCPP
}
// which_min_vector
NumericVector which_min_vector(NumericVector X);
RcppExport SEXP _resemble_which_min_vector(SEXP XSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type X(XSEXP);
    rcpp_result_gen = Rcpp::wrap(which_min_vector(X));
    return rcpp_result_gen;
END_RCPP
}
// top_k_order
IntegerMatrix top_k_order(const arma::mat& mat, int k, IntegerVector skip);
RcppExport SEXP _resemble_top_k_order(SEXP matSEXP, SEXP kSEXP, SEXP skipSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type mat(matSEXP);
    Rcpp::traits::input_parameter< int >::type k(kSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type skip(skipSEXP);
    rcpp_result_gen = Rcpp::wrap(top_k_order(mat, k, skip));
    return rcpp_result_gen;
END_RCPP
}
// extract_by_index
NumericMatrix extract_by_index(NumericMatrix mat, IntegerMatrix idx);
RcppExport SEXP _resemble_extract_by_index(SEXP matSEXP, SEXP idxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type mat(matSEXP);
    Rcpp::traits::input_parameter< IntegerMatrix >::type idx(idxSEXP);
    rcpp_result_gen = Rcpp::wrap(extract_by_index(mat, idx));
    return rcpp_result_gen;
END_RCPP
}
// not_in_same_group
Rcpp::LogicalMatrix not_in_same_group(const Rcpp::IntegerMatrix& kidxmat, const Rcpp::IntegerVector& group);
RcppExport SEXP _resemble_not_in_same_group(SEXP kidxmatSEXP, SEXP groupSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::IntegerMatrix& >::type kidxmat(kidxmatSEXP);
    Rcpp::traits::input_parameter< const Rcpp::IntegerVector& >::type group(groupSEXP);
    rcpp_result_gen = Rcpp::wrap(not_in_same_group(kidxmat, group));
    return rcpp_result_gen;
END_RCPP
}
// compute_nn_quantiles
NumericMatrix compute_nn_quantiles(const IntegerMatrix& kidxmat, const LogicalMatrix& kidxgrop, const NumericVector& Yr, const IntegerVector& k, const NumericVector& probs);
RcppExport SEXP _resemble_compute_nn_quantiles(SEXP kidxmatSEXP, SEXP kidxgropSEXP, SEXP YrSEXP, SEXP kSEXP, SEXP probsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type kidxmat(kidxmatSEXP);
    Rcpp::traits::input_parameter< const LogicalMatrix& >::type kidxgrop(kidxgropSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type Yr(YrSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type k(kSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type probs(probsSEXP);
    rcpp_result_gen = Rcpp::wrap(compute_nn_quantiles(kidxmat, kidxgrop, Yr, k, probs));
    return rcpp_result_gen;
END_RCPP
}
// top_k_neighbors
List top_k_neighbors(const NumericMatrix& D, int k_min, int k_max, Rcpp::Nullable<double> threshold);
RcppExport SEXP _resemble_top_k_neighbors(SEXP DSEXP, SEXP k_minSEXP, SEXP k_maxSEXP, SEXP thresholdSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type D(DSEXP);
    Rcpp::traits::input_parameter< int >::type k_min(k_minSEXP);
    Rcpp::traits::input_parameter< int >::type k_max(k_maxSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<double> >::type threshold(thresholdSEXP);
    rcpp_result_gen = Rcpp::wrap(top_k_neighbors(D, k_min, k_max, threshold));
    return rcpp_result_gen;
END_RCPP
}
// get_col_largest_sd
NumericVector get_col_largest_sd(arma::mat X);
RcppExport SEXP _resemble_get_col_largest_sd(SEXP XSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    rcpp_result_gen = Rcpp::wrap(get_col_largest_sd(X));
    return rcpp_result_gen;
END_RCPP
}
// get_column_sds
NumericVector get_column_sds(arma::mat X);
RcppExport SEXP _resemble_get_column_sds(SEXP XSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    rcpp_result_gen = Rcpp::wrap(get_column_sds(X));
    return rcpp_result_gen;
END_RCPP
}
// overall_var
NumericVector overall_var(arma::mat X);
RcppExport SEXP _resemble_overall_var(SEXP XSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    rcpp_result_gen = Rcpp::wrap(overall_var(X));
    return rcpp_result_gen;
END_RCPP
}
// get_column_means
NumericVector get_column_means(arma::mat X);
RcppExport SEXP _resemble_get_column_means(SEXP XSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    rcpp_result_gen = Rcpp::wrap(get_column_means(X));
    return rcpp_result_gen;
END_RCPP
}
// get_column_maxs
NumericVector get_column_maxs(arma::mat X);
RcppExport SEXP _resemble_get_column_maxs(SEXP XSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    rcpp_result_gen = Rcpp::wrap(get_column_maxs(X));
    return rcpp_result_gen;
END_RCPP
}
// get_column_sums
NumericVector get_column_sums(arma::mat X);
RcppExport SEXP _resemble_get_column_sums(SEXP XSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    rcpp_result_gen = Rcpp::wrap(get_column_sums(X));
    return rcpp_result_gen;
END_RCPP
}
// get_weights
arma::mat get_weights(const arma::mat& X, const arma::mat& Y, const String& algorithm, const int xls_min_w, const int xls_max_w);
RcppExport SEXP _resemble_get_weights(SEXP XSEXP, SEXP YSEXP, SEXP algorithmSEXP, SEXP xls_min_wSEXP, SEXP xls_max_wSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const arma::mat& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< const String& >::type algorithm(algorithmSEXP);
    Rcpp::traits::input_parameter< const int >::type xls_min_w(xls_min_wSEXP);
    Rcpp::traits::input_parameter< const int >::type xls_max_w(xls_max_wSEXP);
    rcpp_result_gen = Rcpp::wrap(get_weights(X, Y, algorithm, xls_min_w, xls_max_w));
    return rcpp_result_gen;
END_RCPP
}
// get_local_pls_weights
Rcpp::NumericMatrix get_local_pls_weights(arma::mat projection_mat, arma::mat xloadings, arma::mat coefficients, arma::mat new_x, int min_component, int max_component, bool scale, arma::rowvec Xcenter, arma::rowvec Xscale);
RcppExport SEXP _resemble_get_local_pls_weights(SEXP projection_matSEXP, SEXP xloadingsSEXP, SEXP coefficientsSEXP, SEXP new_xSEXP, SEXP min_componentSEXP, SEXP max_componentSEXP, SEXP scaleSEXP, SEXP XcenterSEXP, SEXP XscaleSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type projection_mat(projection_matSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type xloadings(xloadingsSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type coefficients(coefficientsSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type new_x(new_xSEXP);
    Rcpp::traits::input_parameter< int >::type min_component(min_componentSEXP);
    Rcpp::traits::input_parameter< int >::type max_component(max_componentSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< arma::rowvec >::type Xcenter(XcenterSEXP);
    Rcpp::traits::input_parameter< arma::rowvec >::type Xscale(XscaleSEXP);
    rcpp_result_gen = Rcpp::wrap(get_local_pls_weights(projection_mat, xloadings, coefficients, new_x, min_component, max_component, scale, Xcenter, Xscale));
    return rcpp_result_gen;
END_RCPP
}
// opls_for_projection
List opls_for_projection(arma::mat X, arma::mat Y, int ncomp, bool scale, double maxiter, double tol, String pcSelmethod, double pcSelvalue, String algorithm, const int xls_min_w, const int xls_max_w);
RcppExport SEXP _resemble_opls_for_projection(SEXP XSEXP, SEXP YSEXP, SEXP ncompSEXP, SEXP scaleSEXP, SEXP maxiterSEXP, SEXP tolSEXP, SEXP pcSelmethodSEXP, SEXP pcSelvalueSEXP, SEXP algorithmSEXP, SEXP xls_min_wSEXP, SEXP xls_max_wSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Y(YSEXP);
    Rcpp::traits::input_parameter< int >::type ncomp(ncompSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< double >::type maxiter(maxiterSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< String >::type pcSelmethod(pcSelmethodSEXP);
    Rcpp::traits::input_parameter< double >::type pcSelvalue(pcSelvalueSEXP);
    Rcpp::traits::input_parameter< String >::type algorithm(algorithmSEXP);
    Rcpp::traits::input_parameter< const int >::type xls_min_w(xls_min_wSEXP);
    Rcpp::traits::input_parameter< const int >::type xls_max_w(xls_max_wSEXP);
    rcpp_result_gen = Rcpp::wrap(opls_for_projection(X, Y, ncomp, scale, maxiter, tol, pcSelmethod, pcSelvalue, algorithm, xls_min_w, xls_max_w));
    return rcpp_result_gen;
END_RCPP
}
// opls_get_all
List opls_get_all(arma::mat X, arma::mat Y, int ncomp, bool scale, double maxiter, double tol, String algorithm, const int xls_min_w, const int xls_max_w);
RcppExport SEXP _resemble_opls_get_all(SEXP XSEXP, SEXP YSEXP, SEXP ncompSEXP, SEXP scaleSEXP, SEXP maxiterSEXP, SEXP tolSEXP, SEXP algorithmSEXP, SEXP xls_min_wSEXP, SEXP xls_max_wSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Y(YSEXP);
    Rcpp::traits::input_parameter< int >::type ncomp(ncompSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< double >::type maxiter(maxiterSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< String >::type algorithm(algorithmSEXP);
    Rcpp::traits::input_parameter< const int >::type xls_min_w(xls_min_wSEXP);
    Rcpp::traits::input_parameter< const int >::type xls_max_w(xls_max_wSEXP);
    rcpp_result_gen = Rcpp::wrap(opls_get_all(X, Y, ncomp, scale, maxiter, tol, algorithm, xls_min_w, xls_max_w));
    return rcpp_result_gen;
END_RCPP
}
// opls
List opls(arma::mat X, arma::mat Y, int ncomp, bool scale, double maxiter, double tol, String algorithm, const int xls_min_w, const int xls_max_w);
RcppExport SEXP _resemble_opls(SEXP XSEXP, SEXP YSEXP, SEXP ncompSEXP, SEXP scaleSEXP, SEXP maxiterSEXP, SEXP tolSEXP, SEXP algorithmSEXP, SEXP xls_min_wSEXP, SEXP xls_max_wSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Y(YSEXP);
    Rcpp::traits::input_parameter< int >::type ncomp(ncompSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< double >::type maxiter(maxiterSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< String >::type algorithm(algorithmSEXP);
    Rcpp::traits::input_parameter< const int >::type xls_min_w(xls_min_wSEXP);
    Rcpp::traits::input_parameter< const int >::type xls_max_w(xls_max_wSEXP);
    rcpp_result_gen = Rcpp::wrap(opls(X, Y, ncomp, scale, maxiter, tol, algorithm, xls_min_w, xls_max_w));
    return rcpp_result_gen;
END_RCPP
}
// opls_get_basics
List opls_get_basics(arma::mat X, arma::mat Y, int ncomp, bool scale, double maxiter, double tol, String algorithm, const int xls_min_w, const int xls_max_w);
RcppExport SEXP _resemble_opls_get_basics(SEXP XSEXP, SEXP YSEXP, SEXP ncompSEXP, SEXP scaleSEXP, SEXP maxiterSEXP, SEXP tolSEXP, SEXP algorithmSEXP, SEXP xls_min_wSEXP, SEXP xls_max_wSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Y(YSEXP);
    Rcpp::traits::input_parameter< int >::type ncomp(ncompSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< double >::type maxiter(maxiterSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< String >::type algorithm(algorithmSEXP);
    Rcpp::traits::input_parameter< const int >::type xls_min_w(xls_min_wSEXP);
    Rcpp::traits::input_parameter< const int >::type xls_max_w(xls_max_wSEXP);
    rcpp_result_gen = Rcpp::wrap(opls_get_basics(X, Y, ncomp, scale, maxiter, tol, algorithm, xls_min_w, xls_max_w));
    return rcpp_result_gen;
END_RCPP
}
// predict_opls
Rcpp::NumericMatrix predict_opls(arma::mat bo, arma::mat b, int ncomp, arma::mat newdata, bool scale, arma::mat Xscale);
RcppExport SEXP _resemble_predict_opls(SEXP boSEXP, SEXP bSEXP, SEXP ncompSEXP, SEXP newdataSEXP, SEXP scaleSEXP, SEXP XscaleSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type bo(boSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type b(bSEXP);
    Rcpp::traits::input_parameter< int >::type ncomp(ncompSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type newdata(newdataSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Xscale(XscaleSEXP);
    rcpp_result_gen = Rcpp::wrap(predict_opls(bo, b, ncomp, newdata, scale, Xscale));
    return rcpp_result_gen;
END_RCPP
}
// project_opls
Rcpp::NumericMatrix project_opls(arma::mat projection_mat, int ncomp, arma::mat newdata, bool scale, arma::mat Xcenter, arma::mat Xscale);
RcppExport SEXP _resemble_project_opls(SEXP projection_matSEXP, SEXP ncompSEXP, SEXP newdataSEXP, SEXP scaleSEXP, SEXP XcenterSEXP, SEXP XscaleSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type projection_mat(projection_matSEXP);
    Rcpp::traits::input_parameter< int >::type ncomp(ncompSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type newdata(newdataSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Xcenter(XcenterSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Xscale(XscaleSEXP);
    rcpp_result_gen = Rcpp::wrap(project_opls(projection_mat, ncomp, newdata, scale, Xcenter, Xscale));
    return rcpp_result_gen;
END_RCPP
}
// reconstruction_error
Rcpp::NumericMatrix reconstruction_error(arma::mat x, arma::mat projection_mat, arma::mat xloadings, bool scale, arma::mat Xcenter, arma::mat Xscale, bool scale_back);
RcppExport SEXP _resemble_reconstruction_error(SEXP xSEXP, SEXP projection_matSEXP, SEXP xloadingsSEXP, SEXP scaleSEXP, SEXP XcenterSEXP, SEXP XscaleSEXP, SEXP scale_backSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type x(xSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type projection_mat(projection_matSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type xloadings(xloadingsSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Xcenter(XcenterSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Xscale(XscaleSEXP);
    Rcpp::traits::input_parameter< bool >::type scale_back(scale_backSEXP);
    rcpp_result_gen = Rcpp::wrap(reconstruction_error(x, projection_mat, xloadings, scale, Xcenter, Xscale, scale_back));
    return rcpp_result_gen;
END_RCPP
}
// opls_cv_cpp
List opls_cv_cpp(arma::mat X, arma::mat Y, bool scale, String method, arma::mat mindices, arma::mat pindices, int min_component, int ncomp, arma::mat new_x, double maxiter, double tol, arma::mat wapls_grid, String algorithm, bool statistics);
RcppExport SEXP _resemble_opls_cv_cpp(SEXP XSEXP, SEXP YSEXP, SEXP scaleSEXP, SEXP methodSEXP, SEXP mindicesSEXP, SEXP pindicesSEXP, SEXP min_componentSEXP, SEXP ncompSEXP, SEXP new_xSEXP, SEXP maxiterSEXP, SEXP tolSEXP, SEXP wapls_gridSEXP, SEXP algorithmSEXP, SEXP statisticsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Y(YSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< String >::type method(methodSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type mindices(mindicesSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type pindices(pindicesSEXP);
    Rcpp::traits::input_parameter< int >::type min_component(min_componentSEXP);
    Rcpp::traits::input_parameter< int >::type ncomp(ncompSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type new_x(new_xSEXP);
    Rcpp::traits::input_parameter< double >::type maxiter(maxiterSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type wapls_grid(wapls_gridSEXP);
    Rcpp::traits::input_parameter< String >::type algorithm(algorithmSEXP);
    Rcpp::traits::input_parameter< bool >::type statistics(statisticsSEXP);
    rcpp_result_gen = Rcpp::wrap(opls_cv_cpp(X, Y, scale, method, mindices, pindices, min_component, ncomp, new_x, maxiter, tol, wapls_grid, algorithm, statistics));
    return rcpp_result_gen;
END_RCPP
}
// opls_gesearch
List opls_gesearch(arma::mat Xr, arma::mat Yr, arma::mat Xu, int ncomp, bool scale, bool response, bool reconstruction, bool similarity, bool fresponse, String algorithm);
RcppExport SEXP _resemble_opls_gesearch(SEXP XrSEXP, SEXP YrSEXP, SEXP XuSEXP, SEXP ncompSEXP, SEXP scaleSEXP, SEXP responseSEXP, SEXP reconstructionSEXP, SEXP similaritySEXP, SEXP fresponseSEXP, SEXP algorithmSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type Xr(XrSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Yr(YrSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Xu(XuSEXP);
    Rcpp::traits::input_parameter< int >::type ncomp(ncompSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< bool >::type response(responseSEXP);
    Rcpp::traits::input_parameter< bool >::type reconstruction(reconstructionSEXP);
    Rcpp::traits::input_parameter< bool >::type similarity(similaritySEXP);
    Rcpp::traits::input_parameter< bool >::type fresponse(fresponseSEXP);
    Rcpp::traits::input_parameter< String >::type algorithm(algorithmSEXP);
    rcpp_result_gen = Rcpp::wrap(opls_gesearch(Xr, Yr, Xu, ncomp, scale, response, reconstruction, similarity, fresponse, algorithm));
    return rcpp_result_gen;
END_RCPP
}
// gaussian_process
List gaussian_process(arma::mat X, arma::mat Y, float noisev, bool scale);
RcppExport SEXP _resemble_gaussian_process(SEXP XSEXP, SEXP YSEXP, SEXP noisevSEXP, SEXP scaleSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Y(YSEXP);
    Rcpp::traits::input_parameter< float >::type noisev(noisevSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    rcpp_result_gen = Rcpp::wrap(gaussian_process(X, Y, noisev, scale));
    return rcpp_result_gen;
END_RCPP
}
// predict_gaussian_process
NumericVector predict_gaussian_process(arma::mat Xz, arma::mat alpha, arma::mat newdata, bool scale, arma::mat Xcenter, arma::mat Xscale, arma::mat Ycenter, arma::mat Yscale);
RcppExport SEXP _resemble_predict_gaussian_process(SEXP XzSEXP, SEXP alphaSEXP, SEXP newdataSEXP, SEXP scaleSEXP, SEXP XcenterSEXP, SEXP XscaleSEXP, SEXP YcenterSEXP, SEXP YscaleSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type Xz(XzSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type newdata(newdataSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Xcenter(XcenterSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Xscale(XscaleSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Ycenter(YcenterSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Yscale(YscaleSEXP);
    rcpp_result_gen = Rcpp::wrap(predict_gaussian_process(Xz, alpha, newdata, scale, Xcenter, Xscale, Ycenter, Yscale));
    return rcpp_result_gen;
END_RCPP
}
// gaussian_process_cv
List gaussian_process_cv(arma::mat X, arma::mat Y, arma::mat mindices, arma::mat pindices, float noisev, bool scale, bool statistics);
RcppExport SEXP _resemble_gaussian_process_cv(SEXP XSEXP, SEXP YSEXP, SEXP mindicesSEXP, SEXP pindicesSEXP, SEXP noisevSEXP, SEXP scaleSEXP, SEXP statisticsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Y(YSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type mindices(mindicesSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type pindices(pindicesSEXP);
    Rcpp::traits::input_parameter< float >::type noisev(noisevSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< bool >::type statistics(statisticsSEXP);
    rcpp_result_gen = Rcpp::wrap(gaussian_process_cv(X, Y, mindices, pindices, noisev, scale, statistics));
    return rcpp_result_gen;
END_RCPP
}
// pca_nipals
List pca_nipals(arma::mat X, int ncomp, bool center, bool scale, double maxiter, double tol, String pcSelmethod, double pcSelvalue);
RcppExport SEXP _resemble_pca_nipals(SEXP XSEXP, SEXP ncompSEXP, SEXP centerSEXP, SEXP scaleSEXP, SEXP maxiterSEXP, SEXP tolSEXP, SEXP pcSelmethodSEXP, SEXP pcSelvalueSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< int >::type ncomp(ncompSEXP);
    Rcpp::traits::input_parameter< bool >::type center(centerSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< double >::type maxiter(maxiterSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< String >::type pcSelmethod(pcSelmethodSEXP);
    Rcpp::traits::input_parameter< double >::type pcSelvalue(pcSelvalueSEXP);
    rcpp_result_gen = Rcpp::wrap(pca_nipals(X, ncomp, center, scale, maxiter, tol, pcSelmethod, pcSelvalue));
    return rcpp_result_gen;
END_RCPP
}
// ith_local_fit
Rcpp::NumericVector ith_local_fit(arma::mat X, arma::mat Y, arma::mat xval, arma::mat emgrid, int ncomp_max, int ncomp_min, bool scale, double max_iter, double tol, String algorithm);
RcppExport SEXP _resemble_ith_local_fit(SEXP XSEXP, SEXP YSEXP, SEXP xvalSEXP, SEXP emgridSEXP, SEXP ncomp_maxSEXP, SEXP ncomp_minSEXP, SEXP scaleSEXP, SEXP max_iterSEXP, SEXP tolSEXP, SEXP algorithmSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Y(YSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type xval(xvalSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type emgrid(emgridSEXP);
    Rcpp::traits::input_parameter< int >::type ncomp_max(ncomp_maxSEXP);
    Rcpp::traits::input_parameter< int >::type ncomp_min(ncomp_minSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< double >::type max_iter(max_iterSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< String >::type algorithm(algorithmSEXP);
    rcpp_result_gen = Rcpp::wrap(ith_local_fit(X, Y, xval, emgrid, ncomp_max, ncomp_min, scale, max_iter, tol, algorithm));
    return rcpp_result_gen;
END_RCPP
}
// final_fits_cpp
Rcpp::List final_fits_cpp(const arma::mat& X, const arma::mat& Y, const arma::mat& new_x, int ncomp_min, int ncomp_max, bool scale, double maxiter, double tol, String algorithm);
RcppExport SEXP _resemble_final_fits_cpp(SEXP XSEXP, SEXP YSEXP, SEXP new_xSEXP, SEXP ncomp_minSEXP, SEXP ncomp_maxSEXP, SEXP scaleSEXP, SEXP maxiterSEXP, SEXP tolSEXP, SEXP algorithmSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const arma::mat& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< const arma::mat& >::type new_x(new_xSEXP);
    Rcpp::traits::input_parameter< int >::type ncomp_min(ncomp_minSEXP);
    Rcpp::traits::input_parameter< int >::type ncomp_max(ncomp_maxSEXP);
    Rcpp::traits::input_parameter< bool >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< double >::type maxiter(maxiterSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< String >::type algorithm(algorithmSEXP);
    rcpp_result_gen = Rcpp::wrap(final_fits_cpp(X, Y, new_x, ncomp_min, ncomp_max, scale, maxiter, tol, algorithm));
    return rcpp_result_gen;
END_RCPP
}
// ith_pred_cpp
NumericVector ith_pred_cpp(const NumericMatrix& plslib, const NumericMatrix& xscale, const NumericVector& Xu, Rcpp::Nullable<NumericVector> dxrxu);
RcppExport SEXP _resemble_ith_pred_cpp(SEXP plslibSEXP, SEXP xscaleSEXP, SEXP XuSEXP, SEXP dxrxuSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type plslib(plslibSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type xscale(xscaleSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type Xu(XuSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<NumericVector> >::type dxrxu(dxrxuSEXP);
    rcpp_result_gen = Rcpp::wrap(ith_pred_cpp(plslib, xscale, Xu, dxrxu));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_resemble_fast_diss", (DL_FUNC) &_resemble_fast_diss, 3},
    {"_resemble_fast_diss_vector", (DL_FUNC) &_resemble_fast_diss_vector, 1},
    {"_resemble_fast_self_euclid", (DL_FUNC) &_resemble_fast_self_euclid, 1},
    {"_resemble_moving_cor_diss_xy", (DL_FUNC) &_resemble_moving_cor_diss_xy, 5},
    {"_resemble_moving_cor_diss_self_f64", (DL_FUNC) &_resemble_moving_cor_diss_self_f64, 3},
    {"_resemble_moving_cor_diss_self", (DL_FUNC) &_resemble_moving_cor_diss_self, 3},
    {"_resemble_which_min", (DL_FUNC) &_resemble_which_min, 1},
    {"_resemble_which_min_vector", (DL_FUNC) &_resemble_which_min_vector, 1},
    {"_resemble_top_k_order", (DL_FUNC) &_resemble_top_k_order, 3},
    {"_resemble_extract_by_index", (DL_FUNC) &_resemble_extract_by_index, 2},
    {"_resemble_not_in_same_group", (DL_FUNC) &_resemble_not_in_same_group, 2},
    {"_resemble_compute_nn_quantiles", (DL_FUNC) &_resemble_compute_nn_quantiles, 5},
    {"_resemble_top_k_neighbors", (DL_FUNC) &_resemble_top_k_neighbors, 4},
    {"_resemble_get_col_largest_sd", (DL_FUNC) &_resemble_get_col_largest_sd, 1},
    {"_resemble_get_column_sds", (DL_FUNC) &_resemble_get_column_sds, 1},
    {"_resemble_overall_var", (DL_FUNC) &_resemble_overall_var, 1},
    {"_resemble_get_column_means", (DL_FUNC) &_resemble_get_column_means, 1},
    {"_resemble_get_column_maxs", (DL_FUNC) &_resemble_get_column_maxs, 1},
    {"_resemble_get_column_sums", (DL_FUNC) &_resemble_get_column_sums, 1},
    {"_resemble_get_weights", (DL_FUNC) &_resemble_get_weights, 5},
    {"_resemble_get_local_pls_weights", (DL_FUNC) &_resemble_get_local_pls_weights, 9},
    {"_resemble_opls_for_projection", (DL_FUNC) &_resemble_opls_for_projection, 11},
    {"_resemble_opls_get_all", (DL_FUNC) &_resemble_opls_get_all, 9},
    {"_resemble_opls", (DL_FUNC) &_resemble_opls, 9},
    {"_resemble_opls_get_basics", (DL_FUNC) &_resemble_opls_get_basics, 9},
    {"_resemble_predict_opls", (DL_FUNC) &_resemble_predict_opls, 6},
    {"_resemble_project_opls", (DL_FUNC) &_resemble_project_opls, 6},
    {"_resemble_reconstruction_error", (DL_FUNC) &_resemble_reconstruction_error, 7},
    {"_resemble_opls_cv_cpp", (DL_FUNC) &_resemble_opls_cv_cpp, 14},
    {"_resemble_opls_gesearch", (DL_FUNC) &_resemble_opls_gesearch, 10},
    {"_resemble_gaussian_process", (DL_FUNC) &_resemble_gaussian_process, 4},
    {"_resemble_predict_gaussian_process", (DL_FUNC) &_resemble_predict_gaussian_process, 8},
    {"_resemble_gaussian_process_cv", (DL_FUNC) &_resemble_gaussian_process_cv, 7},
    {"_resemble_pca_nipals", (DL_FUNC) &_resemble_pca_nipals, 8},
    {"_resemble_ith_local_fit", (DL_FUNC) &_resemble_ith_local_fit, 10},
    {"_resemble_final_fits_cpp", (DL_FUNC) &_resemble_final_fits_cpp, 9},
    {"_resemble_ith_pred_cpp", (DL_FUNC) &_resemble_ith_pred_cpp, 4},
    {NULL, NULL, 0}
};

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