eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'AbstractNumberVector':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: AbstractNumberVector


Inheritance:

   Object
   |
   +--Collection
      |
      +--SequenceableCollection
         |
         +--ArrayedCollection
            |
            +--UninterpretedBytes
               |
               +--AbstractNumberVector
                  |
                  +--ComplexDoubleArray
                  |
                  +--ComplexFloatArray
                  |
                  +--UnboxedFloatArray
                  |
                  +--UnboxedIntegerArray

Package:
stx:libbasic
Category:
Collections-Arrayed
Version:
rev: 1.11 date: 2019/03/24 11:29:29
user: cg
file: AbstractNumberVector.st directory: libbasic
module: stx stc-classLibrary: libbasic

Description:


abstract superclass for all direct storing number vector classes
(float, double, integer arrays)

Mostly to share double dispatch code.


Related information:

    IntegerArray
    FloatArray
    DoubleArray
    ByteArray
    (and many others)

Class protocol:

queries
o  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.

o  maxVal
the maximum value which can be stored in instances of me

** This method raises an error - it must be redefined in concrete classes **

o  minVal
the minimum value which can be stored in instances of me

** This method raises an error - it must be redefined in concrete classes **


Instance protocol:

arithmetic
o  * 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

o  + 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

o  - 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

o  / 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

o  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. 

o  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
o  *= anObject
multiply the argument into the receiver (destructive).
The argument may either be a scalar or another vector

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

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

o  /= anObject
divide the argument into the receiver (destructive).
The argument may either be a scalar or another vector

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

o  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

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

o  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

o  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

o  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

o  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

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

o  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

o  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
o  absMax
return the largest absolute value

vector arithmetic
o  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).
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) **

o  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) **



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 25 Apr 2024 16:00:24 GMT