mathtools

Tools for math.

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph "cluster_abjad.mathtools" { graph [label="abjad.mathtools"]; node [color=1]; "abjad.mathtools.Infinity.Infinity" [URL="../api/abjad/mathtools/Infinity.html#abjad.mathtools.Infinity.Infinity", color=black, fontcolor=white, label=Infinity, target=_top]; "abjad.mathtools.NegativeInfinity.NegativeInfinity" [URL="../api/abjad/mathtools/NegativeInfinity.html#abjad.mathtools.NegativeInfinity.NegativeInfinity", color=black, fontcolor=white, label="Negative\nInfinity", target=_top]; "abjad.mathtools.NonreducedFraction.NonreducedFraction" [URL="../api/abjad/mathtools/NonreducedFraction.html#abjad.mathtools.NonreducedFraction.NonreducedFraction", color=black, fontcolor=white, label="Nonreduced\nFraction", target=_top]; "abjad.mathtools.NonreducedRatio.NonreducedRatio" [URL="../api/abjad/mathtools/NonreducedRatio.html#abjad.mathtools.NonreducedRatio.NonreducedRatio", color=black, fontcolor=white, label="Nonreduced\nRatio", target=_top]; "abjad.mathtools.Ratio.Ratio" [URL="../api/abjad/mathtools/Ratio.html#abjad.mathtools.Ratio.Ratio", color=black, fontcolor=white, label=Ratio, target=_top]; "abjad.mathtools.Infinity.Infinity" -> "abjad.mathtools.NegativeInfinity.NegativeInfinity"; "abjad.mathtools.NonreducedRatio.NonreducedRatio" -> "abjad.mathtools.Ratio.Ratio"; } subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=2]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/mathtools/../system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; "abjad.system.AbjadValueObject.AbjadValueObject" [URL="../api/abjad/mathtools/../system/AbjadValueObject.html#abjad.system.AbjadValueObject.AbjadValueObject", label="Abjad\nValue\nObject", target=_top]; "abjad.system.AbjadObject.AbjadObject" -> "abjad.system.AbjadValueObject.AbjadValueObject"; } subgraph cluster_builtins { graph [label=builtins]; node [color=3]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } subgraph "cluster_collections.abc" { graph [label="collections.abc"]; node [color=4]; "collections.abc.Collection" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Collection", label=Collection, shape=oval, style=bold, target=_top]; "collections.abc.Container" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Container", label=Container, shape=oval, style=bold, target=_top]; "collections.abc.Iterable" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Iterable", label=Iterable, shape=oval, style=bold, target=_top]; "collections.abc.Reversible" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Reversible", label=Reversible, shape=oval, style=bold, target=_top]; "collections.abc.Sequence" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Sequence", label=Sequence, shape=oval, style=bold, target=_top]; "collections.abc.Sized" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Sized", label=Sized, shape=oval, style=bold, target=_top]; "collections.abc.Collection" -> "collections.abc.Sequence"; "collections.abc.Container" -> "collections.abc.Collection"; "collections.abc.Iterable" -> "collections.abc.Collection"; "collections.abc.Iterable" -> "collections.abc.Reversible"; "collections.abc.Reversible" -> "collections.abc.Sequence"; "collections.abc.Sized" -> "collections.abc.Collection"; } subgraph cluster_fractions { graph [label=fractions]; node [color=5]; "fractions.Fraction" [URL="https://docs.python.org/3.6/library/fractions.html#fractions.Fraction", label=Fraction, target=_top]; } subgraph cluster_numbers { graph [label=numbers]; node [color=6]; "numbers.Complex" [URL="https://docs.python.org/3.6/library/numbers.html#numbers.Complex", label=Complex, shape=oval, style=bold, target=_top]; "numbers.Number" [URL="https://docs.python.org/3.6/library/numbers.html#numbers.Number", label=Number, target=_top]; "numbers.Rational" [URL="https://docs.python.org/3.6/library/numbers.html#numbers.Rational", label=Rational, shape=oval, style=bold, target=_top]; "numbers.Real" [URL="https://docs.python.org/3.6/library/numbers.html#numbers.Real", label=Real, shape=oval, style=bold, target=_top]; "numbers.Complex" -> "numbers.Real"; "numbers.Number" -> "numbers.Complex"; "numbers.Real" -> "numbers.Rational"; } "abjad.system.AbjadObject.AbjadObject" -> "abjad.mathtools.NonreducedFraction.NonreducedFraction"; "abjad.system.AbjadValueObject.AbjadValueObject" -> "abjad.mathtools.Infinity.Infinity"; "abjad.system.AbjadValueObject.AbjadValueObject" -> "abjad.mathtools.NonreducedRatio.NonreducedRatio"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; "builtins.object" -> "collections.abc.Container"; "builtins.object" -> "collections.abc.Iterable"; "builtins.object" -> "collections.abc.Sized"; "builtins.object" -> "numbers.Number"; "collections.abc.Sequence" -> "abjad.mathtools.NonreducedRatio.NonreducedRatio"; "fractions.Fraction" -> "abjad.mathtools.NonreducedFraction.NonreducedFraction"; "numbers.Rational" -> "fractions.Fraction"; }


