CounterTools
Indexing
Many hadware values start at 0 (zero) while Julia's indexing is Index 1. To make this distinction clear, CounterTools implements an CounterTools.IndexZero
type. The semantics of Integers in CounterTools is thus:
- A regular
Integer
will be interpreted as Index 1.
Therefore, if your system has 8 cpus, these will be numbered 1, 2, ..., 8.
- An
IndexZero
value will be interpreted as literally starting at 0.
Therefore, reference CPU 0 could be referred to as either the Integer 1, or CounterTools.IndexZero(0)
.
CounterTools.IndexZero
— TypeIndexZero
Specify that the value contained should be interpreted as starting at zero (0).
For example,
convert(CounterTools.IndexZero, 1) == CounterTools.IndexZero(0)
CounterTools.value
— Functionvalue(x::IndexZero)
Return the Integer value of x
.