]> gitweb.factorcode.org Git - factor.git/commitdiff
math.vectors: rename "v." to "vdot"
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 26 Feb 2020 20:40:16 +0000 (12:40 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 26 Feb 2020 20:40:16 +0000 (12:40 -0800)
36 files changed:
basis/checksums/adler-32/adler-32.factor
basis/compiler/cfg/intrinsics/simd/simd-tests.factor
basis/compiler/cfg/intrinsics/simd/simd.factor
basis/math/matrices/matrices.factor
basis/math/polynomials/polynomials.factor
basis/math/quaternions/quaternions.factor
basis/math/vectors/simd/simd-docs.factor
basis/math/vectors/simd/simd-tests.factor
basis/math/vectors/simd/simd.factor
basis/math/vectors/vectors-docs.factor
basis/math/vectors/vectors-tests.factor
basis/math/vectors/vectors.factor
basis/sequences/cords/cords.factor
basis/ui/gadgets/gadgets.factor
basis/ui/gadgets/grid-lines/grid-lines.factor
basis/ui/gadgets/sliders/sliders.factor
extra/arrays/shaped/shaped.factor
extra/benchmark/iteration/iteration.factor
extra/benchmark/raytracer-simd/raytracer-simd.factor
extra/benchmark/raytracer/raytracer.factor
extra/benchmark/spectral-norm-simd/spectral-norm-simd.factor
extra/benchmark/spectral-norm/spectral-norm.factor
extra/boids/simulation/simulation.factor
extra/euler/b-rep/b-rep.factor
extra/euler/modeling/modeling.factor
extra/gml/coremath/coremath.factor
extra/gml/viewer/viewer.factor
extra/jamshred/oint/oint.factor
extra/jamshred/tunnel/tunnel.factor
extra/math/affine-transforms/affine-transforms.factor
extra/math/analysis/analysis.factor
extra/math/matrices/simd/simd.factor
extra/math/numerical-integration/numerical-integration.factor
extra/math/similarity/similarity.factor
extra/rosetta-code/knapsack-unbounded/knapsack-unbounded.factor
extra/terrain/terrain.factor

index 1937503dd99a7b207bd0dd31eabcea5b68243c15..67c2842b74b5bf0f863c4308dae441c76d3eb37b 100644 (file)
@@ -11,7 +11,7 @@ CONSTANT: adler-32-modulus 65521
 M: adler-32 checksum-bytes ( bytes checksum -- value )
     drop
     [ sum 1 + ]
-    [ [ dup length [1,b] <reversed> v. ] [ length ] bi + ] bi
+    [ [ dup length [1,b] <reversed> vdot ] [ length ] bi + ] bi
     [ adler-32-modulus mod ] bi@ 16 shift bitor ;
 
 INSTANCE: adler-32 checksum
index 3f3915a170c2a5df7cb785206c85e06be6062bf7..383a02670d203bb14ac83a65de28514c42f8dc45 100644 (file)
@@ -238,13 +238,13 @@ M: horizontal-cpu %horizontal-add-vector-reps signed-reps ;
 M: horizontal-cpu %unpack-vector-head-reps signed-reps ;
 M: horizontal-cpu %unpack-vector-tail-reps signed-reps ;
 
-! v.
+! vdot
 { { ##dot-vector } }
-[ dot-cpu float-4-rep [ emit-simd-v. ] test-emit ]
+[ dot-cpu float-4-rep [ emit-simd-vdot ] test-emit ]
 unit-test
 
 { { ##mul-vector ##horizontal-add-vector ##horizontal-add-vector ##vector>scalar } }
-[ horizontal-cpu float-4-rep [ emit-simd-v. ] test-emit ]
+[ horizontal-cpu float-4-rep [ emit-simd-vdot ] test-emit ]
 unit-test
 
 { {
@@ -253,7 +253,7 @@ unit-test
     ##merge-vector-head ##merge-vector-tail ##add-vector
     ##vector>scalar
 } }
-[ simple-ops-cpu float-4-rep [ emit-simd-v. ] test-emit ]
+[ simple-ops-cpu float-4-rep [ emit-simd-vdot ] test-emit ]
 unit-test
 
 ! vsqrt
index 3d64fe2c6ef56f398c09efb65e1f8701da0b7928..11e4fc61c2a5c86dab32beb15c824ffd479435d8 100644 (file)
@@ -417,7 +417,7 @@ PREDICATE: fixnum-vector-rep < int-vector-rep
         ] }
     } emit-vv-vector-op ;
 
-: emit-simd-v. ( node -- )
+: emit-simd-vdot ( node -- )
     {
         [ ^^dot-vector ]
         { float-vector-rep [ [ ^^mul-vector ] [ ^sum-vector ] bi ] }
@@ -667,7 +667,7 @@ PREDICATE: fixnum-vector-rep < int-vector-rep
         { (simd-vmin)               [ emit-simd-vmin                ] }
         { (simd-vmax)               [ emit-simd-vmax                ] }
         { (simd-vavg)               [ emit-simd-vavg                ] }
-        { (simd-v.)                 [ emit-simd-v.                  ] }
+        { (simd-vdot                [ emit-simd-vdot                ] }
         { (simd-vsad)               [ emit-simd-vsad                ] }
         { (simd-vsqrt)              [ emit-simd-vsqrt               ] }
         { (simd-sum)                [ emit-simd-sum                 ] }
index 1090c2af5cfd209f2d2ca12805d6881462f2916a..7af1b77210c76dd12cd964e7481a279aa382dcf1 100644 (file)
@@ -248,8 +248,8 @@ DEFER: matrix-set-nths
 : m*  ( m1 m2 -- m ) [ v* ] 2map ;
 : m/  ( m1 m2 -- m ) [ v/ ] 2map ;
 
-: v.m ( v m -- p ) flip [ v. ] with map ;
-: m.v ( m v -- p ) [ v. ] curry map ;
+: v.m ( v m -- p ) flip [ vdot ] with map ;
+: m.v ( m v -- p ) [ vdot ] curry map ;
 : m. ( m m -- m ) flip [ swap m.v ] curry map ;
 
 : m~  ( m1 m2 epsilon -- ? ) [ v~ ] curry 2all? ;
index b5d074e9549be5f47d4f25c76b52e85b0a2d3b50..0c2615be7ea2f71805fc0b0841d3cb4a59d39cbc 100644 (file)
@@ -36,7 +36,7 @@ ALIAS: n*p n*v
     [ drop length [ <iota> ] keep ]
     [ nip <reversed> ]
     [ drop ] 2tri
-    '[ _ _ <slice> _ v. ] map reverse! ;
+    '[ _ _ <slice> _ vdot ] map reverse! ;
 
 : p-sq ( p -- p^2 ) dup p* ; inline
 
index d10cd7a8cbef179e407f8c968f24439a8bf4876b..69b65d4aae20136c50df9b73194895b8d2c1ee21 100644 (file)
@@ -70,7 +70,7 @@ PRIVATE>
     { } euler-like ; inline
 
 :: slerp ( q0 q1 t -- qt )
-    q0 q1 v. -1.0 1.0 clamp :> dot
+    q0 q1 vdot -1.0 1.0 clamp :> dot
     dot facos t * :> omega
     q1 dot q0 n*v v- normalize :> qt'
     omega fcos q0 n*v omega fsin qt' n*v v+ ; inline
index 4ebff58658528f2731b7403ac24d4e4e937c1e8a..5f7d3189fa6f11e918acff90fe16ba1219c34b93 100644 (file)
@@ -23,11 +23,11 @@ $nl
 $nl
 "SSE2 introduces double-precision SIMD (" { $snippet "double-2" } ") and integer SIMD (all types). Integer SIMD is missing a few features; in particular, the " { $link vmin } " and " { $link vmax } " operations only work on " { $snippet "uchar-16" } " and " { $snippet "short-8" } "."
 $nl
-"SSE3 introduces horizontal adds (summing all components of a single vector register), which are useful for computing dot products. Where available, SSE3 operations are used to speed up " { $link sum } ", " { $link v. } ", " { $link norm-sq } ", " { $link norm } ", and " { $link distance } "."
+"SSE3 introduces horizontal adds (summing all components of a single vector register), which are useful for computing dot products. Where available, SSE3 operations are used to speed up " { $link sum } ", " { $link vdot } ", " { $link norm-sq } ", " { $link norm } ", and " { $link distance } "."
 $nl
 "SSSE3 introduces " { $link vabs } " for " { $snippet "char-16" } ", " { $snippet "short-8" } " and " { $snippet "int-4" } "."
 $nl
-"SSE4.1 introduces " { $link vmin } " and " { $link vmax } " for all remaining integer types, a faster instruction for " { $link v. } ", and a few other things."
+"SSE4.1 introduces " { $link vmin } " and " { $link vmax } " for all remaining integer types, a faster instruction for " { $link vdot } ", and a few other things."
 $nl
 "On PowerPC, or older x86 chips without SSE, software fallbacks are used for all high-level vector operations. SIMD code can run with no loss in functionality, just decreased performance."
 $nl
index 7f65078fd90b51f35ab437bcd54bd319640f15d9..9f4a17e64e5ee178b453961709d6c96e138bf65d 100644 (file)
@@ -80,7 +80,7 @@ CONSTANT: vector-words
         { vneg { +vector+ -> +vector+ } }
         { vs- { +vector+ +vector+ -> +vector+ } }
         { v-n { +vector+ +scalar+ -> +vector+ } }
-        { v. { +vector+ +vector+ -> +scalar+ } }
+        { vdot { +vector+ +vector+ -> +scalar+ } }
         { vsad { +vector+ +vector+ -> +scalar+ } }
         { v/ { +vector+ +vector+ -> +vector+ } }
         { v/n { +vector+ +scalar+ -> +vector+ } }
index 1edbdf03f46fcdc76eed4224a455e4e8a931dac8..ab925b901a231f1cca03d111bbfdbf93b2eb4e3e 100644 (file)
@@ -171,8 +171,8 @@ M: simd-128 vmin
     dup simd-rep [ (simd-vmin) ] [ call-next-method ] vv->v-op ; inline
 M: simd-128 vmax
     dup simd-rep [ (simd-vmax) ] [ call-next-method ] vv->v-op ; inline
-M: simd-128 v.
-    dup simd-rep [ (simd-v.) ] [ call-next-method ] vv->x-op ; inline
+M: simd-128 vdot
+    dup simd-rep [ (simd-vdot) ] [ call-next-method ] vv->x-op ; inline
 M: simd-128 vsad
     dup simd-rep [ (simd-vsad) ] [ call-next-method ] vv->x-op ; inline
 M: simd-128 vsqrt
@@ -253,7 +253,7 @@ M: simd-128 v+n over simd-with v+ ; inline
 M: simd-128 v-n over simd-with v- ; inline
 M: simd-128 v*n over simd-with v* ; inline
 M: simd-128 v/n over simd-with v/ ; inline
-M: simd-128 norm-sq dup v. assert-positive ; inline
+M: simd-128 norm-sq dup vdot assert-positive ; inline
 M: simd-128 distance v- norm ; inline
 
 M: simd-128 >pprint-sequence ;
index 8912672bdc21a908e5adcf437b25f77c28be014f..cb1a0012146de7f8787ceefad9389278d66731c2 100644 (file)
@@ -43,7 +43,7 @@ ARTICLE: "math-vectors-arithmetic" "Vector arithmetic"
 }
 "Inner product and norm:"
 { $subsections
-    v.
+    vdot
     norm
     norm-sq
     normalize
@@ -314,7 +314,7 @@ HELP: vclamp
   }
 } ;
 
-HELP: v.
+HELP: vdot
 { $values { "u" { $sequence real } } { "v" { $sequence real } } { "x" real } }
 { $description "Computes the dot product of two vectors." } ;
 
@@ -588,7 +588,7 @@ HELP: vnone?
 
 { 2map v+ v- v* v/ } related-words
 
-{ 2reduce v. } related-words
+{ 2reduce vdot } related-words
 
 { vs+ vs- vs* } related-words
 
index 140fae23aa42cbb2b1bcd40188604e2b3317876d..69fdf57081d79c0d70619b7927b7b38ce3e8ac5b 100644 (file)
@@ -30,8 +30,8 @@ SPECIALIZED-ARRAY: int
 
 { { 0 3 2 5 4 } } [ { 1 2 3 4 5 } { 1 1 1 1 1 } v+- ] unit-test
 
-{ 32 } [ { 1 2 3 } { 4 5 6 } v. ] unit-test
-{ -1 } [ { C{ 0 1 } } dup v. ] unit-test
+{ 32 } [ { 1 2 3 } { 4 5 6 } vdot ] unit-test
+{ -1 } [ { C{ 0 1 } } dup vdot ] unit-test
 
 { 1 } [ { C{ 0 1 } } dup h. ] unit-test
 
index a35b9696a9b28320c7d5314175c8fb51966296c1..006011166e2ff5945072c3885b99be7971a5e795 100644 (file)
@@ -217,8 +217,8 @@ M: object v?
 : vsupremum ( seq -- vmax ) [ ] [ vmax ] map-reduce ; inline
 : vinfimum ( seq -- vmin ) [ ] [ vmin ] map-reduce ; inline
 
-GENERIC: v. ( u v -- x )
-M: object v. [ * ] [ + ] 2map-reduce ; inline
+GENERIC: vdot ( u v -- x )
+M: object vdot [ * ] [ + ] 2map-reduce ; inline
 
 GENERIC: h. ( u v -- x )
 M: object h. [ conjugate * ] [ + ] 2map-reduce ; inline
@@ -288,7 +288,7 @@ PRIVATE>
     vec2 vec1 v- vec3 vec1 v- cross normalize ; inline
 
 : proj ( v u -- w )
-    [ [ v. ] [ norm-sq ] bi / ] keep n*v ;
+    [ [ vdot ] [ norm-sq ] bi / ] keep n*v ;
 
 : perp ( v u -- w )
     dupd proj v- ;
index 74b513261f7dd0de0b536aff48ab0bfaa341a820..0576efdb86a1dd63b3168ae5a041d1d9c8726217 100644 (file)
@@ -78,8 +78,7 @@ M: cord v*                [ v*                ] [ call-next-method ] cord-2map ;
 M: cord v/                [ v/                ] [ call-next-method ] cord-2map ; inline
 M: cord vmin              [ vmin              ] [ call-next-method ] cord-2map ; inline
 M: cord vmax              [ vmax              ] [ call-next-method ] cord-2map ; inline
-M: cord v.
-    [ v.                ] [ + ] [ call-next-method ] cord-2both ; inline
+M: cord vdot              [ vdot              ] [ + ] [ call-next-method ] cord-2both ; inline
 M: cord vsqrt             [ vsqrt             ] cord-map  ; inline
 M: cord sum               [ sum               ] cord-both + ; inline
 M: cord vabs              [ vabs              ] cord-map  ; inline
@@ -106,7 +105,7 @@ M: cord vunordered?       [ vunordered?       ] [ call-next-method ] cord-2map ;
 M: cord vany?             [ vany?             ] cord-both or  ; inline
 M: cord vall?             [ vall?             ] cord-both and ; inline
 M: cord vnone?            [ vnone?            ] cord-both and ; inline
-M: cord vshuffle-elements 
+M: cord vshuffle-elements
     [ [ head>> ] [ tail>> ] bi ] [ split-shuffle ] bi*
     [ vshuffle2-elements ] bi-curry@ 2bi cord-append ; inline
 
index 5e1c2c0900f69d0306fb2e266169ebfb5fd2df21..6338c917cb9f88fe2dfec7a522e264d7ad693005 100644 (file)
@@ -69,7 +69,7 @@ M: gadget children-on nip children>> ;
     children [
         [ point ] dip
         quot call( value -- loc ) v-
-        axis v. 0 <=>
+        axis vdot 0 <=>
     ] search drop ; inline
 
 PRIVATE>
index c29236a9239f824bde2112c6cc9ca490ebd77e7d..db759a42014649bf7d7c447d2d4d19c0eae41f87 100644 (file)
@@ -12,7 +12,7 @@ C: <grid-lines> grid-lines
 
 :: (compute-grid-lines) ( grid n ns orientation -- seq )
     grid gap>> :> gap
-    ns n suffix gap orientation v. '[ _ - orientation n*v ] map
+    ns n suffix gap orientation vdot '[ _ - orientation n*v ] map
     dup grid dim>> gap v- orientation reverse v* '[ _ v+ ] map
     gap [ 2 /f ] map '[ [ _ v+ ] map ] bi@ zip ;
 
index e195b376ab5bb5065ee332593bd0e9700528f871..2ddf0e715da62431bbf97bab4a45771b30ea6575 100644 (file)
@@ -31,7 +31,7 @@ TUPLE: elevator < gadget direction ;
 CONSTANT: elevator-padding 4
 
 : elevator-length ( slider -- n )
-    [ elevator>> dim>> ] [ orientation>> ] bi v.
+    [ elevator>> dim>> ] [ orientation>> ] bi vdot
     elevator-padding 2 * [-] ;
 
 CONSTANT: min-thumb-dim 30
@@ -68,7 +68,7 @@ TUPLE: thumb < track ;
 
 : do-drag ( thumb -- )
     find-slider {
-        [ orientation>> drag-loc v. ]
+        [ orientation>> drag-loc vdot ]
         [ screen>slider ]
         [ saved>> + ]
         [ model>> set-range-value ]
@@ -114,7 +114,7 @@ CONSTANT: vertical-thumb-tiles
 
 : compute-direction ( elevator -- -1/1 )
     [ hand-click-rel ] [ find-slider ] bi
-    [ orientation>> v. ]
+    [ orientation>> vdot ]
     [ screen>slider ]
     [ slider-value - sgn ]
     tri ;
index ab19138af4c8e6862aef2f0cce3f51cc6e1e8086..65fed31794a431f4cede303be1c12d53e818cc01 100644 (file)
@@ -208,10 +208,10 @@ ERROR: shaped-bounds-error seq shape ;
 
 ! Inefficient
 : calculate-row-major-index ( seq shape -- i )
-    1 [ * ] accumulate nip reverse v. ;
+    1 [ * ] accumulate nip reverse vdot ;
 
 : calculate-column-major-index ( seq shape -- i )
-    1 [ * ] accumulate nip v. ;
+    1 [ * ] accumulate nip vdot ;
 
 : set-shaped-row-major ( obj seq shaped -- )
     shaped-bounds-check [ shape calculate-row-major-index ] [ underlying>> ] bi set-nth ;
index 563621ef1e402e6910950aad6c9a97128e60af11..960da74a4e83aa81fb6a8d7651efa6a10dcf5942 100644 (file)
@@ -9,7 +9,7 @@ kernel ;
 : string-iter ( -- ) 100 [ 0 100000 <range> >string [ ] map drop ] times ;
 : sbuf-iter ( -- ) 100 [ 0 100000 <range> >sbuf [ ] map drop ] times ;
 : reverse-iter ( -- ) 100 [ 0 100000 <range> >vector <reversed> [ ] map drop ] times ;
-: dot-iter ( -- ) 100 [ 0 100000 <range> dup v. drop ] times ;
+: dot-iter ( -- ) 100 [ 0 100000 <range> dup vdot drop ] times ;
 
 : iteration-benchmark ( -- )
     vector-iter
index 86f438cd4c460571b1abeb55563faae8dc12e824..fd37c7bee052c92c88787bdf06e96353b394151a 100644 (file)
@@ -42,7 +42,7 @@ C: <sphere> sphere
 
 : sphere-v ( sphere ray -- v ) [ center>> ] [ orig>> ] bi* v- ; inline no-compile
 
-: sphere-b ( v ray -- b ) dir>> v. ; inline no-compile
+: sphere-b ( v ray -- b ) dir>> vdot ; inline no-compile
 
 : sphere-d ( sphere b v -- d ) [ radius>> sq ] [ sq ] [ norm-sq ] tri* - + ; inline no-compile
 
@@ -98,7 +98,7 @@ CONSTANT: initial-hit T{ hit f double-4{ 0.0 0.0 0.0 0.0 } 1/0. }
 : sray-intersect ( ray scene hit -- ray )
     swap [ ray-o light vneg <ray> ] dip initial-intersect ; inline no-compile
 
-: ray-g ( hit -- g ) normal>> light v. ; inline no-compile
+: ray-g ( hit -- g ) normal>> light vdot ; inline no-compile
 
 : cast-ray ( ray scene -- g )
     2dup initial-intersect dup lambda>> 1/0. = [
index d035e92827dc5953e528011eed359010a3b82a90..710629788b6ca2d353351b7d298e29a9d52c60d8 100644 (file)
@@ -44,7 +44,7 @@ C: <sphere> sphere
     [ center>> ] [ orig>> ] bi* v- ; inline
 
 : sphere-b ( v ray -- b )
-    dir>> v. ; inline
+    dir>> vdot ; inline
 
 : sphere-d ( sphere b v -- d )
     [ radius>> sq ] [ sq ] [ norm-sq ] tri* - + ; inline
@@ -107,7 +107,7 @@ CONSTANT: initial-hit T{ hit f double-array{ 0.0 0.0 0.0 } 1/0. }
 : sray-intersect ( ray scene hit -- ray )
     swap [ ray-o light vneg <ray> ] dip initial-intersect ; inline
 
-: ray-g ( hit -- g ) normal>> light v. ; inline
+: ray-g ( hit -- g ) normal>> light vdot ; inline
 
 : cast-ray ( ray scene -- g )
     2dup initial-intersect dup lambda>> 1/0. = [
index 03156cc83f7ccb5bd26b3b3a86dfa47a07b5eacb..353f2096d9e74419f18cbdfc8fde1e85f7d92b38 100644 (file)
@@ -60,7 +60,7 @@ IN: benchmark.spectral-norm-simd
     ] times ; inline
 
 TYPED: spectral-norm ( n: fixnum -- norm )
-    u/v [ double cast-array ] bi@ [ v. ] [ norm-sq ] bi /f sqrt ;
+    u/v [ double cast-array ] bi@ [ vdot ] [ norm-sq ] bi /f sqrt ;
 
 : spectral-norm-simd-benchmark ( -- )
     2000 spectral-norm . ;
index cdfca74101140d906f75148dfd5bc5be1848347c..96ec5fe318b4058e7edddd3245c2543fbc778564 100644 (file)
@@ -47,7 +47,7 @@ IN: benchmark.spectral-norm
     ] times ; inline
 
 TYPED: spectral-norm ( n: fixnum -- norm )
-    u/v [ v. ] [ norm-sq ] bi /f sqrt ;
+    u/v [ vdot ] [ norm-sq ] bi /f sqrt ;
 
 : spectral-norm-benchmark ( -- )
     2000 spectral-norm number>string print ;
index f5a153171064d4532bf0ede130fb165c5d53879d..1eafb76c796b0681843071532065dc6835498dcb 100644 (file)
@@ -29,7 +29,7 @@ C: <boid> boid
     [ [ pos>> ] bi@ distance ] dip <= ; inline
 
 : angle-between ( u v -- angle )
-    [ normalize ] bi@ v. ; inline
+    [ normalize ] bi@ vdot ; inline
 
 : relative-position ( self other -- v )
     swap [ pos>> ] bi@ v- ; inline
index ef0df0b5cc3cf0014983e58d4dc786f7aba37b73..ede558a1ae8e2d1669c4c70386e3f88efe378273 100644 (file)
@@ -108,7 +108,7 @@ ERROR: all-points-colinear ;
     [ normalize ] [ all-points-colinear ] if* ;
 
 : (face-plane-dist) ( normal edge -- d )
-    vertex-pos v. neg ; inline
+    vertex-pos vdot neg ; inline
 
 : face-plane-dist ( edge -- d )
     [ face-normal ] [ (face-plane-dist) ] bi ; inline
index b72112e952538b166e14f9471fd32ca67ae26b7e..64ae93ac251b27576fb0de7b789bd4dc37b481be 100644 (file)
@@ -65,13 +65,13 @@ sharp-continue ;
 
 :: project-pt-line ( p p0 p1 -- q )
     p1 p0 v- :> vt
-    p p0 v- vt v.
+    p p0 v- vt vdot
     vt norm-sq /
     vt n*v p0 v+ ; inline
 
 :: project-pt-plane ( line-p0 line-vt plane-n plane-d -- q )
-    plane-d neg plane-n line-p0 v. -
-    line-vt plane-n v. /
+    plane-d neg plane-n line-p0 vdot -
+    line-vt plane-n vdot /
     line-vt n*v line-p0 v+ ; inline
 
 : project-poly-plane ( poly vdir plane-n plane-d -- qoly )
index 5db5b75e0a0c9dff35da7d772137c0747e78a9ec..c7a6de23150880519a74a2920c1c8d409c7d0823 100644 (file)
@@ -71,7 +71,7 @@ FROM: generalizations => npick ;
 
 GML: add ( a b -- c ) [ + ] [ v+ ] [ v+ ] gml-math-op ;
 GML: sub ( a b -- c ) [ - ] [ v- ] [ v- ] gml-math-op ;
-GML: mul ( a b -- c ) [ * ] [ v* ] [ v. ] gml-math-op ;
+GML: mul ( a b -- c ) [ * ] [ v* ] [ vdot ] gml-math-op ;
 GML: div ( a b -- c ) [ /f ] [ v/ mask-vec3d ] [ v/ mask-vec3d ] gml-math-op ;
 GML: mod ( a b -- c ) mod ;
 
@@ -191,10 +191,10 @@ GML: aNormal ( x -- y )
     } cond ;
 
 : det2 ( x y -- z )
-    { 1 0 } vshuffle double-2{ 1 -1 } v* v. ; inline
+    { 1 0 } vshuffle double-2{ 1 -1 } v* vdot ; inline
 
 : det3 ( x y z -- w )
-    [ cross ] dip v. ; inline
+    [ cross ] dip vdot ; inline
 
 GML: determinant ( x -- y )
     {
index 745c3891abefaadf6c207d280d5da41e15b34d3f..dac196bf38c2b8dd4b0afe323f1d2c23f68dbd8c 100644 (file)
@@ -24,7 +24,7 @@ CONSTANT: selected-face-color float-4{ 1 0.9 0.8 1 }
     >rgba-components float-4-boa ; inline
 
 : face-color ( edge -- color )
-    face-normal float-4{ 0 1 0.1 0 } v. 0.3 * 0.4 + dup dup 1.0 float-4-boa ; inline
+    face-normal float-4{ 0 1 0.1 0 } vdot 0.3 * 0.4 + dup dup 1.0 float-4-boa ; inline
 
 TUPLE: b-rep-vertices
     { array byte-array read-only }
@@ -234,11 +234,11 @@ CONSTANT: edge-hitbox-radius 0.05
 :: line-nearest-t ( p0 u q0 v -- tp tq )
     p0 q0 v- :> w0
 
-    u u v. :> a
-    u v v. :> b
-    v v v. :> c
-    u w0 v. :> d
-    v w0 v. :> e
+    u u vdot :> a
+    u v vdot :> b
+    v v vdot :> c
+    u w0 vdot :> d
+    v w0 vdot :> e
 
     a c * b b * - :> denom
 
index 8d9bfdca0c9a6642d704e3ddb7dc521087e0662d..9b92c7b27451480ca28643138883c9e3bcb393f8 100644 (file)
@@ -82,7 +82,7 @@ PRIVATE>
 
 : scalar-projection ( v1 v2 -- n )
     ! the scalar projection of v1 onto v2
-    [ v. ] [ norm ] bi / ;
+    [ vdot ] [ norm ] bi / ;
 
 : proj-perp ( u v -- w )
     dupd proj v- ;
@@ -93,7 +93,7 @@ PRIVATE>
 
 :: reflect ( v n -- v' )
     ! bounce v on a surface with normal n
-    v v n v. n n v. / 2 * n n*v v- ;
+    v v n vdot n n vdot / 2 * n n*v v- ;
 
 : half-way ( p1 p2 -- p3 )
     over v- 2 v/n v+ ;
index 7324cf7e0b3ed788cdd9c34df5c3ec13e0d441f0..94e4d7b8b0a08858749f6be722fde2706c5487d3 100644 (file)
@@ -72,7 +72,7 @@ CONSTANT: default-segment-radius 1
 
 : heading-segment ( segments current-segment heading -- segment )
     ! the next segment on the given heading
-    over forward>> v. 0 <=> {
+    over forward>> vdot 0 <=> {
         { +gt+ [ next-segment ] }
         { +lt+ [ previous-segment ] }
         { +eq+ [ nip ] } ! current segment
@@ -80,12 +80,12 @@ CONSTANT: default-segment-radius 1
 
 :: distance-to-next-segment ( current next location heading -- distance )
     current forward>> :> cf
-    cf next location>> v. cf location v. - cf heading v. / ;
+    cf next location>> vdot cf location vdot - cf heading vdot / ;
 
 :: distance-to-next-segment-area ( current next location heading -- distance )
     current forward>> :> cf
     next current half-way-between-oints :> h
-    cf h v. cf location v. - cf heading v. / ;
+    cf h vdot cf location vdot - cf heading vdot / ;
 
 : vector-to-centre ( seg loc -- v )
     over location>> swap v- swap forward>> proj-perp ;
@@ -110,9 +110,9 @@ CONSTANT: distant 1000
     v norm 0 = [
         distant
     ] [
-        v dup v. :> a
-        v w v. 2 * :> b
-        w dup v. r sq - :> c
+        v dup vdot :> a
+        v w vdot 2 * :> b
+        w dup vdot r sq - :> c
         c b a quadratic max-real
     ] if ;
 
index 96c37390637b9ff0de8c9872ad74cb51f52d8cd0..9cebe85df88088f0db57c1a556dca720f98a865a 100644 (file)
@@ -62,10 +62,10 @@ CONSTANT: identity-transform T{ affine-transform f
 
 : a. ( a a -- a )
     {
-        [ [ transpose-axes x>> ] [ x>> ] bi* v. ]
-        [ [ transpose-axes y>> ] [ x>> ] bi* v. ]
-        [ [ transpose-axes x>> ] [ y>> ] bi* v. ]
-        [ [ transpose-axes y>> ] [ y>> ] bi* v. ]
+        [ [ transpose-axes x>> ] [ x>> ] bi* vdot ]
+        [ [ transpose-axes y>> ] [ x>> ] bi* vdot ]
+        [ [ transpose-axes x>> ] [ y>> ] bi* vdot ]
+        [ [ transpose-axes y>> ] [ y>> ] bi* vdot ]
         [ origin>> a.v ]
     } 2cleave
     [ [ 2array ] 2bi@ ] dip <affine-transform> ;
index 631f6ff6615c681c0f275b0bace2fbdd6a508d91..ca3d27ff6661e901962dab4b42f90a2fdac5d224 100644 (file)
@@ -23,7 +23,7 @@ CONSTANT: gamma-p6
 : (gamma-lanczos6) ( x -- log[gamma[x+1]] )
     ! log(gamma(x+1)
     [ 0.5 + dup gamma-g6 + [ log * ] keep - ]
-    [ 6 gamma-z gamma-p6 v. log ] bi + ;
+    [ 6 gamma-z gamma-p6 vdot log ] bi + ;
 
 : gamma-lanczos6 ( x -- gamma[x] )
     ! gamma(x) = gamma(x+1) / x
index a4394e5a21287574d1b595b43d9552b6b0a3ff15..458c11a88aa967f3ff53b506150bcd2cf81a5a82 100644 (file)
@@ -94,7 +94,7 @@ TYPED:: m4.v ( m: matrix4 v: float-4 -- v': float-4 )
     v fourth m4 n*v v+ ;
 
 TYPED:: v.m4 ( v: float-4 m: matrix4 -- c: float-4 )
-    m columns [ v v. ] 4 napply float-4-boa ;
+    m columns [ v vdot ] 4 napply float-4-boa ;
 
 CONSTANT: identity-matrix4
     S{ matrix4 f
index e0111f1d5233b9da774ec6d42ba53eab087fb450..acc22fa2a2bc989e5148c1f6f21ff4b0619fc0a5 100644 (file)
@@ -18,4 +18,4 @@ SYMBOL: num-steps
 : integrate-simpson ( from to quot -- x )
     [ setup-simpson-range dup ] dip
     map dup generate-simpson-weights
-    v. swap [ third ] keep first - 6 / * ; inline
+    vdot swap [ third ] keep first - 6 / * ; inline
index 52c5027ada3d64bc73397c5dcd8e7c1448906c57..34ff047d2af81fe778dfd94f386405952e60fc8c 100644 (file)
@@ -13,11 +13,11 @@ IN: math.similarity
     over length 3 < [ 2drop 1.0 ] [ population-corr 0.5 * 0.5 + ] if ;
 
 : cosine-similarity ( a b -- n )
-    [ v. ] [ [ norm ] bi@ * ] 2bi / ;
+    [ vdot ] [ [ norm ] bi@ * ] 2bi / ;
 
 <PRIVATE
 
-: weighted-v. ( w a b -- n )
+: weighted-vdot ( w a b -- n )
     [ * * ] [ + ] 3map-reduce ;
 
 : weighted-norm ( w a -- n )
@@ -26,5 +26,5 @@ IN: math.similarity
 PRIVATE>
 
 : weighted-cosine-similarity ( w a b -- n )
-    [ weighted-v. ]
+    [ weighted-vdot ]
     [ overd [ weighted-norm ] 2bi@ * ] 3bi / ;
index 55f54c0f5adbd13c3eaa3cf319228a2c25f3929b..f7362fa3f1d72a6b02cec12c7ee752ef95988c05 100644 (file)
@@ -40,9 +40,9 @@ TUPLE: bounty amounts value weight volume ;
 : <bounty> ( items -- bounty )
     [ bounty new ] dip {
         [ >>amounts ]
-        [ values v. >>value ]
-        [ weights v. >>weight ]
-        [ volumes v. >>volume ]
+        [ values vdot >>value ]
+        [ weights vdot >>weight ]
+        [ volumes vdot >>volume ]
     } cleave ;
 
 : valid-bounty? ( bounty -- ? )
index ba288298ab74426869218e5d6e010de26b4af094..1b2f8c984b763b17e9c106065dd7bd4e3799df99 100644 (file)
@@ -169,7 +169,7 @@ terrain-world H{
     segment bitmap>> 4 <groups> :> pixels
     pixel dim pixel-indices :> indices
 
-    indices [ pixels nth COMPONENT-SCALE v. 255.0 / ] map
+    indices [ pixels nth COMPONENT-SCALE vdot 255.0 / ] map
     first4 pixel-mantissa bilerp ;
 
 : (collide) ( segment location -- location' )