module numbers.weighted_number

Short summary

module cpyquickhelper.numbers.weighted_number

Implements operations on weighted numbers.

source on GitHub

Classes

class

truncated documentation

WeightedDouble

Implements a weighted double used to speed up computation with aggregation. It contains two attributes:

WeightedFloat

Implements a weighted float used to speed up computation with aggregation. It contains two attributes:

Properties

property

truncated documentation

value

unweighted numeric value (counter)

value

unweighted numeric value (counter)

weight

weight

weight

weight

Documentation

Implements operations on weighted numbers.

class cpyquickhelper.numbers.weighted_number.WeightedDouble(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, value: float, weight: float = 1.0) → None

Bases: pybind11_builtins.pybind11_object

Implements a weighted double used to speed up computation with aggregation. It contains two attributes:

  • value: unweighted value

  • weight: weight associated to the value, it should be positive, but that’s not enforced

__add__(*args, **kwargs)

Overloaded function.

  1. __add__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: cpyquickhelper.numbers.weighted_number.WeightedDouble) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

operator +

  1. __add__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

__eq__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: cpyquickhelper.numbers.weighted_number.WeightedDouble) → bool
__ge__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: cpyquickhelper.numbers.weighted_number.WeightedDouble) → bool
__gt__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: cpyquickhelper.numbers.weighted_number.WeightedDouble) → bool
__iadd__(*args, **kwargs)

Overloaded function.

  1. __iadd__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: cpyquickhelper.numbers.weighted_number.WeightedDouble) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

  2. __iadd__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

__imul__(*args, **kwargs)

Overloaded function.

  1. __imul__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: cpyquickhelper.numbers.weighted_number.WeightedDouble) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

  2. __imul__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

__init__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, value: float, weight: float = 1.0) → None
__isub__(*args, **kwargs)

Overloaded function.

  1. __isub__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: cpyquickhelper.numbers.weighted_number.WeightedDouble) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

  2. __isub__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

__itruediv__(*args, **kwargs)

Overloaded function.

  1. __itruediv__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: cpyquickhelper.numbers.weighted_number.WeightedDouble) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

  2. __itruediv__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

__le__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: cpyquickhelper.numbers.weighted_number.WeightedDouble) → bool
__lt__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: cpyquickhelper.numbers.weighted_number.WeightedDouble) → bool
__mul__(*args, **kwargs)

Overloaded function.

  1. __mul__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: cpyquickhelper.numbers.weighted_number.WeightedDouble) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

operator *

  1. __mul__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

__repr__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble) → str

usual

__str__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble) → str

usual

__sub__(*args, **kwargs)

Overloaded function.

  1. __sub__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: cpyquickhelper.numbers.weighted_number.WeightedDouble) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

operator -

  1. __sub__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

__truediv__(*args, **kwargs)

Overloaded function.

  1. __truediv__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: cpyquickhelper.numbers.weighted_number.WeightedDouble) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

operator /

  1. __truediv__(self: cpyquickhelper.numbers.weighted_number.WeightedDouble, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedDouble

property value

unweighted numeric value (counter)

property weight
class cpyquickhelper.numbers.weighted_number.WeightedFloat(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, value: float, weight: float = 1.0) → None

Bases: pybind11_builtins.pybind11_object

Implements a weighted float used to speed up computation with aggregation. It contains two attributes:

  • value: unweighted value

  • weight: weight associated to the value, it should be positive, but that’s not enforced

__add__(*args, **kwargs)

Overloaded function.

  1. __add__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: cpyquickhelper.numbers.weighted_number.WeightedFloat) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

operator +

  1. __add__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

__eq__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: cpyquickhelper.numbers.weighted_number.WeightedFloat) → bool
__ge__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: cpyquickhelper.numbers.weighted_number.WeightedFloat) → bool
__gt__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: cpyquickhelper.numbers.weighted_number.WeightedFloat) → bool
__iadd__(*args, **kwargs)

Overloaded function.

  1. __iadd__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: cpyquickhelper.numbers.weighted_number.WeightedFloat) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

  2. __iadd__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

__imul__(*args, **kwargs)

Overloaded function.

  1. __imul__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: cpyquickhelper.numbers.weighted_number.WeightedFloat) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

  2. __imul__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

__init__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, value: float, weight: float = 1.0) → None
__isub__(*args, **kwargs)

Overloaded function.

  1. __isub__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: cpyquickhelper.numbers.weighted_number.WeightedFloat) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

  2. __isub__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

__itruediv__(*args, **kwargs)

Overloaded function.

  1. __itruediv__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: cpyquickhelper.numbers.weighted_number.WeightedFloat) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

  2. __itruediv__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

__le__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: cpyquickhelper.numbers.weighted_number.WeightedFloat) → bool
__lt__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: cpyquickhelper.numbers.weighted_number.WeightedFloat) → bool
__mul__(*args, **kwargs)

Overloaded function.

  1. __mul__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: cpyquickhelper.numbers.weighted_number.WeightedFloat) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

operator *

  1. __mul__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

__repr__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat) → str

usual

__str__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat) → str

usual

__sub__(*args, **kwargs)

Overloaded function.

  1. __sub__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: cpyquickhelper.numbers.weighted_number.WeightedFloat) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

operator -

  1. __sub__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

__truediv__(*args, **kwargs)

Overloaded function.

  1. __truediv__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: cpyquickhelper.numbers.weighted_number.WeightedFloat) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

operator /

  1. __truediv__(self: cpyquickhelper.numbers.weighted_number.WeightedFloat, arg0: float) -> cpyquickhelper.numbers.weighted_number.WeightedFloat

property value

unweighted numeric value (counter)

property weight