Exemple #1
0
/* [n] -> {0 .., n-1} */
unsigned int rc_h1(int n, int j, unsigned int value) {
  
  assert((j >= 1) && (j <= 3));
  
  return rc_hash(n, j, value);
  
}
Exemple #2
0
/* Kre^3 -> {1 ... Kre} */
unsigned int rc_h3(int Kre, int j, unsigned int value) {
  
  assert((j >= 1) && (j <= 3));
  
  return rc_hash(Kre, j, value) + 1;
  
  /* return 1 to Kre */
  return (value % Kre) + 1;
  
}
Exemple #3
0
static void _hash_neg(unit_state *state) {
    rcint *a = rcint_alloc(-42);
    assert_eq(state, -42 & INT_MAX, rc_hash(a));
}
Exemple #4
0
static void _hash_pos(unit_state *state) {
    rcint *a = rcint_alloc(42);
    assert_eq(state, 42, rc_hash(a));
}