]> gitweb.factorcode.org Git - factor.git/commitdiff
math.vectors: rename vsupremum/vinfimum
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 23 Oct 2023 17:57:52 +0000 (10:57 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 23 Oct 2023 17:57:52 +0000 (10:57 -0700)
basis/math/rectangles/rectangles.factor
basis/math/vectors/vectors-docs.factor
basis/math/vectors/vectors.factor
extra/benchmark/simd-1/simd-1.factor

index 8e0fddeee1876657726deb0edf93766bdcef9d9d..6c658ab1a1054126c00e8b4d9fc15e0401e8cf00 100644 (file)
@@ -51,8 +51,7 @@ M: rect contains-point?
     (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> ;
index a5d1ba909dd98a214574e77d6defce9b3fd16ea4..e1f3d47050349e6a4681dc2456666db4a1d80732 100644 (file)
@@ -88,8 +88,8 @@ $nl
     vmax
     vmin
     vclamp
-    vsupremum
-    vinfimum
+    vmaximum
+    vminimum
 }
 "Bitwise operations:"
 { $subsections
@@ -512,7 +512,7 @@ HELP: norm
 
 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 ;"
index 12213627f7f716a533604308d35f609e08320b41..326cbede6704c3f0b98565448fc3623046d90421 100644 (file)
@@ -213,8 +213,11 @@ M: object v?
 : 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
index 3f921eb7819a6fca55cbad278ace9f142a5e1790..ee31a8ba6a87e5b53f1d1d5c00503926488710c8 100644 (file)
@@ -20,7 +20,7 @@ IN: benchmark.simd-1
     [ 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 ;