[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnugo-devel] fields removed from struct eye_data
From: |
Gunnar Farnebäck |
Subject: |
[gnugo-devel] fields removed from struct eye_data |
Date: |
Mon, 07 Feb 2005 05:42:23 +0100 |
User-agent: |
EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/21.3 (sparc-sun-solaris2.9) MULE/5.0 (SAKAKI) |
This patch removes the fields attack_point, defense_point, and type
from struct eye_data. The first two are unused by the owl code and
unneeded in the dragon code in the presence of the struct
vital_eye_points arrays. The type field has not been used anywhere for
some time now. The patch also makes the functions topological_eye()
and add_false_eye() static to optics.c.
- attack_point, defense_point, and type fields removed from struct
eye_data
- topological_eye() and add_false_eye() made static in optics.c
/Gunnar
Index: engine/dragon.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/dragon.c,v
retrieving revision 1.144
diff -u -r1.144 dragon.c
--- engine/dragon.c 10 Nov 2004 16:07:07 -0000 1.144
+++ engine/dragon.c 7 Feb 2005 04:34:49 -0000
@@ -572,8 +572,6 @@
DEBUG(DEBUG_EYES, "Black eyespace at %1m: %s\n", str,
eyevalue_to_string(&value));
black_eye[str].value = value;
- black_eye[str].attack_point = attack_point;
- black_eye[str].defense_point = defense_point;
propagate_eye(str, black_eye);
}
@@ -587,8 +585,6 @@
DEBUG(DEBUG_EYES, "White eyespace at %1m: %s\n", str,
eyevalue_to_string(&value));
white_eye[str].value = value;
- white_eye[str].attack_point = attack_point;
- white_eye[str].defense_point = defense_point;
propagate_eye(str, white_eye);
}
}
@@ -1311,7 +1307,7 @@
if (eye_to_exclude == NO_MOVE
&& (eye_move_urgency(&black_eye[pos].value)
> eye_move_urgency(genus)))
- DRAGON2(d).heye = black_eye[pos].defense_point;
+ DRAGON2(d).heye = black_vital_points[pos].defense_points[0];
add_eyevalues(genus, &black_eye[pos].value, genus);
}
@@ -1334,7 +1330,7 @@
if (eye_to_exclude == NO_MOVE
&& (eye_move_urgency(&white_eye[pos].value)
> eye_move_urgency(genus)))
- DRAGON2(d).heye = white_eye[pos].defense_point;
+ DRAGON2(d).heye = white_vital_points[pos].defense_points[0];
add_eyevalues(genus, &white_eye[pos].value, genus);
}
Index: engine/liberty.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/liberty.h,v
retrieving revision 1.235
diff -u -r1.235 liberty.h
--- engine/liberty.h 6 Jan 2005 19:50:27 -0000 1.235
+++ engine/liberty.h 7 Feb 2005 04:34:50 -0000
@@ -980,22 +980,19 @@
#define MAX_EYE_ATTACKS 3
struct eye_data {
- int color;/* BLACK, WHITE, BLACK_BORDERED, WHITE_BORDERED or GRAY_BORDERED */
- int esize; /* size of the eyespace */
- int msize; /* number of marginal vertices */
- int origin; /* The origin */
- struct eyevalue value; /* Number of eyes. */
- int attack_point; /* vital point for attack */
- int defense_point; /* vital point for defense */
+ int color; /* BLACK, WHITE, or GRAY */
+ int esize; /* size of the eyespace */
+ int msize; /* number of marginal vertices */
+ int origin; /* The origin */
+ struct eyevalue value; /* Number of eyes. */
- /* The above fields are constant on the whole eyespace. */
+ /* The above fields are constant on the whole eyespace. */
/* ---------------------------------------------------------------- */
- /* The below fields are not. */
+ /* The below fields are not. */
- char marginal; /* This vertex is marginal */
- char type; /* Various characteristics of the eyespace */
- char neighbors; /* number of neighbors in eyespace */
- char marginal_neighbors; /* number of marginal neighbors */
+ char marginal; /* This vertex is marginal */
+ char neighbors; /* number of neighbors in eyespace */
+ char marginal_neighbors; /* number of marginal neighbors */
};
struct vital_eye_points {
@@ -1032,11 +1029,6 @@
void propagate_eye(int pos, struct eye_data eye[BOARDMAX]);
int find_eye_dragons(int origin, struct eye_data eye[BOARDMAX], int eye_color,
int dragons[], int max_dragons);
-float topological_eye(int pos, int color,
- struct eye_data my_eye[BOARDMAX],
- struct half_eye_data heye[BOARDMAX]);
-void add_false_eye(int pos, struct eye_data eye[BOARDMAX],
- struct half_eye_data heye[BOARDMAX]);
void make_domains(struct eye_data b_eye[BOARDMAX],
struct eye_data w_eye[BOARDMAX],
int owl_call);
Index: engine/optics.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/optics.c,v
retrieving revision 1.98
diff -u -r1.98 optics.c
--- engine/optics.c 6 Feb 2005 18:42:23 -0000 1.98
+++ engine/optics.c 7 Feb 2005 04:34:50 -0000
@@ -72,10 +72,15 @@
static int next_map(int *q, int map[MAXEYE]);
static void print_eye(struct eye_data eye[BOARDMAX],
struct half_eye_data heye[BOARDMAX], int pos);
-static float
-evaluate_diagonal_intersection(int m, int n, int color,
- int *attack_point, int *defense_point,
- struct eye_data my_eye[BOARDMAX]);
+static void add_false_eye(int pos, struct eye_data eye[BOARDMAX],
+ struct half_eye_data heye[BOARDMAX]);
+static float topological_eye(int pos, int color,
+ struct eye_data my_eye[BOARDMAX],
+ struct half_eye_data heye[BOARDMAX]);
+static float evaluate_diagonal_intersection(int m, int n, int color,
+ int *attack_point,
+ int *defense_point,
+ struct eye_data my_eye[BOARDMAX]);
/* These are used during the calculations of eye spaces. */
@@ -99,10 +104,7 @@
eye->msize = 0;
eye->origin = NO_MOVE;
set_eyevalue(&eye->value, 0, 0, 0, 0);
- eye->attack_point = NO_MOVE;
- eye->defense_point = NO_MOVE;
eye->marginal = 0;
- eye->type = 0;
eye->neighbors = 0;
eye->marginal_neighbors = 0;
}
@@ -588,8 +590,6 @@
eye[pos].msize = eye[origin].msize;
eye[pos].origin = eye[origin].origin;
eye[pos].value = eye[origin].value;
- eye[pos].attack_point = eye[origin].attack_point;
- eye[pos].defense_point = eye[origin].defense_point;
}
}
@@ -1614,7 +1614,7 @@
/* add_false_eye() turns a proper eyespace into a margin. */
-void
+static void
add_false_eye(int pos, struct eye_data eye[BOARDMAX],
struct half_eye_data heye[BOARDMAX])
{
@@ -1749,7 +1749,7 @@
* my_eye is the eye space information with respect to (color).
*/
-float
+static float
topological_eye(int pos, int color,
struct eye_data my_eye[BOARDMAX],
struct half_eye_data heye[BOARDMAX])
Index: engine/value_moves.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/value_moves.c,v
retrieving revision 1.144
diff -u -r1.144 value_moves.c
--- engine/value_moves.c 19 Jan 2005 04:03:40 -0000 1.144
+++ engine/value_moves.c 7 Feb 2005 04:34:51 -0000
@@ -612,7 +612,7 @@
if (!ON_BOARD(pos))
continue;
if (our_eyes[pos].origin == pos
- && our_eyes[pos].defense_point != NO_MOVE) {
+ && our_vital_points[pos].defense_points[0] != NO_MOVE) {
int k, dr;
find_eye_dragons(pos, our_eyes, color, &dr, 1);
for (k = 0; k < MAX_EYE_ATTACKS; k++) {
@@ -624,7 +624,7 @@
}
}
if (your_eyes[pos].origin == pos
- && your_eyes[pos].attack_point != NO_MOVE) {
+ && your_vital_points[pos].attack_points[0] != NO_MOVE) {
int k, dr;
find_eye_dragons(pos, your_eyes, OTHER_COLOR(color), &dr, 1);
for (k = 0; k < MAX_EYE_ATTACKS; k++) {
Index: interface/play_gtp.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_gtp.c,v
retrieving revision 1.164
diff -u -r1.164 play_gtp.c
--- interface/play_gtp.c 29 Jan 2005 14:29:16 -0000 1.164
+++ interface/play_gtp.c 7 Feb 2005 04:34:52 -0000
@@ -4204,12 +4204,7 @@
gtp_printf("esize %d\n", e->esize);
gtp_printf("msize %d\n", e->msize);
gtp_printf("value %s\n", eyevalue_to_string(&e->value));
- gtp_mprintf("attack_point %m\n",
- I(e->attack_point), J(e->attack_point));
- gtp_mprintf("defense_point %m\n",
- I(e->defense_point), J(e->defense_point));
gtp_printf("marginal %d\n", e->marginal);
- gtp_printf("type %d\n", e->type);
gtp_printf("neighbors %d\n", e->neighbors);
gtp_printf("marginal_neighbors %d\n", e->marginal_neighbors);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnugo-devel] fields removed from struct eye_data,
Gunnar Farnebäck <=