aux
index
/homes/combi/seidler/.tmp/SONC_polynomial_optimization/python/aux.py

Define constants and basic functions.

 
Modules
       
math
numpy
os
signal

 
Classes
       
builtins.Exception(builtins.BaseException)
TimeoutError
builtins.object
timeout

 
class TimeoutError(builtins.Exception)
    Basic Error class for timeouts.
 
 
Method resolution order:
TimeoutError
builtins.Exception
builtins.BaseException
builtins.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from builtins.Exception:
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__new__(*args, **kwargs) from builtins.type
Create and return a new object.  See help(type) for accurate signature.

Methods inherited from builtins.BaseException:
__delattr__(self, name, /)
Implement delattr(self, name).
__getattribute__(self, name, /)
Return getattr(self, name).
__reduce__(...)
__repr__(self, /)
Return repr(self).
__setattr__(self, name, value, /)
Implement setattr(self, name, value).
__setstate__(...)
__str__(self, /)
Return str(self).
with_traceback(...)
Exception.with_traceback(tb) --
set self.__traceback__ to tb and return self.

Data descriptors inherited from builtins.BaseException:
__cause__
exception cause
__context__
exception context
__dict__
__suppress_context__
__traceback__
args

 
class timeout(builtins.object)
    Small environment to impose a maximum time for commands.
 
  Methods defined here:
__enter__(self)
Start the timer, when entering the environment.
__exit__(self, type, value, traceback)
Stop the timer, when leaving the environment.
__init__(self, seconds=1, error_message='Timeout')
Setup the timer with the given amount of seconds.
handle_timeout(self, signum, frame)
Event that happens, if the maximal time is reached.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
binomial(n, k)
Compute binomial coefficient as integer.
dt2sec(dt)
Convert a datetime.timedelta object into seconds.
 
Call:
        res = dt2sec(dt)
Parameters:
        dt: datetime.timedelte object
Output:
        res: a float, representing the seconds of dt
is_psd(C)
Check whether matrix C is positive semidefinite, by checking the eigenvalues.
linsolve(A, b)
Solve a linear equation system for a possible singular matrix.
unify_status(status)
Give a uniform representation for different status flags.
 
The following are equivalent:
1 = Solved = optimal
0 = Inaccurate = optimal_inaccurate
-1 = no solution

 
Data
        CHECK_TIME = 10
COMPUTATION_TIME = 3600
DB_NAME = 'runs.db'
DIGITS = 6
EPSILON = 1e-06
FAULT_DATA = {'C': array([], shape=(1, 0), dtype=float64), 'opt': inf, 'solver_time': 0, 'status': 'no solution', 'time': 0, 'verify': -1}
SAVE_PATH = '/homes/combi/seidler/local/'
VERBOSE = False
binom = <ufunc 'binom'>