/* 
 * Thomas Pantzer: t_polynom.h, v0.4.7  8.6.99 16:32 
 * 
 * 
 * Copyright 1999 by Thomas Pantzer
 * 
 * Permission to use, copy, modify, and distribute this software for noncommercial 
 * use and without fee is hereby granted, provided that the above copyright notice 
 * appear in all copies and that both that copyright notice and this permission 
 * notice appear in supporting documentation, and that the name of the Author not be 
 * used in advertising or publicity pertaining to distribution of the software 
 * without specific, written prior permission. The Author makes no representations about
 * the suitability of this software for any purpose.  It is provided "as is" 
 * without expressed or implied warranty. 
 * 
 * 
 * pantec@isys2.informatik.uni-leipzig.de   (Thomas Pantzer) 
 * 
 */



#ifndef _T_POLYNOM_H
#define _T_POLYNOM_H


class t_parameter {
public:
		void Init(double,int);

		double Get(void);
		double Real(void);
		void Set(double);
		void Reset(void);
		void Assign(void);
		void AddV(double);
		void AddS(double);

		char used;
		double logV,logstep;
		int update;
private:
	double Value,Shadow,saved;
	int counter;
};
	

class t_Polynom {
public:
 	  void Grad(double x_arg[], double h, double epsilon, double damp, char wake);
	double AddVal(int i, int j, double d);
	double AddVal(int idx, double d);

	double Result(double arg[]);

	  void Done(void);
	  void Init(t_Polynom *P);
	  void Init(int na, int np);

	  void SetVal(int idx, double d);
	  void UseVal(int idx, char d);
	  void Reset(t_Polynom *P);
	   int Index(int i, int j);
	  void SetVal(int i, int j, double d);
	  void UseVal(int i, int j, char d);

	  void BatchParm(int s);

//	  char inuse(int i, int j);
//        double Value(int i, int j);

	double C_Val(int i, int j);
	  char C_used(int i, int j);
	double C_logV(int i, int j);


	t_parameter *_C;
	double *dc; 
private:
	int nargs, nparams;
	t_Polynom *LP,*HP;

	void GetMem(void);
};



#define MAX_POLY_PARMS	6
extern double leftside(int j);



#endif







/**/
/**/
/**/
/**/
/**/
/**/
/**/
/**/
/*****  End Of File  ****************************/
