mrgsolve
Loading...
Searching...
No Matches
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
22
23#include "RcppInclude.h"
24#include <R_ext/Rdynload.h>
25
26extern "C"{DL_FUNC tofun(SEXP a);}
27
28// Send report to console when istate returns negative after dlsoda call
29void negative_istate(int istate, int maxsteps, double rtol, double atol, int itol);
30
31arma::mat MVGAUSS(Rcpp::NumericMatrix& OMEGA_, int n);
32
33arma::mat MVGAUSS(arma::mat& OMEGA_,int n);
34
35arma::mat MAKEMATRIX(const Rcpp::S4& matlist);
36
37template <class T>
38void sort_unique(T& a) {
39 std::sort(a.begin(), a.end());
40 typename T::iterator last = std::unique(a.begin(), a.end());
41 a.erase(last, a.end());
42}
43
44int find_position(const std::string what,
45 Rcpp::CharacterVector& table);
46
47double digits(const double& a, const double& b);
48
49void dcorr(const Rcpp::NumericMatrix& x);
50
51Rcpp::NumericMatrix SUPERMATRIX(const Rcpp::List& a);
52
53void from_to(const Rcpp::CharacterVector& a,
54 const Rcpp::CharacterVector& b,
55 std::vector<int>& ai,
56 std::vector<int>& bi);
57
58Rcpp::List get_tokens(const Rcpp::CharacterVector& code);
59
60void set_omega(SEXP loc, Rcpp::NumericMatrix& omega_);
61
62Rcpp::NumericMatrix EXPAND_EVENTS(const Rcpp::IntegerVector& idcol_,
63 const Rcpp::NumericMatrix& events,
64 const Rcpp::NumericVector& id);
65
66Rcpp::List mat2df(Rcpp::NumericMatrix const& x);
67
68// Rcpp::NumericMatrix recdata(Rcpp::NumericMatrix& dose,
69// Rcpp::NumericMatrix& obs,
70// Rcpp::IntegerVector& cols,
71// const int n_out_col,const int n_out_row,
72// const Rcpp::NumericVector& addl_,
73// const Rcpp::NumericVector& ii_,
74// const int nid, const int ntime,
75// const int namt, const int nevid,
76// const int ncmt, const int nrate);
77
DL_FUNC tofun(SEXP a)
void set_omega(SEXP loc, Rcpp::NumericMatrix &omega_)
double digits(const double &a, const double &b)
Definition mrgsolve.cpp:38
arma::mat MAKEMATRIX(const Rcpp::S4 &matlist)
Definition mrgsolve.cpp:236
void from_to(const Rcpp::CharacterVector &a, const Rcpp::CharacterVector &b, std::vector< int > &ai, std::vector< int > &bi)
Definition mrgsolve.cpp:299
Rcpp::NumericMatrix EXPAND_EVENTS(const Rcpp::IntegerVector &idcol_, const Rcpp::NumericMatrix &events, const Rcpp::NumericVector &id)
Definition mrgsolve.cpp:322
int find_position(const std::string what, Rcpp::CharacterVector &table)
Definition mrgsolve.cpp:50
Rcpp::List get_tokens(const Rcpp::CharacterVector &code)
Definition mrgsolve.cpp:278
Rcpp::List mat2df(Rcpp::NumericMatrix const &x)
void dcorr(const Rcpp::NumericMatrix &x)
arma::mat MVGAUSS(Rcpp::NumericMatrix &OMEGA_, int n)
Definition mrgsolve.cpp:127
void sort_unique(T &a)
Definition mrgsolve.h:38
Rcpp::NumericMatrix SUPERMATRIX(const Rcpp::List &a)
void negative_istate(int istate, int maxsteps, double rtol, double atol, int itol)
Definition mrgsolve.cpp:65