stitch ( m -- m' ) - Factor Documentation

stitch ( m -- m' )
Matrix operations



Vocabulary
math .matrices

Inputs
m a matrix


Outputs
m' a matrix


Word description
Folds an n>2-dimensional matrix onto itself.

Examples
USING: math.matrices prettyprint ; { { { 0 5 } { 6 7 } { 0 15 } { 18 21 } } { { 0 10 } { 12 14 } { 0 20 } { 24 28 } } } stitch .
{ { 0 5 0 10 } { 6 7 12 14 } { 0 15 0 20 } { 18 21 24 28 } }


Definition
USING: sequences ;

IN: math.matrices

: stitch ( m -- m' ) [ ] [ [ append ] 2map ] map-reduce ;

AltStyle によって変換されたページ (->オリジナル) /