Add files via upload
This commit is contained in:
parent
7ee026cb1c
commit
41f66199b1
34 changed files with 70577 additions and 0 deletions
16
Code/S_get_number_DL.py
Normal file
16
Code/S_get_number_DL.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# Calculates the complexity of a number to be used for the Pareto frontier
|
||||
|
||||
import numpy as np
|
||||
|
||||
def get_number_DL(n):
|
||||
epsilon = 1e-10
|
||||
# check if integer
|
||||
if np.isnan(n):
|
||||
return 1000000
|
||||
elif np.abs(n - int(n)) < epsilon:
|
||||
return np.log2(1+abs(n))
|
||||
# check if real
|
||||
else:
|
||||
PrecisionFloorLoss = 1e-14
|
||||
return np.log2(1 + (float(n) / PrecisionFloorLoss) ** 2) / 2
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue