mrgsolve
mrgsolve.h
Go to the documentation of this file.
1 // Copyright (C) 2013 - 2019 Metrum Research Group, LLC
2 //
3 // This file is part of mrgsolve.
4 //
5 // mrgsolve is free software: you can redistribute it and/or modify it
6 // under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // mrgsolve is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with mrgsolve. If not, see <http://www.gnu.org/licenses/>.
17 
23 #include "RcppInclude.h"
24 #include <R_ext/Rdynload.h>
25 
26 extern "C"{DL_FUNC tofun(SEXP a);}
27 
28 // Send report to console when istate returns negative after dlsoda call
29 void negative_istate(int istate, int maxsteps, double rtol, double atol);
30 
31 arma::mat MVGAUSS(Rcpp::NumericMatrix& OMEGA_, int n);
32 
33 arma::mat MVGAUSS(arma::mat& OMEGA_,int n);
34 
35 template <class T>
36 void sort_unique(T& a) {
37  std::sort(a.begin(), a.end());
38  typename T::iterator last = std::unique(a.begin(), a.end());
39  a.erase(last, a.end());
40 }
41 
42 int find_position(const Rcpp::CharacterVector& what,
43  const Rcpp::CharacterVector& table);
44 
45 double digits(const double& a, const double& b);
46 
47 void dcorr(const Rcpp::NumericMatrix& x);
48 
49 Rcpp::NumericMatrix SUPERMATRIX(const Rcpp::List& a);
50 
51 void from_to(const Rcpp::CharacterVector& a,
52  const Rcpp::CharacterVector& b,
53  std::vector<int>& ai,
54  std::vector<int>& bi);
55 
56 Rcpp::List get_tokens(const Rcpp::CharacterVector& code);
57 
58 void set_omega(SEXP loc, Rcpp::NumericMatrix& omega_);
59 
60 Rcpp::NumericMatrix EXPAND_EVENTS(const Rcpp::IntegerVector& idcol_,
61  const Rcpp::NumericMatrix& events,
62  const Rcpp::NumericVector& id);
63 
64 // Rcpp::NumericMatrix recdata(Rcpp::NumericMatrix& dose,
65 // Rcpp::NumericMatrix& obs,
66 // Rcpp::IntegerVector& cols,
67 // const int n_out_col,const int n_out_row,
68 // const Rcpp::NumericVector& addl_,
69 // const Rcpp::NumericVector& ii_,
70 // const int nid, const int ntime,
71 // const int namt, const int nevid,
72 // const int ncmt, const int nrate);
73 
RcppInclude.h
negative_istate
void negative_istate(int istate, int maxsteps, double rtol, double atol)
Definition: mrgsolve.cpp:56
MVGAUSS
arma::mat MVGAUSS(Rcpp::NumericMatrix &OMEGA_, int n)
Definition: mrgsolve.cpp:113
get_tokens
Rcpp::List get_tokens(const Rcpp::CharacterVector &code)
Definition: mrgsolve.cpp:222
from_to
void from_to(const Rcpp::CharacterVector &a, const Rcpp::CharacterVector &b, std::vector< int > &ai, std::vector< int > &bi)
Definition: mrgsolve.cpp:243
find_position
int find_position(const Rcpp::CharacterVector &what, const Rcpp::CharacterVector &table)
Definition: mrgsolve.cpp:50
EXPAND_EVENTS
Rcpp::NumericMatrix EXPAND_EVENTS(const Rcpp::IntegerVector &idcol_, const Rcpp::NumericMatrix &events, const Rcpp::NumericVector &id)
Definition: mrgsolve.cpp:266
sort_unique
void sort_unique(T &a)
Definition: mrgsolve.h:36
tofun
DL_FUNC tofun(SEXP a)
digits
double digits(const double &a, const double &b)
Definition: mrgsolve.cpp:38
dcorr
void dcorr(const Rcpp::NumericMatrix &x)
SUPERMATRIX
Rcpp::NumericMatrix SUPERMATRIX(const Rcpp::List &a)
set_omega
void set_omega(SEXP loc, Rcpp::NumericMatrix &omega_)