Move all enum types definitions to types.h Cleanup headers while there. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Clarify we want Score and Value to be integers No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Minimal restructuring of value.h Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Use simple macro to enable operators Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Change evaluate() signature Hide EvalInfo and return just the score and the margin. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Move piece values in piece.h / piece.cpp Where they belong. Note that array PieceValueMidgame[] and PieceValueEndgame[] are now declared extern in the header and moved in piece.cpp so to avoid allocate the array each time the header is included ! No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Retire is_upper_bound() and friend Directly expand in the few places where is called. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Retire useless piece_value_midgame() overloads Directly access the table in the few call places. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Introduce and use SCORE_ZERO No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Disable templetized operators by default To avoid nasty bugs due to silently overriding of common operator we enable the templates on a type by type base using partial template specialization. No functional change, zero overhead at runtime. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Introduce enum VALUE_ZERO instead of Value(0) No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Use Use templetized operations for Score and Value Note that in value we leave two specialized functions to allow adding an integer, we don't want to add this as a template becasue we want to control implicit conversions to integer of an enum. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Retire apply_scale_factor() and scale.h Directly inline in the only occurence. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Retire value.cpp No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Always save static value and kingDanger to TT Around 5% speed-up No functional change Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Revert saving of null search value in TT Revert all the patches that introduced the change and more or less fixed the zugzwang issue. There is a gain against last current version and we can remove a lot of code. After 979 games at 1+0 on my QUAD Mod vs Orig +152 =688 -139 +5 ELO Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Fix some warnings under +w1 HP-UX compile This is the world's fussiest compiler with +w1 Warnings reported by Richard Lloyd. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Use a flag in TT to track null search values Add VALUE_TYPE_NS_LO to enum ValueType and use it when saving in TT a value from a null search. Currently no action is performed, the next patch will enable the new type. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Updated copyright year to 2010 Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Fix enum Value issue with gcc 4.4 Louis Zulli reports a miscompile with g++-4.4 from MacPorts. Namely enum Value is compiled as unsigned instead of signed integer and this yields an issue in score_string() where float(v) is incorrectly casted when Value v is negative. This patch ensure that compiler choses a signed variable to store a Value. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>