From 07a5912afa1da1c7a34ae31c9d411e9a0634e98d Mon Sep 17 00:00:00 2001
From: John Benediktsson <mrjbq7@gmail.com>
Date: Wed, 26 Feb 2020 12:51:04 -0800
Subject: [PATCH] math.matrices: rename m./m.v/v.m to mdot/mdotv/vdotm.

---
 basis/math/matrices/matrices-docs.factor       | 18 +++++++++---------
 basis/math/matrices/matrices-tests.factor      | 10 +++++-----
 basis/math/matrices/matrices.factor            |  6 +++---
 .../3d-matrix-scalar/3d-matrix-scalar.factor   |  4 ++--
 extra/benchmark/pidigits/pidigits.factor       |  4 ++--
 extra/game/debug/tests/tests.factor            |  2 +-
 extra/gml/geometry/geometry.factor             |  2 +-
 extra/gml/viewer/viewer.factor                 |  1 -
 extra/gpu/demos/raytrace/raytrace.factor       |  2 +-
 extra/gpu/util/wasd/wasd.factor                |  9 +++++----
 extra/koszul/koszul.factor                     |  6 +++---
 .../elimination/elimination-docs.factor        |  2 +-
 extra/math/matrices/extras/extras.factor       |  4 ++--
 extra/project-euler/common/common.factor       |  2 +-
 .../conjugate-transpose.factor                 |  4 ++--
 .../pythagorean-triples.factor                 |  3 ++-
 16 files changed, 40 insertions(+), 39 deletions(-)

diff --git a/basis/math/matrices/matrices-docs.factor b/basis/math/matrices/matrices-docs.factor
index e7832d73a1..9bf0da32fa 100644
--- a/basis/math/matrices/matrices-docs.factor
+++ b/basis/math/matrices/matrices-docs.factor
@@ -114,7 +114,7 @@ $nl
 { $subsections m+ m- m* m/ m~ }
 
 "Dot product (multiplication) of vectors and matrices:"
-{ $subsections v.m m.v m. }
+{ $subsections vdotm mdotv mdot }
 
 "Transformations and elements of matrices:"
 { $subsections
@@ -845,39 +845,39 @@ HELP: m/
     }
 } ;
 
-HELP: m.v
+HELP: mdotv
 { $values { "m" matrix } { "v" sequence } { "p" matrix } }
 { $description "Computes the dot product of a matrix and a vector." }
 { $notelist
-    { $equiv-word-note "swapped" v.m }
+    { $equiv-word-note "swapped" vdotm }
     $2d-only-note
     { $matrix-scalar-note * + }
 }
 { $examples
     { $example
         "USING: math.matrices prettyprint ;"
-        "{ { 1 -1 2 } { 0 -3 1 } } { 2 1 0 } m.v ."
+        "{ { 1 -1 2 } { 0 -3 1 } } { 2 1 0 } mdotv ."
         "{ 1 -3 }"
     }
 } ;
 
-HELP: v.m
+HELP: vdotm
 { $values { "v" sequence } { "m" matrix } { "p" matrix } }
 { $description "Computes the dot product of a vector and a matrix." }
 { $notelist
-    { $equiv-word-note "swapped" m.v }
+    { $equiv-word-note "swapped" mdotv }
     $2d-only-note
     { $matrix-scalar-note * + }
 }
 { $examples
     { $example
         "USING: math.matrices prettyprint ;"
-        "{ 2 1 0 } { { 1 -1 2 } { 0 -3 1 } } v.m ."
+        "{ 2 1 0 } { { 1 -1 2 } { 0 -3 1 } } vdotm ."
         "{ 2 -5 5 }"
     }
 } ;
 
-HELP: m.
+HELP: mdot
 { $values { "m" matrix } }
 { $description "Computes the dot product of two matrices, i.e multiplies them." }
 { $notelist
@@ -887,7 +887,7 @@ HELP: m.
 { $examples
     { $example
         "USING: math.matrices prettyprint ;"
-        "{ { 1 -1 2 } { 0 -3 1 } } { { 3 7 } { 9 12 } } m. ."
+        "{ { 1 -1 2 } { 0 -3 1 } } { { 3 7 } { 9 12 } } mdot ."
         "{ { -6 -5 } { -27 -36 } }"
     }
 } ;
diff --git a/basis/math/matrices/matrices-tests.factor b/basis/math/matrices/matrices-tests.factor
index 63b77db715..7291d941c7 100644
--- a/basis/math/matrices/matrices-tests.factor
+++ b/basis/math/matrices/matrices-tests.factor
@@ -305,16 +305,16 @@ PRIVATE>
     m-
 ] unit-test
 
