From cb88bf03d274ef9b044103eeba7614553a764052 Mon Sep 17 00:00:00 2001 From: Joe Thorley Date: Thu, 12 Dec 2024 07:24:35 -0800 Subject: [PATCH] fun to fun_ssd --- R/RcppExports.R | 4 ++-- R/fun.R | 18 ++++++++++++++++++ src/RcppExports.cpp | 10 +++++----- src/fun.cpp | 2 +- 4 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 R/fun.R diff --git a/R/RcppExports.R b/R/RcppExports.R index 5530dd42..5d40be08 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -1,7 +1,7 @@ # Generated by using Rcpp::compileAttributes() -> do not edit by hand # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 -fun <- function(x) { - .Call(`_ssdtools_fun`, x) +fun_ssd <- function(x) { + .Call(`_ssdtools_fun_ssd`, x) } diff --git a/R/fun.R b/R/fun.R new file mode 100644 index 00000000..af035184 --- /dev/null +++ b/R/fun.R @@ -0,0 +1,18 @@ +# Copyright 2023-2024 Australian Government Department of Climate Change, +# Energy, the Environment and Water +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +.ssd_fun <- function(x) { + fun_ssd(x) +} diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index a8914963..b2e113a9 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -11,20 +11,20 @@ Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); Rcpp::Rostream& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); #endif -// fun -double fun(double x); -RcppExport SEXP _ssdtools_fun(SEXP xSEXP) { +// fun_ssd +double fun_ssd(double x); +RcppExport SEXP _ssdtools_fun_ssd(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(fun(x)); + rcpp_result_gen = Rcpp::wrap(fun_ssd(x)); return rcpp_result_gen; END_RCPP } static const R_CallMethodDef CallEntries[] = { - {"_ssdtools_fun", (DL_FUNC) &_ssdtools_fun, 1}, + {"_ssdtools_fun_ssd", (DL_FUNC) &_ssdtools_fun_ssd, 1}, {NULL, NULL, 0} }; diff --git a/src/fun.cpp b/src/fun.cpp index f7f4454b..27be4034 100644 --- a/src/fun.cpp +++ b/src/fun.cpp @@ -19,6 +19,6 @@ using namespace Rcpp; // [[Rcpp::export]] -double fun(double x) { +double fun_ssd(double x) { return x; }