#ifndef _Pattern_h_
#define _Pattern_h_
/* David Weenink, 19990221 */

#ifndef _Matrix_h_
	#include "Matrix.h"
#endif

#define Pattern_members Matrix_members
#define Pattern_methods Matrix_methods
class_create (Pattern, Matrix)

/* Attributes:
   xmin				:index of first input node.
   xmax				:last node index.
   nx				:Number of inputs.
   dx				:1.
   x1				:1.
   ymin				:1.
   ymax				:#patterns.
   dy				:1.
   y1				:1.
   z[iy][ix]		:the inputs. All elements in interval [0,1].
*/

int Pattern_init (I, long ny, long nx);

Any Pattern_create (long ny, long nx);

void Pattern_normalize (I, int choice, double pmin, double pmax);
/* choice == 1: z[i][j] = (z[i][j]-pmin) / (pmax-pmin);
 * choice == 2: z[i][j] *= 1.0 / sum(j=1,j=nx, z[i][j]-pmin)
 */					

void Pattern_draw (I, Graphics g, long pattern, double xmin, double xmax,
	double ymin, double ymax, int garnish);
	
Pattern Matrix_to_Pattern (I, int join);
Matrix Pattern_to_Matrix (Pattern me);

#endif /* _Pattern_h_ */
