m_n_kappa.solver.Bisection#
- class m_n_kappa.solver.Bisection(data, target, variable)#
Bases:
Solver
Bisection solver
New in version 0.1.0.
- Parameters:
data (list[dict] | list[list]) – data containing target and variable keys
target (str | int) – key of the target (e.g. str for dictionaries or int for lists)
variable (str | int) – variable of the target (e.g. str for dictionaries or int for lists)
Methods
compute
([use_fallback])Compute a new variable value that leading to a target-value nearer zero
print_values
()Attributes
passed data
maximum variable value given in
data
minimum variable value given in
data
key of the target in
data
key of the variable in
data
lastly computed variable value
new computed value
- compute(use_fallback=False)#
Compute a new variable value that leading to a target-value nearer zero
- Parameters:
use_fallback (bool) – has no effect, as bisection is the fallback-function
- Returns:
new variable-value leading to a target-value nearer zero than the values in
data
- Return type:
float
- property data: list#
passed data
- property maximum_variable: float#
maximum variable value given in
data
- property minimum_variable: float#
minimum variable value given in
data
- property target: str | int#
key of the target in
data
- property variable: str | int#
key of the variable in
data
- property x_n: float#
lastly computed variable value
- property x_n_plus_1: float#
new computed value