Worked instance: scaling a vector with an increment
Library · Source module
Worked instance: scaling a vector with an increment
The routine NLAlib.Ops.Examples.Strided.scalStrided, which scales in place the cells of a vector laid out one every inc cells, run on exact integer words: the factor 5 and the vector (1, 2, 3) in cells 0, 2 and 4 of a buffer of five. It exercises the address arithmetic of an operand with an increment: the cells between the entries must be left alone.
The run is evaluated, not derived from the judgment of the routine: the whole final memory is computed by the evaluator and transferred to the execution rules (NLAlib.Ops.Reference.execution_iff_exec).
Expected, from scripts/worked_instances.py (Strided): the buffer [5, 100, 10, 200, 15] and 3 multiplications. The total of 59 instructions and the formula 16 n + 11 are regression values.
Main results
* NLAlib.Ops.Examples.WorkedInstances.Strided.calls, NLAlib.Ops.Examples.WorkedInstances.Strided.work, NLAlib.Ops.Examples.WorkedInstances.Strided.peak: the calls, the instructions and the scratch of the tree at every length and increment. * NLAlib.Ops.Examples.WorkedInstances.Strided.instance_run: the run on the instance.
Declarations
- NLAlib.Ops.Examples.WorkedInstances.Strided.calls
- NLAlib.Ops.Examples.WorkedInstances.Strided.coreWork_eq
- NLAlib.Ops.Examples.WorkedInstances.Strided.initial
- NLAlib.Ops.Examples.WorkedInstances.Strided.instance_run
- NLAlib.Ops.Examples.WorkedInstances.Strided.interp
- NLAlib.Ops.Examples.WorkedInstances.Strided.machine
- NLAlib.Ops.Examples.WorkedInstances.Strided.operationWork_eq
- NLAlib.Ops.Examples.WorkedInstances.Strided.peak
- NLAlib.Ops.Examples.WorkedInstances.Strided.program
- NLAlib.Ops.Examples.WorkedInstances.Strided.program_straight
- NLAlib.Ops.Examples.WorkedInstances.Strided.resources
- NLAlib.Ops.Examples.WorkedInstances.Strided.work