Skip to content

Commit

Permalink
Replace the internal Fibonacci heap with a 4-ary priority queue (#374)
Browse files Browse the repository at this point in the history
* Default to using memory-only mode for matrices
* Enable Numpy API version macro and language level 3
* Replace Fibonacci heap with 4-ary heap written by François Pacull.

Change the Dijkstra's implementation to make use of this new heap.
Originally written by François Pacull.

Co-authored-by: djfrancesco <pacullfrancois@gmail.com>
Co-authored-by: chrisobi02 <chrisgobrien02@gmail.com>
Co-authored-by: Jamie Cook <jimi.cook@gmail.com>
Co-authored-by: Pedro Camargo <c@margo.co>
  • Loading branch information
5 people committed Jan 12, 2023
1 parent 85d2a7d commit 7c2beb6
Show file tree
Hide file tree
Showing 48 changed files with 388 additions and 268 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
python-version: 3.9
- name: Install dependencies
run: |
sudo apt update
python -m pip install --upgrade pip
pip install wheel openmatrix
pip install -r requirements.txt
pip install -r requirements_additional.txt
pip install -r docs/requirements-docs.txt
python -m pip install sphinx-gallery --user
sudo apt update
sudo apt install libsqlite3-mod-spatialite
sudo apt install -y libspatialite-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/mod_spatialite.so /usr/lib/x86_64-linux-gnu/mod_spatialite
Expand Down
10 changes: 5 additions & 5 deletions aequilibrae/matrix/aequilibrae_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __init__(self):
self.description = ""
self.current_index = None
self.__omx = False
self.__memory_only = False
self.__memory_only = True
self.omx_file = None # type: omx.File
self.__version__ = VERSION # Writes file version

Expand Down Expand Up @@ -128,7 +128,7 @@ def create_empty(
data_type: np.dtype = np.float64,
index_names: List[str] = None,
compressed: bool = False,
memory_only: bool = False,
memory_only: bool = True,
):
"""
Creates an empty matrix in the AequilibraE format
Expand Down Expand Up @@ -257,7 +257,7 @@ def create_from_omx(
mappings: List[str] = None,
robust: bool = True,
compressed: bool = False,
memory_only: bool = False,
memory_only: bool = True,
) -> None:
"""
Creates an AequilibraeMatrix from an original OpenMatrix
Expand Down Expand Up @@ -759,7 +759,7 @@ def export(self, output_name: str, cores: List[str] = None):
cores = self.names

if file_extension == ".AEM":
self.copy(output_name=output_name, cores=cores)
self.copy(output_name=output_name, cores=cores, memory_only=False)

elif file_extension == ".OMX":
omx_export = omx.open_file(output_name, "w")
Expand Down Expand Up @@ -880,7 +880,7 @@ def copy(
cores: List[str] = None,
names: List[str] = None,
compress: bool = None,
memory_only: bool = False,
memory_only: bool = True,
):
"""
Copies a list of cores (or all cores) from one matrix file to another one
Expand Down
2 changes: 1 addition & 1 deletion aequilibrae/paths/AoN.pyx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cython: language_level=3
import os

# cython: language_level=3
cimport numpy as np
from libcpp cimport bool

Expand Down
Loading

0 comments on commit 7c2beb6

Please sign in to comment.