-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from stscl/dev
make rcmd check clean
- Loading branch information
Showing
13 changed files
with
169 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
# Generated by using Rcpp::compileAttributes() -> do not edit by hand | ||
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 | ||
|
||
IC_SSH <- function(d, s, bin_method) { | ||
.Call(`_sshicm_IC_SSH`, d, s, bin_method) | ||
RcppINSSH <- function(d, s) { | ||
.Call(`_sshicm_RcppINSSH`, d, s) | ||
} | ||
|
||
IC_SSHICM <- function(d, s, seed, permutation_number, bin_method = "Sturges") { | ||
.Call(`_sshicm_IC_SSHICM`, d, s, seed, permutation_number, bin_method) | ||
RcppINSSHICM <- function(d, s, seed, permutation_number) { | ||
.Call(`_sshicm_RcppINSSHICM`, d, s, seed, permutation_number) | ||
} | ||
|
||
IN_SSH <- function(d, s) { | ||
.Call(`_sshicm_IN_SSH`, d, s) | ||
RcppICSSH <- function(d, s, bin_method = "Sturges") { | ||
.Call(`_sshicm_RcppICSSH`, d, s, bin_method) | ||
} | ||
|
||
IN_SSHICM <- function(d, s, seed, permutation_number) { | ||
.Call(`_sshicm_IN_SSHICM`, d, s, seed, permutation_number) | ||
RcppICSSHICM <- function(d, s, seed, permutation_number, bin_method = "Sturges") { | ||
.Call(`_sshicm_RcppICSSHICM`, d, s, seed, permutation_number, bin_method) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef IC_SSH_H | ||
#define IC_SSH_H | ||
|
||
#include <iostream> | ||
#include <vector> | ||
#include <map> | ||
#include <unordered_map> | ||
#include <random> | ||
#include <cmath> | ||
#include <algorithm> | ||
#include <stdexcept> | ||
#include <numeric> | ||
#include "HistogramDensityEst.h" | ||
#include "RelEntropy.h" | ||
#include <RcppThread.h> | ||
|
||
double IC_SSH(const std::vector<double>& d, | ||
const std::vector<int>& s, | ||
const std::string& bin_method); | ||
|
||
std::vector<double> IC_SSHICM(const std::vector<double>& d, | ||
const std::vector<int>& s, | ||
unsigned int seed, | ||
int permutation_number, | ||
const std::string& bin_method = "Sturges"); | ||
|
||
#endif // IC_SSH_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef IN_SSH_H | ||
#define IN_SSH_H | ||
|
||
#include <iostream> | ||
#include <vector> | ||
#include <map> | ||
#include <cmath> | ||
#include <algorithm> | ||
#include <numeric> | ||
#include <random> | ||
#include <stdexcept> | ||
#include <RcppThread.h> | ||
|
||
double IN_SSH(const std::vector<int>& d, | ||
const std::vector<int>& s); | ||
|
||
std::vector<double> IN_SSHICM(const std::vector<int>& d, | ||
const std::vector<int>& s, | ||
unsigned int seed, | ||
int permutation_number); | ||
|
||
#endif // IN_SSH_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#include <vector> | ||
#include "IN_SSH.h" | ||
#include "IC_SSH.h" | ||
#include <Rcpp.h> | ||
|
||
// Rcpp wrapper for IN_SSH | ||
// [[Rcpp::export]] | ||
double RcppINSSH(Rcpp::IntegerVector d, Rcpp::IntegerVector s) { | ||
// Convert Rcpp::IntegerVector to std::vector<int> | ||
std::vector<int> d_std = Rcpp::as<std::vector<int>>(d); | ||
std::vector<int> s_std = Rcpp::as<std::vector<int>>(s); | ||
|
||
// Call the IN_SSH function | ||
double result = IN_SSH(d_std, s_std); | ||
|
||
// Return the result as a double | ||
return result; | ||
} | ||
|
||
// Rcpp wrapper for IN_SSHICM | ||
// [[Rcpp::export]] | ||
Rcpp::NumericVector RcppINSSHICM(Rcpp::IntegerVector d, | ||
Rcpp::IntegerVector s, | ||
unsigned int seed, | ||
int permutation_number) { | ||
// Convert Rcpp::IntegerVector to std::vector<int> | ||
std::vector<int> d_std = Rcpp::as<std::vector<int>>(d); | ||
std::vector<int> s_std = Rcpp::as<std::vector<int>>(s); | ||
|
||
// Call the IN_SSHICM function | ||
std::vector<double> result = IN_SSHICM(d_std, s_std, seed, permutation_number); | ||
|
||
// Convert the std::vector<double> result to Rcpp::NumericVector | ||
return Rcpp::wrap(result); | ||
} | ||
|
||
// Rcpp wrapper for IC_SSH | ||
// [[Rcpp::export]] | ||
double RcppICSSH(Rcpp::NumericVector d, | ||
Rcpp::IntegerVector s, | ||
std::string bin_method = "Sturges") { | ||
// Convert Rcpp::NumericVector to std::vector<double> | ||
std::vector<double> d_std = Rcpp::as<std::vector<double>>(d); | ||
|
||
// Convert Rcpp::IntegerVector to std::vector<int> | ||
std::vector<int> s_std = Rcpp::as<std::vector<int>>(s); | ||
|
||
// Call the IC_SSH function | ||
double result = IC_SSH(d_std, s_std, bin_method); | ||
|
||
// Return the result as a double | ||
return result; | ||
} | ||
|
||
// Rcpp wrapper for IC_SSHICM | ||
// [[Rcpp::export]] | ||
Rcpp::NumericVector RcppICSSHICM(Rcpp::NumericVector d, | ||
Rcpp::IntegerVector s, | ||
unsigned int seed, | ||
int permutation_number, | ||
std::string bin_method = "Sturges") { | ||
// Convert Rcpp::NumericVector to std::vector<double> | ||
std::vector<double> d_std = Rcpp::as<std::vector<double>>(d); | ||
|
||
// Convert Rcpp::IntegerVector to std::vector<int> | ||
std::vector<int> s_std = Rcpp::as<std::vector<int>>(s); | ||
|
||
// Call the IC_SSHICM function | ||
std::vector<double> result = IC_SSHICM(d_std, s_std, seed, permutation_number, bin_method); | ||
|
||
// Convert the std::vector<double> result to Rcpp::NumericVector | ||
return Rcpp::wrap(result); | ||
} |