GXVM class¶
- class GXVM(handle=0)[source]¶
GXVM class.
In-memory vector data methods The
GXVM
class will store vector (array) data in a memory buffer which can be accessed using theGXVM
methods. The main use for theGXVM
class is to store data in a single physical memory location. This memory can then be accessed by a user DLL using theGXGEO.get_ptr_vm
function defined in gx_extern.h.GXVM
memory can be any size, but aGXVM
is intended for handling relatively small sets of data compared to aGXVV
, which can work efficiently with very large volumes of data. The acceptable maximumGXVM
size depends on the operating system and the performance requirements of an application. The best performance is achieved when allGXVM
memory can be stored comfortably within the the available system RAM. If allGXVM
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 aGXVV
.See
GXVV
for methods to move data between aGXVM
and aGXVV
.- classmethod create(type, elements)[source]¶
Create a
GXVM
.- Parameters:
type (int) – GEO_VAR constants
elements (int) –
GXVM
length (less than 16777215)
- Returns:
GXVM
Object- Return type:
New in version 5.0.
License: Geosoft Open License
Note: The
GXVM
elements 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) –
GXVM
length (less than 16777215)
- Returns:
GXVM
Object- Return type:
New in version 6.4.2.
License: Geosoft Open License
Note: The
GXVM
elements are initialized to dummies.
- get_double(element)[source]¶
Get a real element from a
GXVM
.- Parameters:
element (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.
License: Geosoft Open License
- get_int(element)[source]¶
Get an integer element from a
GXVM
.- Parameters:
element (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.
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
GXVM
length.- 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
GXVM
size, 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
GXVM
length, theGXVM
length is increased. ReallocatingGXVM
lengths 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
GXVM
length, theGXVM
length is increased. ReallocatingGXVM
lengths 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
GXVM
length, theGXVM
length is increased. ReallocatingGXVM
lengths can lead to fragmented memory and should be avoided if possible.