math.vectors: rename "h." to "hdot"
parent
3bd9eadd9a
commit
5b0d28d055
|
@ -318,7 +318,7 @@ HELP: vdot
|
|||
{ $values { "u" { $sequence real } } { "v" { $sequence real } } { "x" real } }
|
||||
{ $description "Computes the dot product of two vectors." } ;
|
||||
|
||||
HELP: h.
|
||||
HELP: hdot
|
||||
{ $values { "u" { $sequence real } } { "v" { $sequence real } } { "x" real } }
|
||||
{ $description "Computes the Hermitian inner product of two vectors." } ;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ SPECIALIZED-ARRAY: int
|
|||
{ 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
|
||||
{ 1 } [ { C{ 0 1 } } dup hdot ] unit-test
|
||||
|
||||
{ { 1 2 3 } } [
|
||||
{ t t t } [ { 1 2 3 } ] [ { 4 5 6 } ] vif
|
||||
|
|
|
@ -220,8 +220,8 @@ M: object v?
|
|||
GENERIC: vdot ( u v -- x )
|
||||
M: object vdot [ * ] [ + ] 2map-reduce ; inline
|
||||
|
||||
GENERIC: h. ( u v -- x )
|
||||
M: object h. [ conjugate * ] [ + ] 2map-reduce ; inline
|
||||
GENERIC: hdot ( u v -- x )
|
||||
M: object hdot [ conjugate * ] [ + ] 2map-reduce ; inline
|
||||
|
||||
GENERIC: norm-sq ( v -- x )
|
||||
M: object norm-sq [ absq ] [ + ] map-reduce ; inline
|
||||
|
@ -294,4 +294,4 @@ PRIVATE>
|
|||
dupd proj v- ;
|
||||
|
||||
: angle-between ( v u -- a )
|
||||
[ normalize ] bi@ h. acos ;
|
||||
[ normalize ] bi@ hdot acos ;
|
||||
|
|
Loading…
Reference in New Issue