/* DTW_def.h */
/* David Weenink, 19981207 */

#define ooSTRUCT DTW_State
oo_DEFINE_STRUCT (DTW_State)
	oo_LONG (x)
	oo_LONG (y)
oo_END_STRUCT (DTW_State) 
#undef ooSTRUCT

#define ooSTRUCT DTW
oo_DEFINE_CLASS (DTW, Matrix)
	oo_DOUBLE (weightedDistance)
	oo_LONG (pathLength)
	#if oo_WRITING || oo_DESCRIBING || oo_EQUALLING || oo_COMPARING
		oo_STRUCT_VECTOR (DTW_State, path, my pathLength)
	#elif oo_READING_ASCII
		{
		long i;
		if (! (my path = NUMstructvector (DTW_State, 1, my nx + my ny - 1))) return 0;
		for (i = 1; i <= my pathLength; i ++)
			if (! DTW_State_readAscii (& my path [i], f)) return 0;
		}
	#elif oo_READING_BINARY	
		{
		long i;
		if (! (my path = NUMstructvector (DTW_State, 1, my nx + my ny - 1))) return 0;
		for (i = 1; i <= my pathLength; i ++)
			if (! DTW_State_readBinary (& my path [i], f)) return 0;
		}
	#else
		oo_STRUCT_VECTOR (DTW_State, path, my nx + my ny - 1)
	#endif
oo_END_CLASS (DTW)
#undef ooSTRUCT

/* End of file DTW_def.h */
