Mercurial > hg > Gears > GearsAgda
annotate src/llrb/compare.c @ 314:1839586f5b41
pthread CUDA test
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 15 Feb 2017 12:34:19 +0900 |
parents | dc6f665bb753 |
children |
rev | line source |
---|---|
69
368306e1bfed
llrb deletion(not work).
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 #include "llrbContext.h" |
368306e1bfed
llrb deletion(not work).
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 |
368306e1bfed
llrb deletion(not work).
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 void compare(struct Context* context, struct Tree* tree, int key1, int key2) { |
368306e1bfed
llrb deletion(not work).
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 if (key1 == key2) { |
81
dc6f665bb753
implement delete(tail call). do not work
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
69
diff
changeset
|
5 tree->result = EQ; |
69
368306e1bfed
llrb deletion(not work).
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 } else if (key1 < key2) { |
81
dc6f665bb753
implement delete(tail call). do not work
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
69
diff
changeset
|
7 tree->result = GT; |
69
368306e1bfed
llrb deletion(not work).
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 } else { |
81
dc6f665bb753
implement delete(tail call). do not work
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
69
diff
changeset
|
9 tree->result = LT; |
69
368306e1bfed
llrb deletion(not work).
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 } |
368306e1bfed
llrb deletion(not work).
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 } |