GXVM class¶
- class GXVM(handle=0)[source]¶
GXVM class.
In-memory vector data methods The
GXVMclass will store vector (array) data in a memory buffer which can be accessed using theGXVMmethods. The main use for theGXVMclass is to store data in a single physical memory location. This memory can then be accessed by a user DLL using theGXGEO.get_ptr_vmfunction defined in gx_extern.h.GXVMmemory can be any size, but aGXVMis intended for handling relatively small sets of data compared to aGXVV, which can work efficiently with very large volumes of data. The acceptable maximumGXVMsize depends on the operating system and the performance requirements of an application. The best performance is achieved when allGXVMmemory can be stored comfortably within the the available system RAM. If allGXVMmemory 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 aGXVV.See
GXVVfor methods to move data between aGXVMand aGXVV.- classmethod create(type, elements)[source]¶
Create a
GXVM.- Parameters:
type (int) – GEO_VAR constants
elements (int) –
GXVMlength (less than 16777215)
- Returns:
GXVMObject- Return type:
New in version 5.0.
License: Geosoft Open License
Note: The
GXVMelements are initialized to dummies.
- classmethod create_ext(type, elements)[source]¶
Create a
GXVM, using one of the GS_TYPES constants special data types.- Parameters:
type (int) – GS_TYPES constants
elements (int) –
GXVMlength (less than 16777215)
- Returns:
GXVMObject- Return type:
New in version 6.4.2.
License: Geosoft Open License
Note: The
GXVMelements are initialized to dummies.
- get_double(element)[source]¶
Get a real element from a
GXVM.- Parameters:
element (int) – Element wanted
- Returns:
Element wanted, or
rDUMMYif the value is dummy or outside of the range of data.- Return type:
float
New in version 5.0.
License: Geosoft Open License
- get_int(element)[source]¶
Get an integer element from a
GXVM.- Parameters:
element (int) – Element wanted
- Returns:
Element wanted, or
iDUMMYif the value is dummy or outside of the range of data.- Return type:
int
New in version 5.0.
License: Geosoft Open License
- get_string(element, str_val)[source]¶
Get a string element from a
GXVM.- Parameters:
element (int) – Element wanted
str_val (str_ref) – String in which to place element
New in version 5.0.
License: Geosoft Open License
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()[source]¶
Check if this is a null (undefined) instance
- Returns:
True if this is a null (undefined) instance, False otherwise.
- Return type:
bool
- length()[source]¶
Returns current
GXVMlength.- Returns:
# of elements in the
GXVM.- Return type:
int
New in version 5.0.
License: Geosoft Open License
- re_size(newsize)[source]¶
Re-set the size of a
GXVM.- Parameters:
newsize (int) – New size (number of elements)
New in version 5.0.
License: Geosoft Open License
Note: If increasing the
GXVMsize, new elements are set to dummies.
- set_double(element, value)[source]¶
Set a real element in a
GXVM.- Parameters:
element (int) – Element to set
value (float) – Value to set
New in version 5.0.
License: Geosoft Open License
Note: Element being set cannot be < 0.
If the element is > current
GXVMlength, theGXVMlength is increased. ReallocatingGXVMlengths can lead to fragmented memory and should be avoided if possible.
- set_int(element, value)[source]¶
Set an integer element in a
GXVM.- Parameters:
element (int) – Element to set
value (int) – Value to set
New in version 5.0.
License: Geosoft Open License
Note: Element being set cannot be < 0.
If the element is > current
GXVMlength, theGXVMlength is increased. ReallocatingGXVMlengths can lead to fragmented memory and should be avoided if possible.
- set_string(element, value)[source]¶
Set a string element in a
GXVM.- Parameters:
element (int) – Element to set
value (str) – String to set
New in version 5.0.
License: Geosoft Open License
Note: Element being set cannot be < 0.
If the element is > current
GXVMlength, theGXVMlength is increased. ReallocatingGXVMlengths can lead to fragmented memory and should be avoided if possible.