3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-16 13:58:45 +00:00
z3/src/util/luby.h
Nikolaj Bjorner d0e20e44ff booyah
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-04 15:56:30 -07:00

30 lines
456 B
C

/*++
Copyright (c) 2006 Microsoft Corporation
Module Name:
luby.h
Abstract:
<abstract>
Author:
Leonardo de Moura (leonardo) 2008-03-04.
Revision History:
--*/
#pragma once
/**
\brief Return the i-th element of the Luby sequence: 1,1,2,1,1,2,4,1,1,2,1,1,2,4,8,...
get_luby(i) = 2^{i-1} if i = 2^k -1
get_luby(i) = get_luby(i - 2^{k-1} + 1) if 2^{k-1} <= i < 2^k - 1
*/
unsigned get_luby(unsigned i);