-
-/* Return the group belonging to the v_th dependent variable
- which matches the key */
-static struct group_statistics *
-get_group(int v, struct group_statistics *key)
-{
- struct group_statistics *gs;
- gs = hsh_find(hash[v],key);
-
-
- if ( ( !gs ) && inequality_compare)
- {
- /* Here we degrade to a linear search.
- This would seem inefficient. However, it should only ever happen
- with the T-TEST, for which there are exactly two groups */
-
- struct hsh_iterator hi;
-
- assert( hsh_count(hash[v]) == 2 ) ;
- for(gs = (struct group_statistics *) hsh_first(hash[v],&hi);
- gs != 0 ;
- gs = (struct group_statistics *) hsh_next(hash[v],&hi) )
- {
- int cmp;
-
- cmp = compare_values(&gs->id, &key->id, 0);
-
- assert( cmp != 0 ); /* or else the hash would have found something */
-
- if ( cmp == -1 &&
- ( gs->criterion == CMP_GT || gs->criterion == CMP_GE )
- )
- break;
-
- if ( cmp == 1 &&
- ( gs->criterion == CMP_LT || gs->criterion == CMP_LE )
- )
- break;
- }
- }
-
- return gs;
-}