Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/fun_harness_create.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ deepstate_fun_create<-function(package_path,function_name,sep="infun"){
variable <- paste0("NumericVector ",arg.name,"(1);","\n",indent,arg.name,"[0]")
primitives <- c(primitives,arg.name)
}
else if(type.arg == "std::string")
else if(type.arg == "std::string" || type.arg == "String")
{
variable <- paste0("CharacterVector ",arg.name,"(1);","\n",indent,arg.name,"[0]")
primitives <- c(primitives,arg.name)
Expand All @@ -176,7 +176,7 @@ deepstate_fun_create<-function(package_path,function_name,sep="infun"){
}
proto_args <- gsub(" ","",paste0(proto_args,arg.name))
if(argument.i <= nrow(functions.rows)) {
if(type.arg == "int" || type.arg == "double" || type.arg == "std::string"){
if(type.arg == "int" || type.arg == "double" || type.arg == "std::string" || type.arg == "String"){
proto_args <- paste0(proto_args,"[0],")
}else{
proto_args <- paste0(proto_args,",")
Expand Down
2 changes: 1 addition & 1 deletion R/get-pkgs.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ deepstate_datatype_check <- function(params.list){
params.list <-gsub("Rcpp::","",params.list)
params.list <-gsub(" ","",params.list)
datatypes <- list("NumericVector","NumericMatrix" ,"arma::mat","double",
"string","CharacterVector","int","IntegerVector")
"string", "String","CharacterVector","int","IntegerVector")
for(pkg.i in seq_along(params.list)){
#print(params.list[[pkg.i]])
if(is.element(params.list[[pkg.i]], datatypes) =="FALSE"){
Expand Down
8 changes: 8 additions & 0 deletions inst/include/RcppDeepState.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,14 @@ std::string RcppDeepState_string(){
return rand_string;
}

//Rcpp string generation
Rcpp::String RcppDeepState_String(){
std::string rand_string;
rand_string = DeepState_CStrUpToLen(50,"abcdefghijklmnopqrstuvwxyz");
Rcpp::String rand_rcpp_string(rand_string);
return rand_rcpp_string;
}

//default arma::mat generation
arma::mat RcppDeepState_mat(){
int rows = DeepState_IntInRange(1,10);
Expand Down