-{ { 3 4 } } [ { { 1 0 } { 0 1 } } { 3 4 } m.v ] unit-test
-{ { 4 3 } } [ { { 0 1 } { 1 0 } } { 3 4 } m.v ] unit-test
+{ { 3 4 } } [ { { 1 0 } { 0 1 } } { 3 4 } mdotv ] unit-test
+{ { 4 3 } } [ { { 0 1 } { 1 0 } } { 3 4 } mdotv ] unit-test
 
-{ { { 6 } } } [ { { 3 } } { { 2 } } m. ] unit-test
-{ { { 11 } } } [ { { 1 3 } } { { 5 } { 2 } } m. ] unit-test
+{ { { 6 } } } [ { { 3 } } { { 2 } } mdot ] unit-test
+{ { { 11 } } } [ { { 1 3 } } { { 5 } { 2 } } mdot ] unit-test
 
 { { { 28 } } } [
     { { 2 4 6 } }
     { { 1 } { 2 } { 3 } }
-    m.
+    mdot
 ] unit-test
 
 
diff --git a/basis/math/matrices/matrices.factor b/basis/math/matrices/matrices.factor
index 7af1b77210..8a64919bf1 100644
--- a/basis/math/matrices/matrices.factor
+++ b/basis/math/matrices/matrices.factor
@@ -248,9 +248,9 @@ DEFER: matrix-set-nths
 : m*  ( m1 m2 -- m ) [ v* ] 2map ;
 : m/  ( m1 m2 -- m ) [ v/ ] 2map ;
 
-: 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 ;
+: vdotm ( v m -- p ) flip [ vdot ] with map ;
+: mdotv ( m v -- p ) [ vdot ] curry map ;
+: mdot ( m m -- m ) flip [ swap mdotv ] curry map ;
 
 : m~  ( m1 m2 epsilon -- ? ) [ v~ ] curry 2all? ;
 
diff --git a/extra/benchmark/3d-matrix-scalar/3d-matrix-scalar.factor b/extra/benchmark/3d-matrix-scalar/3d-matrix-scalar.factor
index 1db2e013c5..5fd538453f 100644
--- a/extra/benchmark/3d-matrix-scalar/3d-matrix-scalar.factor
+++ b/extra/benchmark/3d-matrix-scalar/3d-matrix-scalar.factor
@@ -9,14 +9,14 @@ IN: benchmark.3d-matrix-scalar
 :: mv-matrix ( pitch yaw location -- matrix )
     { 1.0 0.0 0.0 } pitch <rotation-matrix4>
     { 0.0 1.0 0.0 } yaw   <rotation-matrix4>
-    location vneg <translation-matrix4> m. m. ;
+    location vneg <translation-matrix4> mdot mdot ;
 
 :: 3d-matrix-scalar-benchmark ( -- )
     f :> result!
     100000 [
         { 1024.0 768.0 } 0.7 0.25 1024.0 p-matrix :> p
         3.0 1.0 { 10.0 -0.0 2.0 } mv-matrix :> mv
-        mv p m. result!
+        mv p mdot result!
     ] times
     result . ;
 
