Scid
4.7.0
Main Page
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Variables
Typedefs
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
y
~
+
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
~
+
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
w
y
Typedefs
Enumerations
Enumerator
Related Functions
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
w
y
z
+
Typedefs
b
c
d
e
f
g
i
l
m
n
p
r
s
u
v
Enumerations
+
Enumerator
c
e
f
g
n
p
s
t
+
Macros
a
b
d
e
g
h
l
m
p
s
t
u
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
src
recog.h
Go to the documentation of this file.
1
//////////////////////////////////////////////////////////////////////
2
//
3
// FILE: recog.h
4
// Endgame knowledge recognition class
5
//
6
// Part of: Scid (Shane's Chess Information Database)
7
// Version: 3.4
8
//
9
// Notice: Copyright (c) 2002 Shane Hudson. All rights reserved.
10
//
11
// Author: Shane Hudson (sgh@users.sourceforge.net)
12
//
13
//////////////////////////////////////////////////////////////////////
14
15
#include "
engine.h
"
16
#include "
position.h
"
17
18
// Recognition value conversion: a recognition score contains a
19
// regular score shifted left 4 bits to make room for a score flag.
20
21
inline
int
recogValue
(
scoreFlagT
flag,
int
score) {
22
return
((score * 16) | flag);
23
}
24
inline
int
recogScore
(
int
value) {
return
value / 16; }
25
inline
scoreFlagT
recogFlag
(
int
value) {
return
value & 15; }
26
27
// The Recognizer class provides score bound information for chess endgames.
28
namespace
Recognizer
{
29
30
constexpr
uint
MaxPieces
() {
31
// Only positions with a total of 6 or fewer pieces (including kings
32
// and pawns) are potentially recognizable.
33
return
6;
34
}
35
int
Recognize
(
Position
* pos);
36
37
}
// namespace Recognizer
38
39
//////////////////////////////////////////////////////////////////////
40
// EOF: recog.h
41
//////////////////////////////////////////////////////////////////////
engine.h
Recognizer::Recognize
int Recognize(Position *pos)
Definition:
recog.cpp:45
Recognizer::MaxPieces
constexpr uint MaxPieces()
Definition:
recog.h:30
recogFlag
scoreFlagT recogFlag(int value)
Definition:
recog.h:25
Recognizer
Definition:
recog.cpp:21
uint
uint32_t uint
Definition:
common.h:91
Position
Definition:
position.h:74
scoreFlagT
byte scoreFlagT
Definition:
engine.h:49
position.h
recogScore
int recogScore(int value)
Definition:
recog.h:24
recogValue
int recogValue(scoreFlagT flag, int score)
Definition:
recog.h:21
Generated by
1.8.13