Mesh

In Iverson notation, Mesh ($$\backslash{}a,u,b\backslash$$) is a three-argument operation which merges two equal-rank arguments according to a Boolean vector. The relationship between Mask and Mesh is similar to that between Compress and Expand. A related function also named Mesh is implemented in NARS2000 as a case of Compose:  combines   and   using an integer (not Boolean) control vector. In other modern APLs, the equivalent is  with index origin 0.

In Iverson notation
Mesh in Iverson notation combines or interleaves two arguments according to a Boolean control. The result has the same shape as the control array, and contains entries taken from the left argument when the control is 0 and from the right when it is 1.

A Programming Language defines the Mesh $$\backslash{}a,u,b\backslash$$ for vectors $$a$$ and $$b$$ and Boolean vector $$u$$, where $$+/\overline{u}=\nu(a)$$, and $$+/u=\nu(b)$$, to be the vector $$c$$ whose compressions by $$u$$ and its negation yield the other arguments: $$\overline{u}/c=a$$ and $$u/c=b$$. Conformability requirements give $$\nu(c)=\nu(u)$$; because $$\nu(u)=(+/\overline{u})+(+/u)$$ we have $$\nu(c)=\nu(a)+\nu(b)$$.

Mesh $$\backslash{}a,u,b\backslash$$ is a generalization of Catenate $$a\oplus b$$, since meshing with a suffix vector $$\backslash{}a,\omega^{\nu(b)},b\backslash$$ produces $$a\oplus b$$.

Iverson notes the following relationships between Mask, Mesh, Compress, and Expand: $$ \begin{align} /a,u,b/ &= \backslash{}\overline{u}/a,u,u/b\backslash \\ \backslash{}a,u,b\backslash &= /\overline{u}\backslash{}a,u,u\backslash{}b/ \end{align} $$

The following forms of Mesh with matrices are defined. Below, matrices are denoted with capital letters while vectors use lowercase letters.

Documentation

 * NARS2000