
Class: AbstractNumberVector
Object

+Collection

+SequenceableCollection

+ArrayedCollection

+UninterpretedBytes

+AbstractNumberVector

+ComplexDoubleArray

+ComplexFloatArray

+UnboxedFloatArray

+UnboxedIntegerArray
 Package:
 stx:libbasic
 Category:
 CollectionsArrayed
 Version:
 rev:
1.11
date: 2019/03/24 11:29:29
 user: cg
 file: AbstractNumberVector.st directory: libbasic
 module: stx stcclassLibrary: libbasic
abstract superclass for all direct storing number vector classes
(float, double, integer arrays)
Mostly to share double dispatch code.
IntegerArray
FloatArray
DoubleArray
ByteArray
(and many others)
queries

isAbstract

Return if this class is an abstract class.
True is returned here for myself only; false for subclasses.
Abstract subclasses must redefine this again.

maxVal

the maximum value which can be stored in instances of me
** This method raises an error  it must be redefined in concrete classes **

minVal

the minimum value which can be stored in instances of me
** This method raises an error  it must be redefined in concrete classes **
arithmetic

* anObject

return the product of the receiver and the argument.
The argument may either be a scalar or another vector
usage example(s):
#(1 2 3 4) asFloatArray * 3
#(1 2 3 4) asFloatArray * #(1 2 3 4) asFloatArray


+ anObject

return the sum of the receiver and the argument.
The argument may either be a scalar or another vector
usage example(s):
#(1 2 3 4) asFloatArray + 3
#(1 2 3 4) asFloatArray + #(1 2 3 4) asFloatArray


 anObject

return the difference of the receiver and the argument.
The argument may either be a scalar or another vector
usage example(s):
#(1 2 3 4) asFloatArray  3
#(1 2 3 4) asFloatArray  #(1 2 3 4) asFloatArray


/ anObject

return the division of the receiver and the argument.
The argument may either be a scalar or another vector
usage example(s):
#(1 2 3 4) asFloatArray / 3
#(1 2 3 4) asFloatArray / #(1 2 3 4) asFloatArray


abs

return a new vector containing absolute values.
The receiver is unchanged
usage example(s):
#( 1 2 3 4 5 6 7 8) abs.
#( 1 2 3 4 5 6 7 8) asFloatArray abs.


negated

return a new vector containing negated values.
The receiver is unchanged
usage example(s):
#( 1 2 3 4 5 6 7 8) negated.
#( 1 2 3 4 5 6 7 8) asFloatArray negated.

arithmetic destructive

*= anObject

multiply the argument into the receiver (destructive).
The argument may either be a scalar or another vector

+= anObject

add the argument into the receiver (destructive).
The argument may either be a scalar or another vector

= anObject

subtract the argument from the receiver (destructive).
The argument may either be a scalar or another vector

/= anObject

divide the argument into the receiver (destructive).
The argument may either be a scalar or another vector
destructive arithmetic support

primAbs

low performance fall back: destructive replace each element by its absolute value.
May be redefined in subclasses to use vector instructions

primAddArray: anArray

low performance fallback: destructively add the vector argument into the receiver.
The argument must be another vector.
May be redefined in subclasses to use vector instructions

primAddScalar: aScalar

low performance fallback: destructively add the scalar argument into the receiver.
May be redefined in subclasses to use vector instructions

primDivArray: floatArray

low performance fallback: destructively divide the vector argument into the receiver.
The argument must be another vector.
May be redefined in subclasses to use vector instructions

primDivScalar: aScalar

low performace fallback: destructively divide each element of the receiver
by the scalar argument.
May be redefined in subclasses to use vector instructions

primMulArray: floatArray

low performance fallback: destructively multiply the vector argument into the receiver.
The argument must be another vector.
May be redefined in subclasses to use vector instructions

primMulScalar: aScalar

low performace fallback: destructively multiply each element of the receiver
by the scalar argument.
May be redefined in subclasses to use vector instructions

primNegated

low performance fallback: destructively negative value of each element.
May be redefined in subclasses to use vector instructions

primSubtractArray: floatArray

low performance fallback: destructively subtract the vector argument into the receiver.
The argument must be another vector.
May be redefined in subclasses to use vector instructions

primSubtractScalar: aScalar

low performace fallback: destructively subtract the scalar argument
from each element of the receiver.
May be redefined in subclasses to use vector instructions
queries

absMax

return the largest absolute value
vector arithmetic

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 ndimensional space represented by the receiver).
Obsolete: the name 'length' may lead to confusion.
therefore renamed to vectorLength
** This is an obsolete interface  do not use it (it may vanish in future versions) **

squaredLength

Return the squared length of the receiver interpreted as vector.
Obsolete: the name 'squaredLength' may lead to confusion.
therefore renamed to squaredVectorLength
** This is an obsolete interface  do not use it (it may vanish in future versions) **
