vmax ( u v -- w )
Factor documentation > Factor handbook > The language > Numbers > Vector operations > Vector component- and bit-wise logic
Prev:vunordered? ( u v -- w )
Next:vmin ( u v -- w )


Vocabulary
math.vectors

Inputs and outputs
ua sequence of real numbers
va sequence of real numbers
wa sequence of real numbers


Word description
Creates a sequence where each element is the maximum of the corresponding elements from u and v.

Examples
USING: math.vectors prettyprint ; { 1 2 5 } { -7 6 3 } vmax .
{ 1 6 5 }


Definition
IN: math.vectors

GENERIC: vmax ( u v -- w )


Methods
USING: generic math.vectors sequences.cords ;

M: cord vmax
[ vmax ] [ M\ cord vmax (call-next-method) ] cord-2map ;
inline


USING: kernel math.order math.vectors sequences ;

M: object vmax [ max ] 2map ; inline


USING: generic kernel math.vectors math.vectors.simd
math.vectors.simd.intrinsics math.vectors.simd.private ;

M: simd-128 vmax
dup simd-rep
[ (simd-vmax) ] [ M\ simd-128 vmax (call-next-method) ]
vv->v-op ; inline