Next: , Previous: Sparse arrays, Up: Arrays


4.3 Size-equivalence

Two arrays are size-equivalent if the following are true:

  1. The number of dimensions match.
  2. Both are densely packed.
  3. The size of each dimension is equal.

The range of indices covered by each dimension need not be equal. Range-equivalence is a stronger relationship that requires that the respective upper and lower bounds of two arrays match.

Any array that is sparse cannot be size-equivalent to any other array, even if the set of indices contained are identical!

When we refer to instances as being type-equivalent, we also mean that they are size-equivalent. A connection between two instances is legal if and only if they are type-equivalent and size-equivalent. In Connections, we discuss connections more in-depth.