A chunk of fast "alchemy memory" for storing IEEE 754 double-precision floating point numbers.

Constructor

new (size:Int, ?name:String)

Creates a byte array capable of storing a total of size doubles.

Variables

read onlysize:Int

The size measured in doubles.

Methods

clone ():DoubleMemory

Creates a deep copy of this object.

inline get (i:Int):Float

Returns the double at index i.

inline getAddr (i:Int):Int

Returns the memory byte offset of the first byte storing the double at index i.

resize (newSize:Int):Void

Adjusts the size of this object so it's capable of storing newSize doubles.

inline set (i:Int, x:Float):Void

Replaces the double at the index i with the double x.

setAll (x:Float):DoubleMemory

Sets all doubles to the value x.

inline swap (i:Int, j:Int):Void

Swaps the double at index i with the double at index j.

toString ():String

Prints out all elements.

Static methods

staticofArray (input:Array<Float>, ?min:Int, ?max:Int):DoubleMemory

Converts input in the range [min, max] to a DoubleMemory object. If no range is specified, all input values are copied.

Parameters:

min

index pointing to the first double.

max

index pointing to the last double.

staticofByteArray (input:ByteArray, ?min:Int, ?max:Int):DoubleMemory

Converts input in the range [min, max] to a DoubleMemory object. If no range is specified, all input bytes are copied.

Parameters:

min

index pointing to the byte storing the first double.

min

index pointing to the byte storing the last double.

staticofBytesData (input:BytesData, ?min:Int, ?max:Int):DoubleMemory

Converts input in the range [min, max] to a DoubleMemory object. If no range is specified, all input` bytes are copied.

Parameters:

min

index pointing to the byte storing the first float.

min

index pointing to the byte storing the last float.

staticofVector (input:Vector<Float>, ?min:Int, ?max:Int):DoubleMemory

Converts input in the range [min, max] to a DoubleMemory object. If no range is specified, all input values are copied.

Parameters:

min

index pointing to the first double.

max

index pointing to the last double.

statictoArray (input:DoubleMemory, ?min:Int, ?max:Int):Array<Float>

Converts input in the range [min, max] to an array. If no range is specified, all input bytes are copied.

Parameters:

min

index pointing to the first double.

max

index pointing to the last double.

statictoByteArray (input:DoubleMemory, ?min:Int, ?max:Int):ByteArray

Converts input in the range [min, max] to a byte array. If no range is specified, all input bytes are copied. The bytes are written in little endian format.

Parameters:

min

index pointing to the first double.

max

index pointing to the last double.

statictoBytesData (input:DoubleMemory, ?min:Int, ?max:Int):BytesData

Converts input in the range [min, max] to a BytesData object. If no range is specified, all input bytes are copied.

Parameters:

min

index pointing to the first double.

max

index pointing to the last double.

statictoVector (input:DoubleMemory, ?min:Int, ?max:Int, ?out:Vector<Float>):Vector<Float>

Converts input in the range [min, max] to a vector object. If no range is specified, all input bytes are copied.

Parameters:

min

index pointing to the first double.

max

index pointing to the last double.

out

the Vector object to write into. If null, a new Vector object is created on-the-fly.

Inherited Variables

Defined by MemoryAccess

read onlybytes:Int

The number of allocated bytes.

read onlykey:Int

A unique identifier for this object. A hash table transforms this key into an index of an array element by using a hash function.

name:String

read onlyoffset:Int

The memory offset in bytes.

Inherited Methods