mirror of
https://github.com/Z3Prover/z3
synced 2025-07-19 10:52:02 +00:00
Reorganizing the code
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
8a6997960a
commit
c66b9ab615
39 changed files with 1 additions and 1 deletions
33
lib/luby.cpp
33
lib/luby.cpp
|
@ -1,33 +0,0 @@
|
|||
/*++
|
||||
Copyright (c) 2006 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
luby.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
<abstract>
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2008-03-04.
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#include<cmath>
|
||||
|
||||
unsigned get_luby(unsigned i) {
|
||||
if (i == 1)
|
||||
return 1;
|
||||
double k = log(static_cast<double>(i+1))/log(static_cast<double>(2));
|
||||
|
||||
if (k == floor(k + 0.5))
|
||||
return static_cast<unsigned>(pow(2,k-1));
|
||||
else {
|
||||
k = static_cast<unsigned>(floor(k));
|
||||
return get_luby(i - static_cast<unsigned>(pow(2, k)) + 1);
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue