pv.h (empty)
This commit is contained in:
@@ -29,6 +29,9 @@ readarray -t orig_b < <(git for-each-ref --format='%(refname:short)' \
|
||||
# bugs:
|
||||
# - We only check local branch existence, not tracking information correctness.
|
||||
# - What about sub-branches ? Like remote/a and remote/a/b not being tracked ?
|
||||
#for i in `git branch -a | grep remote | grep -v HEAD | grep -v master`; do
|
||||
# git branch --track ${i#remotes/origin/} $i
|
||||
#done
|
||||
for remote_b in "${orig_b[@]}"; do
|
||||
short=${remote_b#"$origin"/};
|
||||
# OR (??): short=${remote_b##*/}
|
||||
|
@@ -266,10 +266,8 @@ hentry_t *tt_probe(hkey_t key)
|
||||
for (i = 0; i < ENTRIES_PER_BUCKET; ++i) {
|
||||
entry = bucket->entry + i;
|
||||
if (key == entry->key)
|
||||
break;
|
||||
return entry;
|
||||
}
|
||||
if (i < ENTRIES_PER_BUCKET)
|
||||
return entry;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
53
src/pv.h
Normal file
53
src/pv.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/* pv.c - Principal variation.
|
||||
*
|
||||
* Copyright (C) 2024 Bruno Raoult ("br")
|
||||
* Licensed under the GNU General Public License v3.0 or later.
|
||||
* Some rights reserved. See COPYING.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with this
|
||||
* program. If not, see <https://www.gnu.org/licenses/gpl-3.0-standalone.html>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later <https://spdx.org/licenses/GPL-3.0-or-later.html>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <brlib.h>
|
||||
|
||||
#include "move.h"
|
||||
|
||||
/*
|
||||
* For PV, we use a triangular structure. The following table is adapted from
|
||||
* https://www.chessprogramming.org/Triangular_PV-Table.
|
||||
*
|
||||
* ply Search maxLengthPV
|
||||
* Depth
|
||||
* +--------------------------------------------+
|
||||
* 0=root N |N |
|
||||
* +------------------------------------------+-+
|
||||
* 1 N-1 |N-1 |
|
||||
* +----------------------------------------+-+
|
||||
* 2 N-2 |N-2 |
|
||||
* +----------------------------------------+-+
|
||||
* ... /
|
||||
* +-----+-+
|
||||
* N-3 3 |3 |
|
||||
* +---+-+
|
||||
* N-2 2 |2 |
|
||||
* +-+-+
|
||||
* N-1 1 |1|
|
||||
* +-+
|
||||
*
|
||||
* The offsets will be:
|
||||
* Depth (=size): 1 2 3 4 5 6 7 ...
|
||||
* Offset: 0 1 3 6 10 15 21 ...
|
||||
*
|
||||
* Off(n) = n * (n - 1) / 2 (direct calc)
|
||||
* Off(n + 1) = Off(n) + n (calc from previous)
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
move[];
|
||||
} foo;
|
Reference in New Issue
Block a user