(vmerge) ( u v -- h t )

Factor handbook » The language » Numbers » Vector operations » Vector shuffling, packing, and unpacking

Factor handbook » The language » Numbers » Vector operations » Vector shuffling, packing, and unpacking

Prev: | vmerge ( u v -- w ) |

Vocabulary

math.vectors

Inputs

Outputs

Word description

Creates two new sequences of the same type and size as u and v by interleaving the elements of u and v.

Notes

For hardware-supported SIMD vector types this word compiles to a single instruction per output value.

Examples

See also

vmerge, (vmerge-head), (vmerge-tail)

Definition

math.vectors

Inputs

u | a sequence |

v | a sequence |

Outputs

h | a sequence |

t | a sequence |

Word description

Creates two new sequences of the same type and size as u and v by interleaving the elements of u and v.

Notes

For hardware-supported SIMD vector types this word compiles to a single instruction per output value.

Examples

USING: kernel math.vectors prettyprint ;
{ "A" "B" "C" "D" } { "1" "2" "3" "4" } (vmerge) [ . ] bi@

{ "A" "1" "B" "2" } { "C" "3" "D" "4" }

{ "A" "1" "B" "2" } { "C" "3" "D" "4" }

See also

vmerge, (vmerge-head), (vmerge-tail)

Definition