Often when performing operations across multiple tables you face the situation where the tables have different dimensions. The functions in this section allow you to tell Planarly how to handle these situations by applying properties to the tables in a formula. These table properties are used to:

Unifying table dimensions

Many operators and functions require their arguments to have the same dimensions, e.g. +

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/da2fcaf8-1f42-4971-b972-d9b854fa8728/Screenshot_2021-06-07_at_16.10.14.png

Three functions, Tile, Inflate, and Extend, are provided so that a table's dimensions become modifiable, shrinking or expanding as required by the context. Below is an example where Tile() is used to expand the smaller #a table to match the dimensions of #b, and then Tile() is used to constrain the dimensions of #b to the smaller dimensions of #a.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/e53a54ab-fe0d-42a0-8579-5a85e58a23fd/Screenshot_2021-06-07_at_16.11.41.png

<aside> 💡 One special exemption: constants are treated as if wrapped in a call to Tile():

</aside>

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/60fdd503-3938-4393-b94b-322fb10b0b71/Screenshot_2021-06-07_at_16.16.15.png

But computed results are not treated in this way as they are represented as 1x1 tables.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5913555b-00db-44d0-a2c5-35564854f3c6/Screenshot_2021-06-07_at_16.27.02.png

Tile(a)

Expands a to the required dimension by tiling, i.e. repeating. E.g. Ones(3,3) + 1 & 2 is an error, but Ones(3,3) + Tile(1 & 2) evaluates to 2 & 3 & 2 \\\\ 2 & 3 & 2 \\\\ 2 & 3 & 2.

$$ \begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \end{bmatrix} + \textrm{Tile}( \begin{bmatrix} 1 & 2 \end{bmatrix}) = \begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \end{bmatrix} + \begin{bmatrix} 1 & 2 & 1 \\ 1 & 2 & 1 \\ 1 & 2 & 1 \end{bmatrix} = \begin{bmatrix} 2 & 3 & 2 \\ 2 & 3 & 2 \\ 2 & 3 & 2 \end{bmatrix} $$

Extend(a)

Extend the input to the required dimension by repeating the bottom row and right-most column. E.g.Ones(3,3) + Extend(1 & 2) evaluates to 2 & 3 & 3 \\\\ 2 & 3 & 3 \\\\ 2 & 3 & 3.

$$ \begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \end{bmatrix} + \textrm{Extend}( \begin{bmatrix} 1 & 2 \end{bmatrix}) = \begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \end{bmatrix} + \begin{bmatrix} 1 & 2 & 2 \\ 1 & 2 & 2 \\ 1 & 2 & 2 \end{bmatrix} = \begin{bmatrix} 2 & 3 & 3 \\ 2 & 3 & 3 \\ 2 & 3 & 3 \end{bmatrix} $$

Inflate(a)

Expand the input to the required dimension by padding with Blank. E.g. Ones(3,3) + Inflate(1 & 2) evaluates to 2 & 3 & 1 \\\\ 1 & 1 & 1 \\\\ 1 & 1 & 1.