functionaddIndex
add to an index in a cyclic way
Extends from Modelica.Icons.Function (Icon for functions).
Information
result:= k + a;and bring the result to the range [1, m] in a cyclic way, i.e. m + 1 -> 1 and 0 -> m. The addend can also be negative.
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | k | Index | |
| Integer | a | Addend | |
| Integer | m | Max. index |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | result | 1 + mod(k + a - 1, m) | Resulting index |