Linear combinations #
We use this data structure while processing hypotheses.
Internal representation of a linear combination of atoms, and a constant term.
Instances For
Instances For
Check if a linear combination is an atom, i.e. the constant term is zero and there is exactly one nonzero coefficient, which is one.
Instances For
Evaluate a linear combination ⟨r, [c_1, …, c_k]⟩ at values [v_1, …, v_k] to obtain
r + (c_1 * x_1 + (c_2 * x_2 + ... (c_k * x_k + 0)))).
Instances For
The i-th coordinate function.
Instances For
Implementation of addition on LinearCombo.
Instances For
Implementation of subtraction on LinearCombo.
Instances For
Implementation of negation on LinearCombo.
Instances For
Implementation of scalar multiplication of a LinearCombo by an Int.
Instances For
Multiplication of two linear combinations. This is useful only if at least one of the linear combinations is constant, and otherwise should be considered as a junk value.