Classes

Infinity Infinity.
NegativeInfinity Negative infinity.
NonreducedFraction Nonreduced fraction.
NonreducedRatio Nonreduced ratio.
Ratio Ratio.

Functions

all_are_equal Is true when argument is an iterable collection of equal items.
all_are_integer_equivalent Is true when argument is an iterable collection with integer-equivalent items.
all_are_integer_equivalent_numbers Is true when argument is an iterable collection with integer-equivalent items.
all_are_nonnegative_integer_equivalent_numbers Is true when argument is an iterable collection of nonnegative integer-equivalent numbers.
all_are_nonnegative_integer_powers_of_two Is true when argument is an iterable collection of nonnegative integer powers of two.
all_are_nonnegative_integers Is true when argument is an iterable collection of nonnegative integers.
all_are_pairs_of_types Is true when argument is an iterable collection whose members are all of length 2, and where the first member of each pair is an instance of first_type and where the second member of each pair is an instance of second_type.
all_are_positive_integers Is true when argument is an iterable collection of positive integers.
are_relatively_prime Is true when argument is an iterable collection of relative primes.
arithmetic_mean Gets arithmetic mean of argument.
binomial_coefficient Gets binomial coefficient of n choose k.
cumulative_products Gets cumulative products of argument.
cumulative_sums Gets cumulative sums of argument.
cumulative_sums_pairwise Gets pairwise cumulative sums of argument from zero.
difference_series Gets difference series of argument.
divisors Gets positive divisors of n in increasing order.
factors Gets prime factors less than or equal to n .
fraction_to_proper_fraction Changes rational to proper fraction.
greatest_common_divisor Calculates greatest common divisor of integers.
greatest_power_of_two_less_equal Gets greatest integer power of two less than or equal to positive n.
integer_equivalent_number_to_integer Changes integer-equivalent number to integer.
integer_to_base_k_tuple Changes nonnegative integer n to base-k tuple.
integer_to_binary_string Changes positive integer n to binary string.
is_assignable_integer Is true when argument is equivalent to an integer that can be written without recourse to ties.
is_integer_equivalent Is true when argument is an integer-equivalent number.
is_integer_equivalent_n_tuple Is true when argument is a tuple of n integer-equivalent items.
is_integer_equivalent_number Is true when argument is a number and argument is equivalent to an integer.
is_nonnegative_integer Is true when argument equals a nonnegative integer.
is_nonnegative_integer_equivalent_number Is true when argument is a nonnegative integer-equivalent number.
is_nonnegative_integer_power_of_two Is true when argument is a nonnegative integer power of 2.
is_positive_integer Is true when argument equals a positive integer.
is_positive_integer_equivalent_number Is true when argument is a positive integer-equivalent number.
is_positive_integer_power_of_two Is true when argument is a positive integer power of 2.
least_common_multiple Gets least common multiple of positive integers.
partition_integer_by_ratio Partitions positive integer-equivalent n by ratio.
partition_integer_into_canonic_parts Partitions integer n into canonic parts.
sign Gets sign of n.
weight Gets weight of argument.
yield_all_compositions_of_integer Yields all compositions of positive integer n.