hifir4py.Params

class Params(**kw)[source]

Python interface of control parameters

By default, each control parameter object is initialized with default values in the paper. In addition, modifying the parameters can be achieved by using key-value pairs, i.e. __setitem__. The keys are the names of those defined in original C/C++ struct. A complete list of parameters can be retrieved by using keys.

Examples

>>> from hifir4py import *
>>> params = Params()  # default parameters
>>> params["verbose"] = Verbose.INFO | Verbose.FAC
>>> params.reset()  # reset to default parameters
__getitem__(param_name: str) Union[float, int][source]

Retrieve the parameter value given by its name

Parameters:param_name (str) – Parameter name
Returns:Parameter value
Return type:int or float
__init__(**kw)[source]

Create a parameter object

One can potentially pass key-value pairs to initialize a control parameter object.

Examples

The following creates a parameter with scalability-oriented dropping thresholds 3.

>>> params = Params(alpha_L=3, alpha_U=3)
__repr__() str[source]

Return repr(self).

__setitem__(param_name: str, v)[source]

Set a configuration with keyvalue pair

Parameters:
  • param_name (str) – Option name
  • v (int or float) – Corresponding value
Raises:

KeyError – Raised as per unsupported options

__str__() str[source]

Return str(self).

property alpha: float

Scalability-oriented dropping thresholds for both L and U factors

Type:float
disable_verbose() None[source]

Disable verbose

enable_verbose(flag: int) None[source]

Enable verbose level

Parameters:flag (int) – Verbose level in Verbose

See also

disable_verbose
Disable verbose
property kappa: float

Conditioning thresholds for L, D, and U factors

Type:float
reset() None[source]

This function will reset all parameters to their default values

property tau: float

Drop tolerances for both L and U factors

Type:float
to_dict() dict[source]

Convert to dictionary