#!/bin/sh 
#
# Part of rksuite_90 v1.2 (December 1995)
#         software for initial value problems in ODEs
#
# Authors: R.W. Brankin (NAG Ltd., Oxford, England)
#          I. Gladwell  (Math Dept., SMU, Dallas, TX, USA)
#          see main doc for contact details
#
# Script to automate generation of complex dependent variable
# version of rksuite_90 from a real dependent variable version
#
# USAGE do_r_to_c <infile >outfile
#
# NOTE if "infile" is not the distributed copy of "rksuite_90.bas"
#      or a direct result of one of the other transformation scripts
#      accompanying rksuite_90 the results are not predictable
#
# NOTE this script is not meant to be neat/fast/efficient/...
#      however, it does work!
#
sed -e "s/_r\([0-2]\)/_c\1/" \
    -e "s/m_real_/m_complex_/" \
    -e "/\!dep\!$/s/real/complex/g" \
    -e "/\!spec-line\!/s/= value/= conjg(value)/" \
    -e "/\!spec-ar\!/s-(vec_2/weights)-(conjg(vec_2)/weights)-"
