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
                  |
                  +--DoubleArray
                  |
                  +--FloatArray
                  |
                  +--HalfFloatArray
                  |
                  +--UnboxedIntegerArray

Package:
stx:libbasic
Category:
Collections-Arrayed
Version:
rev: 1.9 date: 2016/10/13 22:09:21
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)

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.1.0.0; WebServer 1.663 at exept.de:8081; Sat, 23 Mar 2019 08:37:28 GMT