//
//	C++ Routines to manipulate Taylor series for solving a differential
//  equation.
//
//  By Dennis J. Darland 
//  10/21/90
//  Public Domain
//  Preliminary version 1.2
//  Many enhancements expected.
//  PROVIDED WITH NO WARRANTY.
//  
#include <stream.h>
#include <my_complex.h>
#include <stdlib.h>
#define MAX_TERMS 60
class t_s
	{
	friend class complex;
	complex terms[MAX_TERMS];
	int alloc_terms;
	int first_term;
	int last_term;
	complex h;
	complex x0;
public:	
 	t_s();
	t_s(t_s&);
	~t_s();
void	set_first(int);
void	set_last(int);
void	set_h(complex);
void	set_x0(complex);
friend	void set_data(t_s&,t_s&);
friend	void set_terms(t_s&,complex*);
void	report_error(int);
friend complex	ats(int,t_s&,t_s&,int);
friend complex	att(int,t_s&,t_s&,int);
friend 	int get_last_term(t_s &);
friend 	double get_x0(t_s &);
friend 	double get_y0(t_s &);
friend t_s operator+(t_s&,t_s&);
friend t_s operator-(t_s&,t_s&);
friend t_s operator*(t_s&,t_s&);
friend t_s operator/(t_s&,t_s&);
t_s &	operator+=(t_s &);
t_s &	operator-=(t_s &);
t_s &  operator=(t_s &);
friend void display(t_s&,int);
friend t_s	deriv(t_s&);
friend void diff_eq(t_s&,t_s&);
friend void higher_diff_eq(t_s&,t_s&,int);
friend void	set_term_from_deriv(int,t_s&,t_s&);
friend void	higher_set_term_from_deriv(int,t_s&,t_s&,int);
friend void	jump(t_s&);
friend void	leap(t_s&,int);
friend void equation(t_s&,t_s&,...);
friend t_s x(t_s &);
friend t_s constant(t_s &,complex);
friend t_s expt(t_s &,t_s &);
friend t_s sqrt(t_s &);
friend t_s exp(t_s &);
friend t_s log(t_s &);
friend t_s sin(t_s &);
friend t_s cos(t_s &);
friend t_s tan(t_s &);
friend t_s sinh(t_s &);
friend t_s cosh(t_s &);
friend t_s tanh(t_s &);
friend t_s asin(t_s &);
friend t_s acos(t_s &);
friend t_s atan(t_s &);
friend complex radius_cp(t_s &,complex & order);
friend complex radius_xx(t_s &,complex & order);
friend void	adjust_h(t_s&,complex);
	};
	