diff --git a/extra/benchmark/pidigits/pidigits.factor b/extra/benchmark/pidigits/pidigits.factor
index efcb3f3a1e..7b28415457 100644
--- a/extra/benchmark/pidigits/pidigits.factor
+++ b/extra/benchmark/pidigits/pidigits.factor
@@ -19,13 +19,13 @@ IN: benchmark.pidigits
     [ 2array ] 2bi@ 2array ;
 
 : produce ( z y -- z' )
-    [ 10 ] dip -10 * 0 1 >matrix swap m. ;
+    [ 10 ] dip -10 * 0 1 >matrix swap mdot ;
 
 : gen-x ( x -- matrix )
     dup 2 * 1 + [ 2 * 0 ] keep >matrix ;
 
 : consume ( z k -- z' )
-    gen-x m. ;
+    gen-x mdot ;
 
 :: (padded-total) ( row col -- str n format )
     "" row col + "%" "s\t:%d\n"
diff --git a/extra/game/debug/tests/tests.factor b/extra/game/debug/tests/tests.factor
index 15638156d0..67f7e7c63a 100644
--- a/extra/game/debug/tests/tests.factor
+++ b/extra/game/debug/tests/tests.factor
@@ -15,7 +15,7 @@ IN: game.debug.tests
     } clear-framebuffer ;
 
 :: draw-debug-tests ( world -- )
-    world [ wasd-p-matrix ] [ wasd-mv-matrix ] bi m. :> mvp-matrix
+    world [ wasd-p-matrix ] [ wasd-mv-matrix ] bi mdot :> mvp-matrix
     { 0 0 0 } clear-screen
 
     [
diff --git a/extra/gml/geometry/geometry.factor b/extra/gml/geometry/geometry.factor
index 1197e99216..320c6d1b13 100644
--- a/extra/gml/geometry/geometry.factor
+++ b/extra/gml/geometry/geometry.factor
@@ -5,4 +5,4 @@ IN: gml.geometry
 
 GML: rot_vec ( v n alpha -- v )
     ! Inefficient!
-    deg>rad <rotation-matrix4> swap >array m.v >double-4 ;
+    deg>rad <rotation-matrix4> swap >array mdotv >double-4 ;
diff --git a/extra/gml/viewer/viewer.factor b/extra/gml/viewer/viewer.factor
index dac196bf38..efa1d1a650 100644
--- a/extra/gml/viewer/viewer.factor
+++ b/extra/gml/viewer/viewer.factor
@@ -9,7 +9,6 @@ math.vectors.simd math.vectors.simd.cords method-chains models
 namespaces sequences sets specialized-vectors typed ui
 ui.gadgets ui.gadgets.worlds ui.gestures ui.pixel-formats
 vectors ;
-FROM: math.matrices => m.v ;
 FROM: models => change-model ;
 SPECIALIZED-VECTORS: ushort float-4 ;
 IN: gml.viewer
diff --git a/extra/gpu/demos/raytrace/raytrace.factor b/extra/gpu/demos/raytrace/raytrace.factor
index ced1af3816..30da0e92f4 100644
--- a/extra/gpu/demos/raytrace/raytrace.factor
+++ b/extra/gpu/demos/raytrace/raytrace.factor
@@ -49,7 +49,7 @@ TUPLE: raytrace-world < wasd-world
 
 : sphere-center ( sphere -- center )
     [ [ axis>> ] [ theta>> ] bi <rotation-matrix4> ]
-    [ home>> ] bi m.v ;
+    [ home>> ] bi mdotv ;
 
 M: sphere audio-position sphere-center ; inline
 M: sphere audio-distance radius>> fsqrt 2.0 * ; inline
diff --git a/extra/gpu/util/wasd/wasd.factor b/extra/gpu/util/wasd/wasd.factor
index 40c5f653f2..65523ce5ca 100644
--- a/extra/gpu/util/wasd/wasd.factor
+++ b/extra/gpu/util/wasd/wasd.factor
@@ -40,12 +40,13 @@ M: wasd-world wasd-fly-vertically? drop t ;
 : wasd-mv-matrix ( world -- matrix )
     [ { 1.0 0.0 0.0 } swap pitch>> <rotation-matrix4> ]
     [ { 0.0 1.0 0.0 } swap yaw>>   <rotation-matrix4> ]
-    [ location>> vneg <translation-matrix4> ] tri m. m. ;
+    [ location>> vneg <translation-matrix4> ] tri mdot mdot ;
 
 : wasd-mv-inv-matrix ( world -- matrix )
     [ location>> <translation-matrix4> ]
     [ {  0.0 -1.0 0.0 } swap yaw>>   <rotation-matrix4> ]
-    [ { -1.0  0.0 0.0 } swap pitch>> <rotation-matrix4> ] tri m. m. ;
+    [ { -1.0  0.0 0.0 } swap pitch>> <rotation-matrix4> ] tri
+    mdot mdot ;
 
 : wasd-p-matrix ( world -- matrix )
     p-matrix>> ;
@@ -69,7 +70,7 @@ CONSTANT: fov 0.7
     loc world dim>> [ /f 0.5 - 2.0 * ] 2map
     world wasd-fov-vector v*
     first2 neg -1.0 0.0 4array
-    world wasd-mv-inv-matrix swap m.v ;
+    world wasd-mv-inv-matrix swap mdotv ;
 
 : set-wasd-view ( world location yaw pitch -- world )
     [ >>location ] [ >>yaw ] [ >>pitch ] tri* ;
@@ -85,7 +86,7 @@ CONSTANT: fov 0.7
     cosy         0.0       siny        neg  3array
     siny sinp *  cosp      cosy sinp *      3array
     siny cosp *  sinp neg  cosy cosp *      3array 3array
-    v swap v.m ;
+    v swap vdotm ;
 
 : ?pitch ( world -- pitch )
     dup wasd-fly-vertically? [ pitch>> ] [ drop 0.0 ] if ;
diff --git a/extra/koszul/koszul.factor b/extra/koszul/koszul.factor
index da2b62dd70..a0c39f9190 100644
--- a/extra/koszul/koszul.factor
+++ b/extra/koszul/koszul.factor
@@ -203,8 +203,8 @@ DEFER: (d)
     [ v- ] 2map ;
 
 ! Laplacian
-: m.m' ( matrix -- matrix' ) dup flip m. ;
-: m'.m ( matrix -- matrix' ) dup flip swap m. ;
+: mdotm' ( matrix -- matrix' ) dup flip mdot ;
+: m'dotm ( matrix -- matrix' ) dup flip swap mdot ;
 
 : empty-matrix? ( matrix -- ? )
     [ t ] [ first empty? ] if-empty ;
