Structures

+reshape

Reshape an array into an array with the same total number of elements.

Accepts

Parameters as specified in source

Produces

A $ray.

Source

++  reshape
    |=  [a=ray shape=(list @)]
    ^-  ray
    ?>  (check a)
    =/  in-cnt  (reel shape.meta.a ^mul)
    =/  out-cnt  (reel shape ^mul)
    ?>  =(in-cnt out-cnt)
    =.  shape.meta.a  shape
    a

+stack

Stack along dimension (0 row, 1 col, 2 lay, etc.).

Accepts

Parameters as specified in source

Produces

A $ray.

Source


+hstack

Horizontally stack two arrays.

Accepts

Parameters as specified in source

Produces

A $ray.

Source


+vstack

Vertically stack two arrays.

Accepts

Parameters as specified in source

Produces

A $ray.

Source


+transpose

Transpose a 2D array.

Accepts

A $ray.

Produces

A $ray.

Source

Last updated