
Class: FloatArray
Object

+Collection

+SequenceableCollection

+ArrayedCollection

+UninterpretedBytes

+AbstractNumberVector

+FloatArray
 Package:
 stx:libbasic
 Category:
 CollectionsArrayed
 Version:
 rev:
1.44
date: 2017/09/18 08:48:44
 user: sr
 file: FloatArray.st directory: libbasic
 module: stx stcclassLibrary: libbasic
 Author:
 Claus Gittinger
FloatArrays store floats (and nothing else).
They have been added to support heavy duty number crunching and
data exchange with openGL frameworks and other mass data libraries.
See documentation in DoubleArray for more information.
[memory requirements:]
OBJHEADER + (size * floatsize)
DoubleArray
Array
queries

elementByteSize

for bitlike containers, return the number of bytes stored per element.
Here, 4 is returned
copying

clone

return a copy of the receiver

copyFrom: start to: stop

return a partial copy of the receiver

replaceFrom: start to: stop with: aCollection startingAt: replStart

f1 f2
f1 := (1 to:5) asFloatArray.
f2 := #(10 9 8 7 6) asFloatArray.
f1 replaceFrom:1 to:3 with:f2 startingAt:3
destructive arithmetic support

primAbs

destructive absolute value of each element

primAddArray: floatArray

add the vector argument into the receiver (destructive).
The argument must be another vector

primAddScalar: aScalar

add the scalar argument into the receiver (destructive).

primDivArray: floatArray

divide the vector argument into the receiver (destructive).
The argument must be another vector

primDivScalar: aScalar

divide the scalar argument into the receiver (destructive).

primMulArray: floatArray

multiply the vector argument into the receiver (destructive).
The argument must be another vector

primMulScalar: aScalar

multiply the scalar argument into the receiver (destructive).

primNegated

destructive negative value of each element

primSubtractArray: floatArray

subtract the vector argument from the receiver (destructive).
The argument must be another vector

primSubtractScalar: aScalar

subtract the scalar argument from the receiver (destructive).
queries

defaultElement


isValidElement: anObject

return true, if I can hold this kind of object

minMax

return a Tuple holding the smallest and largest element;
redefined for speed

numFloats

vector arithmetic

dot: aFloatVector

Return the dot product of the receiver and the argument.
Raises an error, if the argument is not of the same size as the receiver.

hornerMultiplyAndAdd: x

primitive support for horner'smethod computation of polynomials.
The vector is interpreted as providing the factors for a polynomial,
an*x^n + (an1)*x^(n1) + ... + a2(x) + a1
where the ai are the elements of the Array.
The highest rank factor is at the first position, the 0rank constant at last.
This is inlined ccode, which may get compiled to fast machine code,
using multiplyandadd or vector instructions, if the CPU/Compiler support them.