@@ -221,7 +221,7 @@ DEFER: (d)
     ] if ;
 
 : laplacian-matrix ( basis1 basis2 basis3 -- matrix )
-    dupd d-matrix m.m' [ d-matrix m'.m ] dip ?m+ ;
+    dupd d-matrix mdotm' [ d-matrix m'.m ] dip ?m+ ;
 
 : laplacian-betti ( basis1 basis2 basis3 -- n )
     laplacian-matrix null/rank drop ;
diff --git a/extra/math/matrices/elimination/elimination-docs.factor b/extra/math/matrices/elimination/elimination-docs.factor
index d0de9d17fe..0d650c50db 100644
--- a/extra/math/matrices/elimination/elimination-docs.factor
+++ b/extra/math/matrices/elimination/elimination-docs.factor
@@ -10,7 +10,7 @@ HELP: inverse
   { $example
     "USING: kernel math.matrices prettyprint ;"
     "FROM: math.matrices.elimination => inverse ;"
-    "{ { 3 4 } { 7 9 } } dup inverse m. 2 <identity-matrix> = ."
+    "{ { 3 4 } { 7 9 } } dup inverse mdot 2 <identity-matrix> = ."
     "t"
   }
 } ;
diff --git a/extra/math/matrices/extras/extras.factor b/extra/math/matrices/extras/extras.factor
index cdbef2416c..856971185c 100644
--- a/extra/math/matrices/extras/extras.factor
+++ b/extra/math/matrices/extras/extras.factor
@@ -306,7 +306,7 @@ M: matrix recip
 ! TODO: use the faster algorithm: [ determinant zero? ]
 : invertible-matrix? ( matrix -- ? )
     [ dimension first2 max <identity-matrix> ] keep
-    dup recip m. = ;
+    dup recip mdot = ;
 
 : linearly-independent-matrix? ( matrix -- ? ) ;
 
@@ -314,7 +314,7 @@ M: matrix recip
 ! this is the original definition of m^n as committed in 2012; it has not been lost
 : (m^n) ( m n -- n )
     make-bits over first length <identity-matrix>
-    [ [ dupd m. ] when [ dup m. ] dip ] reduce nip ;
+    [ [ dupd mdot ] when [ dup mdot ] dip ] reduce nip ;
 PRIVATE>
 
 ! A^-1 is the inverse but other negative powers are nonsense
diff --git a/extra/project-euler/common/common.factor b/extra/project-euler/common/common.factor
index 73dacb1d53..b4b3ffa9ca 100644
--- a/extra/project-euler/common/common.factor
+++ b/extra/project-euler/common/common.factor
@@ -162,7 +162,7 @@ PRIVATE>
 <PRIVATE
 
 : transform ( triple matrix -- new-triple )
-    [ 1array ] dip m. first ;
+    [ 1array ] dip mdot first ;
 
 PRIVATE>
 
diff --git a/extra/rosetta-code/conjugate-transpose/conjugate-transpose.factor b/extra/rosetta-code/conjugate-transpose/conjugate-transpose.factor
index b84a88e2f8..5f9e89746c 100644
--- a/extra/rosetta-code/conjugate-transpose/conjugate-transpose.factor
+++ b/extra/rosetta-code/conjugate-transpose/conjugate-transpose.factor
@@ -35,7 +35,7 @@ IN: rosetta-code.conjugate-transpose
     dup conj-t = ;
 
 : normal-matrix? ( matrix -- ? )
-    dup conj-t [ m. ] [ swap m. ] 2bi = ;
+    dup conj-t [ mdot ] [ swap mdot ] 2bi = ;
 
 : unitary-matrix? ( matrix -- ? )
-    [ dup conj-t m. ] [ length <identity-matrix> ] bi = ;
+    [ dup conj-t mdot ] [ length <identity-matrix> ] bi = ;
diff --git a/extra/rosetta-code/pythagorean-triples/pythagorean-triples.factor b/extra/rosetta-code/pythagorean-triples/pythagorean-triples.factor
index 4c591b0cc3..f42af54cf0 100644
--- a/extra/rosetta-code/pythagorean-triples/pythagorean-triples.factor
+++ b/extra/rosetta-code/pythagorean-triples/pythagorean-triples.factor
@@ -51,7 +51,8 @@ TUPLE: triplets-count primitives total ;
 
 : <0-triplets-count> ( -- a ) 0 0 \ triplets-count boa ;
 
-: next-triplet ( triplet T -- triplet' ) [ 1array ] [ m. ] bi* first ;
+: next-triplet ( triplet T -- triplet' )
+    [ 1array ] [ mdot ] bi* first ;
 
 : candidates-triplets ( seed -- candidates )
     ${ T1 T2 T3 } [ next-triplet ] with map ;