GXVM class¶
-
class
geosoft.gx.
GXVM
¶ In-memory vector data methods The VM class will store vector (array) data in a memory buffer which can be accessed using the VM methods. The main use for the VM class is to store data in a single physical memory location. This memory can then be accessed by a user DLL using the
geosoft.gx.GXGEO.get_ptr_vm()
function defined in gx_extern.h. VM memory can be any size, but a VM is intended for handling relatively small sets of data compared to a VV, which can work efficiently with very large volumes of data. The acceptable maximum VM size depends on the operating system and the performance requirements of an application. The best performance is achieved when all VM memory can be stored comfortably within the the available system RAM. If all VM memory will not fit in the system RAM, the operating system virtual memory manager will be used to swap memory to the operations systems virtual memory paging file. Note that the operating system virtual memory manager is much slower than the manager used by Geosoft when working with very large arrays in a VV. See VV for methods to move data between a VM and a VV.-
static
create
((GXContext)ctx, (int)arg1, (int)arg2) → GXVM:¶ Create a VM.
Parameters: - ctx (
geosoft.gx.GXContext
) – The GX execution context - arg1 (int) – GEO_VAR constants
- arg2 (int) – VM length (less than 16777215)
Returns: VM Object
Return type: New in version 5.0.0.
Note:
The VM elements are initialized to dummies.
- ctx (
-
static
create_ext
((GXContext)ctx, (int)arg1, (int)arg2) → GXVM:¶ Create a VM, using one of the GS_TYPES constants special data types.
Parameters: - ctx (
geosoft.gx.GXContext
) – The GX execution context - arg1 (int) – GS_TYPES constants
- arg2 (int) – VM length (less than 16777215)
Returns: VM Object
Return type: New in version 6.4.2.
Note:
The VM elements are initialized to dummies.
- ctx (
-
get_double
((int)arg1) → float:¶ Get a real element from a VM.
Parameters: arg1 (int) – element wanted Returns: Element wanted, or rDUMMY if the value is dummy or outside of the range of data. Return type: float New in version 5.0.0.
-
get_int
((int)arg1) → int:¶ Get an integer element from a VM.
Parameters: arg1 (int) – element wanted Returns: Element wanted, or iDUMMY if the value is dummy or outside of the range of data. Return type: int New in version 5.0.0.
-
get_string
((int)arg1, (str_ref)arg2) → None:¶ Get a string element from a VM.
Parameters: - arg1 (int) – element wanted
- arg2 (
geosoft.gx.str_ref
) – string in which to place element
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
Returns element wanted, or blank string if the value is dummy or outside of the range of data. Type conversions are performed if necessary. Dummy values are converted to "*" string.
-
is_null
() → bool¶ Check if the instance of
geosoft.gx.GXVM is null (undefined)
Returns: True if this is a null instance of geosoft.gx.GXVM
, False otherwise.Return type: bool`
-
length
() → int:¶ Returns current VM length.
Returns: # of elements in the VM. Return type: int New in version 5.0.0.
-
static
null
() → GXVM¶ A null (undefined) instance of
geosoft.gx.GXVM
Returns: A null geosoft.gx.GXVM
Return type: geosoft.gx.GXVM
-
re_size
((int)arg1) → None:¶ Re-set the size of a VM.
Parameters: arg1 (int) – new size (number of elements) Returns: Nothing Return type: None New in version 5.0.0.
Note:
If increasing the VM size, new elements are set to dummies.
-
set_double
((int)arg1, (float)arg2) → None:¶ Set a real element in a VM.
Parameters: - arg1 (int) – element to set
- arg2 (float) – value to set
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
Element being set cannot be < 0. If the element is > current VM length, the VM length is increased. Reallocating VM lengths can lead to fragmented memory and should be avoided if possible.
-
set_int
((int)arg1, (int)arg2) → None:¶ Set an integer element in a VM.
Parameters: - arg1 (int) – element to set
- arg2 (int) – value to set
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
Element being set cannot be < 0. If the element is > current VM length, the VM length is increased. Reallocating VM lengths can lead to fragmented memory and should be avoided if possible.
-
set_string
((int)arg1, (str)arg2) → None:¶ Set a string element in a VM.
Parameters: - arg1 (int) – element to set
- arg2 (str) – string to set
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
Element being set cannot be < 0. If the element is > current VM length, the VM length is increased. Reallocating VM lengths can lead to fragmented memory and should be avoided if possible.
-
static