1.6. Utilities
1.6.1. Containers
Raysect has a number of container classes available for fast operations in cython. These are mainly intended for use by developers.
- class raysect.core.containers.LinkedList
Basic implementation of a Linked List for fast container operations in cython.
- Parameters:
initial_items (object) – Optional iterable for initialising container.
- Variables:
length (int) – number of items in the container
first – starting element of container
last – final element of container
- add(value)
Add an item to the end of the container.
- Parameters:
value (object) – The item to add to the end of the container.
- add_items(iterable)
Extend this container with another iterable container.
- Parameters:
iterable (object) – Iterable object such as a list or ndarray with which to extend this container.
- get_index(index)
Get the item from the container at specified index.
- Parameters:
index (int) – requested item index
- insert(value, index)
Insert an item at the specified index.
- is_empty()
Returns True if the container is empty.
- class raysect.core.containers.Stack
Bases:
LinkedListBasic implementation of a Stack container for fast container operations in cython. Inherits attributes and methods from LinkedList.
- class raysect.core.containers.Queue
Bases:
LinkedListBasic implementation of a Queue container for fast container operations in cython. Inherits attributes and methods from LinkedList.