35 lines
1.3 KiB
C
35 lines
1.3 KiB
C
#ifndef NATIVE_RUNTIME_H
|
|
#define NATIVE_RUNTIME_H
|
|
#include "model.h"
|
|
#include <stddef.h>
|
|
typedef struct {
|
|
double start, stop, sample_step, max_step, rtol, timeout;
|
|
int bdf, record_samples;
|
|
const char *cancel_path;
|
|
} NativeOptions;
|
|
typedef struct {
|
|
NativeOptions options;
|
|
double *times, *states;
|
|
size_t count, capacity, sample_index;
|
|
double final_time, final_state[NSTATES];
|
|
double wall_start, cpu_start, solve_seconds, solve_cpu_seconds, last_progress;
|
|
double max_accepted_step;
|
|
unsigned long nfev, accepted, rejected, events, starts, njev, nlu;
|
|
int status; /* 0 completed, 1 cancelled, 2 failed */
|
|
const char *message;
|
|
} NativeRun;
|
|
typedef int (*NativeDense)(void *context, double t, double *state);
|
|
double native_wall_time(void);
|
|
double native_cpu_time(void);
|
|
int native_poll(NativeRun *run, double time);
|
|
int native_rhs(NativeRun *run, double t, const double *y, double *dy);
|
|
int native_append(NativeRun *run, double t, const double *y);
|
|
int native_accept(NativeRun *run, double t, double next, const double *old,
|
|
const double *trial, NativeDense dense, void *context,
|
|
double *accepted_time, double *accepted_state);
|
|
int native_rk45(NativeRun *run);
|
|
int native_bdf(NativeRun *run);
|
|
int native_solve(NativeRun *run);
|
|
void native_run_free(NativeRun *run);
|
|
#endif
|