(rect-union) <extent-rect> ;
: rect-containing ( points -- rect )
- [ vsupremum ] [ vinfimum ] bi
- [ nip ] [ v- ] 2bi <rect> ;
+ [ vmaximum ] [ vminimum ] bi [ nip ] [ v- ] 2bi <rect> ;
: rect-min ( rect dim -- rect' )
[ rect-bounds ] dip vmin <rect> ;
vmax
vmin
vclamp
- vsupremum
- vinfimum
+ vmaximum
+ vminimum
}
"Bitwise operations:"
{ $subsections
HELP: l-infinity-norm
{ $values { "k" sequence } { "x" "a non-negative real number" } }
-{ $contract "Computes the norm (size) of " { $snippet "k" } " in 𝑙∞ (" { $snippet "L^∞" } ") vector space, usually written ∥・∥∞. For a mathematical vector, this is simply its " { $link supremum } "." }
+{ $contract "Computes the norm (size) of " { $snippet "k" } " in 𝑙∞ (" { $snippet "L^∞" } ") vector space, usually written ∥・∥∞. For a mathematical vector, this is simply its " { $link maximum } "." }
{ $examples
{ $example
"USING: math.vectors prettyprint ;"
: vceiling ( v -- w ) [ ceiling ] map ;
: vtruncate ( v -- w ) [ truncate ] map ;
-: vsupremum ( seq -- vmax ) [ ] [ vmax ] map-reduce ; inline
-: vinfimum ( seq -- vmin ) [ ] [ vmin ] map-reduce ; inline
+: vmaximum ( seq -- vmax ) [ ] [ vmax ] map-reduce ; inline
+: vminimum ( seq -- vmin ) [ ] [ vmin ] map-reduce ; inline
+
+ALIAS: vsupremum vmaximum deprecated
+ALIAS: vinfimum vminimum deprecated
GENERIC: vdot ( u v -- x )
M: object vdot [ * ] [ + ] 2map-reduce ; inline
[ number>string ] { } map-as ", " join print ; inline
: simd-benchmark ( len -- )
- >fixnum make-points [ normalize-points ] [ vsupremum ] bi print-point ;
+ >fixnum make-points [ normalize-points ] [ vmaximum ] bi print-point ;
: simd-1-benchmark ( -- )
10 [ 500000 simd-benchmark ] times ;