#DOCUMENTATION
authorClaus Gittinger <cg@exept.de>
Fri, 15 Jan 2016 13:02:36 +0100
changeset 19029 0b7682f30ead
parent 19028 483e4c9cdaf7
child 19030 688b462a4941
#DOCUMENTATION class: AbstractNumberVector removed: #dot: changed: #length #squaredLength
AbstractNumberVector.st
--- a/AbstractNumberVector.st	Fri Jan 15 13:02:19 2016 +0100
+++ b/AbstractNumberVector.st	Fri Jan 15 13:02:36 2016 +0100
@@ -11,6 +11,8 @@
 "
 "{ Package: 'stx:libbasic' }"
 
+"{ NameSpace: Smalltalk }"
+
 UninterpretedBytes subclass:#AbstractNumberVector
 	instanceVariableNames:''
 	classVariableNames:''
@@ -383,54 +385,38 @@
 
 !AbstractNumberVector methodsFor:'vector arithmetic'!
 
-dot:aFloatVector
-    "Return the dot product of the receiver and the argument.
-     Fail if the argument is not of the same size as the receiver."
-
-    |mySize result|
-
-    mySize := self size.
-    mySize = aFloatVector size ifFalse:[^self error:'Must be of equal size'].
-    result := 0.0.
-    1 to: mySize do:[:i|
-        result := result + ((self at: i) * (aFloatVector at: i)).
-    ].
-    ^result
-
-    "
-     |v|
-
-     v := #(2.0 2.0 1.0) asDoubleArray.
-     v dot:v.            
-    "
-!
-
 length
     "Return the length of the receiver interpreted as vector
      (that is the length of the vector from 0.0 @ 0.0 @ ... @ 0.0
-      to the point in the n-dimensional space represented by the receiver)"
+      to the point in the n-dimensional space represented by the receiver).
+     Obsolete: the name 'length' may lead to confusion.
+               therefore renamed to vectorLength"
 
-    ^ self squaredLength sqrt
+    self obsoleteMethodWarning:'use vectorLength'.
+    ^ self squaredVectorLength sqrt
 
     "
-     #(10.0 10.0) asFloatArray length
-     #(10.0 10.0 10.0) asFloatArray length
+     #(10.0 10.0) asFloatArray vectorLength
+     #(10.0 10.0 10.0) asFloatArray vectorLength
     "
 !
 
 squaredLength
-    "Return the squared length of the receiver interpreted as vector"
+    "Return the squared length of the receiver interpreted as vector.
+     Obsolete: the name 'squaredLength' may lead to confusion.
+               therefore renamed to squaredVectorLength"
 
+    self obsoleteMethodWarning:'use squaredVectorLength'.
     ^ self dot: self
 ! !
 
 !AbstractNumberVector class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/AbstractNumberVector.st,v 1.5 2014-12-08 17:29:27 cg Exp $'
+    ^ '$Header$'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/AbstractNumberVector.st,v 1.5 2014-12-08 17:29:27 cg Exp $'
+    ^ '$Header$'
 ! !