diff --git a/basis/checksums/adler-32/adler-32.factor b/basis/checksums/adler-32/adler-32.factor index 1937503dd9..67c2842b74 100644 --- a/basis/checksums/adler-32/adler-32.factor +++ b/basis/checksums/adler-32/adler-32.factor @@ -11,7 +11,7 @@ CONSTANT: adler-32-modulus 65521 M: adler-32 checksum-bytes ( bytes checksum -- value ) drop [ sum 1 + ] - [ [ dup length [1,b] v. ] [ length ] bi + ] bi + [ [ dup length [1,b] vdot ] [ length ] bi + ] bi [ adler-32-modulus mod ] bi@ 16 shift bitor ; INSTANCE: adler-32 checksum diff --git a/basis/compiler/cfg/intrinsics/simd/simd-tests.factor b/basis/compiler/cfg/intrinsics/simd/simd-tests.factor index 3f3915a170..383a02670d 100644 --- a/basis/compiler/cfg/intrinsics/simd/simd-tests.factor +++ b/basis/compiler/cfg/intrinsics/simd/simd-tests.factor @@ -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 diff --git a/basis/compiler/cfg/intrinsics/simd/simd.factor b/basis/compiler/cfg/intrinsics/simd/simd.factor index 3d64fe2c6e..11e4fc61c2 100644 --- a/basis/compiler/cfg/intrinsics/simd/simd.factor +++ b/basis/compiler/cfg/intrinsics/simd/simd.factor @@ -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 ] } diff --git a/basis/math/matrices/matrices.factor b/basis/math/matrices/matrices.factor index 1090c2af5c..7af1b77210 100644 --- a/basis/math/matrices/matrices.factor +++ b/basis/math/matrices/matrices.factor @@ -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? ; diff --git a/basis/math/polynomials/polynomials.factor b/basis/math/polynomials/polynomials.factor index b5d074e954..0c2615be7e 100644 --- a/basis/math/polynomials/polynomials.factor +++ b/basis/math/polynomials/polynomials.factor @@ -36,7 +36,7 @@ ALIAS: n*p n*v [ drop length [ ] keep ] [ nip ] [ drop ] 2tri - '[ _ _ _ v. ] map reverse! ; + '[ _ _ _ vdot ] map reverse! ; : p-sq ( p -- p^2 ) dup p* ; inline diff --git a/basis/math/quaternions/quaternions.factor b/basis/math/quaternions/quaternions.factor index d10cd7a8cb..69b65d4aae 100644 --- a/basis/math/quaternions/quaternions.factor +++ b/basis/math/quaternions/quaternions.factor @@ -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 diff --git a/basis/math/vectors/simd/simd-docs.factor b/basis/math/vectors/simd/simd-docs.factor index 4ebff58658..5f7d3189fa 100644 --- a/basis/math/vectors/simd/simd-docs.factor +++ b/basis/math/vectors/simd/simd-docs.factor @@ -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 diff --git a/basis/math/vectors/simd/simd-tests.factor b/basis/math/vectors/simd/simd-tests.factor index 7f65078fd9..9f4a17e64e 100644 --- a/basis/math/vectors/simd/simd-tests.factor +++ b/basis/math/vectors/simd/simd-tests.factor @@ -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+ } } diff --git a/basis/math/vectors/simd/simd.factor b/basis/math/vectors/simd/simd.factor index 1edbdf03f4..ab925b901a 100644 --- a/basis/math/vectors/simd/simd.factor +++ b/basis/math/vectors/simd/simd.factor @@ -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 ; diff --git a/basis/math/vectors/vectors-docs.factor b/basis/math/vectors/vectors-docs.factor index 8912672bdc..cb1a001214 100644 --- a/basis/math/vectors/vectors-docs.factor +++ b/basis/math/vectors/vectors-docs.factor @@ -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 diff --git a/basis/math/vectors/vectors-tests.factor b/basis/math/vectors/vectors-tests.factor index 140fae23aa..69fdf57081 100644 --- a/basis/math/vectors/vectors-tests.factor +++ b/basis/math/vectors/vectors-tests.factor @@ -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 diff --git a/basis/math/vectors/vectors.factor b/basis/math/vectors/vectors.factor index a35b9696a9..006011166e 100644 --- a/basis/math/vectors/vectors.factor +++ b/basis/math/vectors/vectors.factor @@ -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- ; diff --git a/basis/sequences/cords/cords.factor b/basis/sequences/cords/cords.factor index 74b513261f..0576efdb86 100644 --- a/basis/sequences/cords/cords.factor +++ b/basis/sequences/cords/cords.factor @@ -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 diff --git a/basis/ui/gadgets/gadgets.factor b/basis/ui/gadgets/gadgets.factor index 5e1c2c0900..6338c917cb 100644 --- a/basis/ui/gadgets/gadgets.factor +++ b/basis/ui/gadgets/gadgets.factor @@ -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> diff --git a/basis/ui/gadgets/grid-lines/grid-lines.factor b/basis/ui/gadgets/grid-lines/grid-lines.factor index c29236a923..db759a4201 100644 --- a/basis/ui/gadgets/grid-lines/grid-lines.factor +++ b/basis/ui/gadgets/grid-lines/grid-lines.factor @@ -12,7 +12,7 @@ C: 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 ; diff --git a/basis/ui/gadgets/sliders/sliders.factor b/basis/ui/gadgets/sliders/sliders.factor index e195b376ab..2ddf0e715d 100644 --- a/basis/ui/gadgets/sliders/sliders.factor +++ b/basis/ui/gadgets/sliders/sliders.factor @@ -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 ; diff --git a/extra/arrays/shaped/shaped.factor b/extra/arrays/shaped/shaped.factor index ab19138af4..65fed31794 100644 --- a/extra/arrays/shaped/shaped.factor +++ b/extra/arrays/shaped/shaped.factor @@ -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 ; diff --git a/extra/benchmark/iteration/iteration.factor b/extra/benchmark/iteration/iteration.factor index 563621ef1e..960da74a4e 100644 --- a/extra/benchmark/iteration/iteration.factor +++ b/extra/benchmark/iteration/iteration.factor @@ -9,7 +9,7 @@ kernel ; : string-iter ( -- ) 100 [ 0 100000 >string [ ] map drop ] times ; : sbuf-iter ( -- ) 100 [ 0 100000 >sbuf [ ] map drop ] times ; : reverse-iter ( -- ) 100 [ 0 100000 >vector [ ] map drop ] times ; -: dot-iter ( -- ) 100 [ 0 100000 dup v. drop ] times ; +: dot-iter ( -- ) 100 [ 0 100000 dup vdot drop ] times ; : iteration-benchmark ( -- ) vector-iter diff --git a/extra/benchmark/raytracer-simd/raytracer-simd.factor b/extra/benchmark/raytracer-simd/raytracer-simd.factor index 86f438cd4c..fd37c7bee0 100644 --- a/extra/benchmark/raytracer-simd/raytracer-simd.factor +++ b/extra/benchmark/raytracer-simd/raytracer-simd.factor @@ -42,7 +42,7 @@ C: 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 ] 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. = [ diff --git a/extra/benchmark/raytracer/raytracer.factor b/extra/benchmark/raytracer/raytracer.factor index d035e92827..710629788b 100644 --- a/extra/benchmark/raytracer/raytracer.factor +++ b/extra/benchmark/raytracer/raytracer.factor @@ -44,7 +44,7 @@ C: 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 ] 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. = [ diff --git a/extra/benchmark/spectral-norm-simd/spectral-norm-simd.factor b/extra/benchmark/spectral-norm-simd/spectral-norm-simd.factor index 03156cc83f..353f2096d9 100644 --- a/extra/benchmark/spectral-norm-simd/spectral-norm-simd.factor +++ b/extra/benchmark/spectral-norm-simd/spectral-norm-simd.factor @@ -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 . ; diff --git a/extra/benchmark/spectral-norm/spectral-norm.factor b/extra/benchmark/spectral-norm/spectral-norm.factor index cdfca74101..96ec5fe318 100644 --- a/extra/benchmark/spectral-norm/spectral-norm.factor +++ b/extra/benchmark/spectral-norm/spectral-norm.factor @@ -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 ; diff --git a/extra/boids/simulation/simulation.factor b/extra/boids/simulation/simulation.factor index f5a1531710..1eafb76c79 100644 --- a/extra/boids/simulation/simulation.factor +++ b/extra/boids/simulation/simulation.factor @@ -29,7 +29,7 @@ C: 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 diff --git a/extra/euler/b-rep/b-rep.factor b/extra/euler/b-rep/b-rep.factor index ef0df0b5cc..ede558a1ae 100644 --- a/extra/euler/b-rep/b-rep.factor +++ b/extra/euler/b-rep/b-rep.factor @@ -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 diff --git a/extra/euler/modeling/modeling.factor b/extra/euler/modeling/modeling.factor index b72112e952..64ae93ac25 100644 --- a/extra/euler/modeling/modeling.factor +++ b/extra/euler/modeling/modeling.factor @@ -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 ) diff --git a/extra/gml/coremath/coremath.factor b/extra/gml/coremath/coremath.factor index 5db5b75e0a..c7a6de2315 100644 --- a/extra/gml/coremath/coremath.factor +++ b/extra/gml/coremath/coremath.factor @@ -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 ) { diff --git a/extra/gml/viewer/viewer.factor b/extra/gml/viewer/viewer.factor index 745c3891ab..dac196bf38 100644 --- a/extra/gml/viewer/viewer.factor +++ b/extra/gml/viewer/viewer.factor @@ -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 diff --git a/extra/jamshred/oint/oint.factor b/extra/jamshred/oint/oint.factor index 8d9bfdca0c..9b92c7b274 100644 --- a/extra/jamshred/oint/oint.factor +++ b/extra/jamshred/oint/oint.factor @@ -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+ ; diff --git a/extra/jamshred/tunnel/tunnel.factor b/extra/jamshred/tunnel/tunnel.factor index 7324cf7e0b..94e4d7b8b0 100644 --- a/extra/jamshred/tunnel/tunnel.factor +++ b/extra/jamshred/tunnel/tunnel.factor @@ -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 ; diff --git a/extra/math/affine-transforms/affine-transforms.factor b/extra/math/affine-transforms/affine-transforms.factor index 96c3739063..9cebe85df8 100644 --- a/extra/math/affine-transforms/affine-transforms.factor +++ b/extra/math/affine-transforms/affine-transforms.factor @@ -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 ; diff --git a/extra/math/analysis/analysis.factor b/extra/math/analysis/analysis.factor index 631f6ff661..ca3d27ff66 100644 --- a/extra/math/analysis/analysis.factor +++ b/extra/math/analysis/analysis.factor @@ -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 diff --git a/extra/math/matrices/simd/simd.factor b/extra/math/matrices/simd/simd.factor index a4394e5a21..458c11a88a 100644 --- a/extra/math/matrices/simd/simd.factor +++ b/extra/math/matrices/simd/simd.factor @@ -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 diff --git a/extra/math/numerical-integration/numerical-integration.factor b/extra/math/numerical-integration/numerical-integration.factor index e0111f1d52..acc22fa2a2 100644 --- a/extra/math/numerical-integration/numerical-integration.factor +++ b/extra/math/numerical-integration/numerical-integration.factor @@ -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 diff --git a/extra/math/similarity/similarity.factor b/extra/math/similarity/similarity.factor index 52c5027ada..34ff047d2a 100644 --- a/extra/math/similarity/similarity.factor +++ b/extra/math/similarity/similarity.factor @@ -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 / ; : weighted-cosine-similarity ( w a b -- n ) - [ weighted-v. ] + [ weighted-vdot ] [ overd [ weighted-norm ] 2bi@ * ] 3bi / ; diff --git a/extra/rosetta-code/knapsack-unbounded/knapsack-unbounded.factor b/extra/rosetta-code/knapsack-unbounded/knapsack-unbounded.factor index 55f54c0f5a..f7362fa3f1 100644 --- a/extra/rosetta-code/knapsack-unbounded/knapsack-unbounded.factor +++ b/extra/rosetta-code/knapsack-unbounded/knapsack-unbounded.factor @@ -40,9 +40,9 @@ TUPLE: bounty amounts value weight volume ; : ( 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 -- ? ) diff --git a/extra/terrain/terrain.factor b/extra/terrain/terrain.factor index ba288298ab..1b2f8c984b 100644 --- a/extra/terrain/terrain.factor +++ b/extra/terrain/terrain.factor @@ -169,7 +169,7 @@ terrain-world H{ segment bitmap>> 4 :> 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' )