#ifndef _QRKD78_H
#define _QRKD78_H

#include "f_eval.h"

typedef struct _qrkd78
{
    long double T, *Y, TOL, *C, *W;
    int N, IND, NW;
    QF_EVAL F;
} QRKD78;

/*
** RKD78 is a 7/8 pair Runge-Kutta method using Defect-based error
** control, written by Wayne Enright (+ others?)  QRKD is a 
** quad-precision vesion of it.  Fortran's QUAD==gcc's long double.
** n = number of equations.
** Time = initial time.
** y = pointer to your array of n state variables.
** f = function of yours that computes ydot
** eps = allowable relative error.
**
** stiff_flag must be 0, and zero must 0.0.
*/ 
QRKD78 *Qrkd78Alloc(int n, long double Time, long double *y, QF_EVAL f,
    int stiff_flag, long double eps, long double zero);

/* Do the actual integration.  Return the actual TOUT */
long double Qrkd78Integrate(QRKD78 *r, long double TOUT);

void Qrkd78Free(QRKD78 *r);

#endif  /* _QRKD78_H */
