reshape ( array shape -- result )
NumPy-style shaped-array operations

Prev:>shaped-array ( array -- shaped-array )
Next:shaped-slice-view ( array selectors -- view )


Vocabulary
arrays.shaped

Inputs
arraya shaped-array, a sequence, or a number
shapea sequence or an integer


Outputs
resulta shaped-array


Word description
Returns a new shaped object in row-major order without changing the input shape. A shape integer denotes a single axis. Exactly one -1 dimension may be inferred from the number of elements; other dimensions must be nonnegative integers. Inference with a zero known product is ambiguous and rejected. An empty shape requires exactly one element. Ordinary storage is shared; virtual storage, including slice and transpose views, is copied into row-major order. Shape metadata is copied.

Examples
USING: arrays.shaped accessors prettyprint ; { 2 3 } increasing { 3 -1 } reshape shape>> .
{ 3 2 }


Definition