ode-initval/step.ss
(define-struct ode-step-type
               (name
                can-use-dydt-in?
                gives-exact-dydt-out?
                make
                apply
                reset
                order))

;(define-struct ode-step
;               (type
;                dimension
;                state))
(define-values (struct:ode-step
                ode-step-constructor
                ode-step?
                ode-step-field-ref
                set-ode-step-field!)
  (make-struct-type 'ode-step #f 3 0))

(define (make-ode-step step-type dim)
  (ode-step-constructor
   step-type
   dim
   ((ode-step-type-make step-type) dim)))

(define ode-step-step-type
  (make-struct-field-accessor ode-step-field-ref 0 'step-type))
(define set-ode-stepper-step-type!
  (make-struct-field-mutator set-ode-step-field! 0 'step-type))

(define ode-step-dimension
  (make-struct-field-accessor ode-step-field-ref 1 'dimension))
(define set-ode-step-dimension!
  (make-struct-field-mutator set-ode-step-field! 1 'dimension))

(define ode-step-state
  (make-struct-field-accessor ode-step-field-ref 2 'state))
(define set-ode-step-state!
  (make-struct-field-mutator set-ode-step-field! 2 'state))

;; ode-step-name: ode-step -> string
(define (ode-step-name step)
  (ode-step-type-name (ode-step-step-type step)))

;; ode-step-order: ode-step -> integer
(define (ode-step-order step)
  ((ode-step-type-order (ode-step-step-type step))
   (ode-step-state step)))

;; ode-step-apply:
;;   ode-step x real x real x vector of real x vector of real x
;;   vector of real x vector of real x ode-system  -> void
(define (ode-step-apply step t h y y-err dydt-in dydt-out dydt)
  ((ode-step-type-apply (ode-step-step-type step))
   (ode-step-state step) (ode-step-dimension step)
   t h y y-err dydt-in dydt-out dydt))

;; ode-step-reset: ode-step -> void
(define (ode-step-reset step)
  ((ode-step-type-reset (ode-step-step-type step))
   (ode-step-state step) (ode-step-dimension step)))