Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Fix struct for rxode2parse
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Sep 6, 2023
1 parent 5bfceed commit 78279b3
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 42 deletions.
31 changes: 31 additions & 0 deletions inst/include/rxode2parseStruct.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#ifndef __RXODE2PARSESTRUCT_H__
#define __RXODE2PARSESTRUCT_H__

#if defined(__cplusplus)
extern "C" {
#endif

typedef struct sbuf {
char *s; /* curr print buffer */
int sN;
Expand Down Expand Up @@ -415,3 +422,27 @@ typedef double (*t_getTime)(int idx, rx_solving_options_ind *ind);
typedef int (*t_locateTimeIndex)(double obs_time, rx_solving_options_ind *ind);
typedef int (*t_handle_evidL)(int evid, double *yp, double xout, rx_solving_options_ind *ind) ;
typedef double (*t_getDur)(int l, rx_solving_options_ind *ind, int backward, unsigned int *p);

#ifdef _isrxode2parse_

extern rx_solving_options _rxode2parse_op_global;
extern rx_solve _rxode2parse_rx_global;
extern t_handle_evidL _rxode2parse_handle_evidL;
extern t_getDur _rxode2parse_getDur;
extern t_getTime _rxode2parse_getTime;
#define op_global _rxode2parse_op_global
#define rx_global _rxode2parse_rx_global
#define AMT _rxode2parse_AMT
#define LAG _rxode2parse_LAG
#define RATE _rxode2parse_RATE
#define DUR _rxode2parse_DUR
#define calc_mtime _rxode2parse_calc_mtime
#define getTime _rxode2parse_getTime
#define _locateTimeIndex _rxode2parse_locateTimeIndex

#endif

#if defined(__cplusplus)
}
#endif
#endif
29 changes: 7 additions & 22 deletions src/comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,21 @@
#define _(String) (String)
#endif

#define op_global _rxode2parse_op_global
#define rx_global _rxode2parse_rx_global
#define AMT _rxode2parse_AMT
#define LAG _rxode2parse_LAG
#define RATE _rxode2parse_RATE
#define DUR _rxode2parse_DUR
#define calc_mtime _rxode2parse_calc_mtime
#define getTime_ _rxode2parse_getTime_
#define getTime _rxode2parse_getTime
#define _locateTimeIndex _rxode2parse_locateTimeIndex
#define handle_evidL _rxode2parse_handle_evidL

#include "../inst/include/rxode2parse.h"
#define _calcDerived _rxode2parse_calcDerived

extern rx_solving_options _rxode2parse_op_global;
extern rx_solve _rxode2parse_rx_global;
extern t_handle_evidL _rxode2parse_handle_evidL;
extern t_getDur _rxode2parse_getDur;
#define _getDur _rxode2parse_getDur
#ifndef max2
#define max2( a , b ) ( (a) > (b) ? (a) : (b) )
#endif

#include "../inst/include/rxode2parseHandleEvid.h"
#include "../inst/include/rxode2parseGetTime.h"
#include "../inst/include/rxode2parseHandleSs.h"

#ifndef max2
#define max2( a , b ) ( (a) > (b) ? (a) : (b) )
#endif

#include "solComp.h"
#include "compSSc.h"
#include "comp.h"


void solveWith1Pt_lin(double *yp,
double xout, double xp,
int *i,
Expand Down
3 changes: 3 additions & 0 deletions src/tran.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ extern vLines centralLines;
extern vLines sbPm, sbPmDt, sbNrmL;


#undef RATE
#undef DUR

#define FBIO 1
#define ALAG 2
Expand Down Expand Up @@ -338,3 +340,4 @@ void _rxode2parse_unprotect(void);
char *getLine (char *src, int line, int *lloc);

#endif // __TRAN_H__

20 changes: 0 additions & 20 deletions src/utilcpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,6 @@

using namespace Rcpp;

extern "C" {
#define op_global _rxode2parse_op_global
#define rx_global _rxode2parse_rx_global
#define AMT _rxode2parse_AMT
#define LAG _rxode2parse_LAG
#define RATE _rxode2parse_RATE
#define DUR _rxode2parse_DUR
#define calc_mtime _rxode2parse_calc_mtime
#define getTime_ _rxode2parse_getTime_
#define getTime _rxode2parse_getTime
#define _locateTimeIndex _rxode2parse_locateTimeIndex

extern rx_solving_options _rxode2parse_op_global;
extern rx_solve _rxode2parse_rx_global;
extern t_handle_evidL _rxode2parse_handle_evidL;
extern t_getDur _rxode2parse_getDur;
extern t_getTime _rxode2parse_getTime;
#define _getDur _rxode2parse_getDur
}

#include "../inst/include/rxode2parseHandleEvid.h"
#include "../inst/include/rxode2parseGetTime.h"
#include "../inst/include/rxode2parseHandleSs.h"
Expand Down

0 comments on commit 78279b3

Please sign in to comment.