Documentation ¶
Overview ¶
Package heuristic implements heuristic-based addition sequence algorithms with the Bos-Coster Makesequence structure.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶
type Algorithm struct {
// contains filtered or unexported fields
}
Algorithm searches for an addition sequence using a heuristic at each step. This implements the framework given in [mpnt], page 63, with the heuristic playing the role of the "newnumbers" function.
func NewAlgorithm ¶
NewAlgorithm builds a heuristic algorithm.
func (Algorithm) FindSequence ¶
FindSequence searches for an addition sequence for the given targets.
type Approximation ¶
type Approximation struct{}
Approximation is the "Approximation" heuristic from [boscoster].
func (Approximation) String ¶
func (Approximation) String() string
type DeltaLargest ¶
type DeltaLargest struct{}
DeltaLargest implements the simple heuristic of adding the delta between the largest two entries in the protosequence.
func (DeltaLargest) String ¶
func (DeltaLargest) String() string
type Heuristic ¶
type Heuristic interface { // Suggest insertions given a target and protosequence f. Protosequence must // contain sorted distinct integers. Suggest(f []*big.Int, target *big.Int) []*big.Int // String returns a name for the heuristic. String() string }
Heuristic suggests insertions given a current protosequence.