GXVM class

class GXVM(handle=0)

GXVM class.

In-memory vector data methods The GXVM class will store vector (array) data in a memory buffer which can be accessed using the GXVM methods. The main use for the GXVM class is to store data in a single physical memory location. This memory can then be accessed by a user DLL using the GXGEO.get_ptr_vm function defined in gx_extern.h. GXVM memory can be any size, but a GXVM is intended for handling relatively small sets of data compared to a GXVV, which can work efficiently with very large volumes of data. The acceptable maximum GXVM size depends on the operating system and the performance requirements of an application. The best performance is achieved when all GXVM memory can be stored comfortably within the the available system RAM. If all GXVM 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 GXVV.

See GXVV for methods to move data between a GXVM and a GXVV.

classmethod create(type, elements)

Create a GXVM.

Parameters:
Returns:

GXVM Object

Return type:

GXVM

New in version 5.0.

License: Geosoft Open License

Note: The GXVM elements are initialized to dummies.

classmethod create_ext(type, elements)

Create a GXVM, using one of the GS_TYPES constants special data types.

Parameters:
Returns:

GXVM Object

Return type:

GXVM

New in version 6.4.2.

License: Geosoft Open License

Note: The GXVM elements are initialized to dummies.

get_double(element)

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)

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)

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()

Check if this is a null (undefined) instance

Returns:True if this is a null (undefined) instance, False otherwise.
Return type:bool
length()

Returns current GXVM length.

Returns:# of elements in the GXVM.
Return type:int

New in version 5.0.

License: Geosoft Open License

classmethod null()

A null (undefined) instance of GXVM

Returns:A null GXVM
Return type:GXVM
re_size(newsize)

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)

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, the GXVM length is increased. Reallocating GXVM lengths can lead to fragmented memory and should be avoided if possible.

set_int(element, value)

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, the GXVM length is increased. Reallocating GXVM lengths can lead to fragmented memory and should be avoided if possible.

set_string(element, value)

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, the GXVM length is increased. Reallocating GXVM lengths can lead to fragmented memory and should be avoided if possible.