#ifndef _TableOfReal_h_
#define _TableOfReal_h_
/* TableOfReal.h; Paul Boersma, June 5, 2002 */


/* TableOfReal inherits from Data */
#ifndef _Matrix_h_
	#include "Matrix.h"
#endif
#ifndef _Collection_h_
	#include "Collection.h"
#endif
#ifndef _Graphics_h_
	#include "Graphics.h"
#endif

/* For the inheritors. */
#define TableOfReal_members Data_members \
	long numberOfRows, numberOfColumns; \
	char **rowLabels, **columnLabels; \
	double **data;
#define TableOfReal_methods Data_methods
class_create (TableOfReal, Data)

int TableOfReal_init (I, long numberOfRows, long numberOfColumns);
TableOfReal TableOfReal_create (long numberOfRows, long numberOfColumns);
int TableOfReal_removeRow (I, long irow);
int TableOfReal_removeColumn (I, long icol);
int TableOfReal_insertRow (I, long irow);
int TableOfReal_insertColumn (I, long icol);
void TableOfReal_setRowLabel (I, long irow, const char *label);
void TableOfReal_setColumnLabel (I, long icol, const char *label);
long TableOfReal_rowLabelToIndex (I, const char *label);
long TableOfReal_columnLabelToIndex (I, const char *label);
double TableOfReal_getColumnMean (I, long icol);
double TableOfReal_getColumnStdev (I, long icol);

Matrix TableOfReal_to_Matrix (I);
TableOfReal Matrix_to_TableOfReal (I);
int TableOfReal_formula (I, const char *expression, Any /* TableOfReal */ target);
void TableOfReal_drawAsNumbers (I, Graphics g, long rowmin, long rowmax, int iformat, int precision);
void TableOfReal_drawAsNumbers_if (I, Graphics g, long rowmin, long rowmax, int iformat, int precision,
	const char *conditionFormula);
void TableOfReal_drawAsSquares (I, Graphics g, long rowmin, long rowmax,
	long colmin, long colmax, int garnish);
void TableOfReal_drawVerticalLines (I, Graphics g, long rowmin, long rowmax);
void TableOfReal_drawHorizontalLines (I, Graphics g, long rowmin, long rowmax);
void TableOfReal_drawLeftAndRightLines (I, Graphics g, long rowmin, long rowmax);
void TableOfReal_drawTopAndBottomLines (I, Graphics g, long rowmin, long rowmax);

Any TablesOfReal_append (I, thou);
Any TablesOfReal_appendMany (Collection me);
void TableOfReal_sortByLabel (I, long column1, long column2);
void TableOfReal_sortByColumn (I, long column1, long column2);

int TableOfReal_writeToHeaderlessSpreadsheetFile (TableOfReal me, MelderFile file);
TableOfReal TableOfReal_readFromHeaderlessSpreadsheetFile (MelderFile file);

#define TableOfReal_EQUAL_TO  1
#define TableOfReal_NOT_EQUAL_TO  2
#define TableOfReal_LESS_THAN  3
#define TableOfReal_LESS_THAN_OR_EQUAL_TO  4
#define TableOfReal_GREATER_THAN  5
#define TableOfReal_GREATER_THAN_OR_EQUAL_TO  6
TableOfReal TableOfReal_selectRowsWhereColumn (I, long icol, int which, double criterion);

#endif
/* End of file TableOfReal.h */
