Beispiel #1
0
double Confusion_getValue (Confusion me, const char32 *stim, const char32 *resp) {
	long stimIndex = TableOfReal_rowLabelToIndex (me, stim);
	if (stimIndex < 1) {
		Melder_throw (U"Stimulus not valid.");
	}
	long respIndex = TableOfReal_columnLabelToIndex (me, resp);
	if (respIndex < 1) {
		Melder_throw (U"Response not valid.");
	}
	return my data[stimIndex][respIndex];
}
Beispiel #2
0
void Confusion_increase (Confusion me, const char32 *stim, const char32 *resp) {
	try {
		long stimIndex = TableOfReal_rowLabelToIndex (me, stim);
		if (stimIndex < 1) {
			Melder_throw (U"Stimulus not valid.");
		}
		long respIndex = TableOfReal_columnLabelToIndex (me, resp);
		if (respIndex < 1) {
			Melder_throw (U"Response not valid.");
		}

		my data[stimIndex][respIndex] += 1.0;
	} catch (MelderError) {
		Melder_throw (me, U": not increased.");
	}
}
double structTableOfReal :: v_getColIndex (const wchar_t *columnLabel) {
	return TableOfReal_columnLabelToIndex (this, columnLabel);
}