addition: fixes for docs

This commit is contained in:
2026-05-07 11:04:51 -06:00
parent 1347adfcaa
commit ad1824246c
3 changed files with 38 additions and 21 deletions

3
.gitignore vendored
View File

@@ -55,3 +55,6 @@ rules.ninja
# Git # Git
COMMIT_MESSAGE COMMIT_MESSAGE
docs
docs/images

View File

@@ -22,18 +22,27 @@ set(CPM_DOWNLOAD_LOCATION
) )
if(NOT EXISTS ${CPM_DOWNLOAD_LOCATION}) if(NOT EXISTS ${CPM_DOWNLOAD_LOCATION})
message(STATUS "Downloading CPM.cmake...") message(STATUS "Downloading CPM.cmake...")
file( file(
DOWNLOAD DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake "https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake"
${CPM_DOWNLOAD_LOCATION} "${CPM_DOWNLOAD_LOCATION}"
STATUS download_status
) )
list(GET download_status 0 status_code)
if(NOT status_code EQUAL 0)
message(FATAL_ERROR
"Failed to download CPM.cmake"
)
endif()
endif() endif()
include(${CPM_DOWNLOAD_LOCATION}) include("${CPM_DOWNLOAD_LOCATION}")
include(cmake/CPM.cmake)
CPMAddPackage( CPMAddPackage(
NAME arraylist NAME arraylist

View File

@@ -5,23 +5,28 @@
int main(void) { int main(void) {
Graph *graph = graph_create(GRAPH_UNDIRECTED); Graph *graph = graph_create(GRAPH_UNDIRECTED);
graph_add_vertex(graph); graph_add_vertex(graph); // 0
graph_add_vertex(graph); graph_add_vertex(graph); // 1
graph_add_vertex(graph); graph_add_vertex(graph); // 2
graph_add_vertex(graph); graph_add_vertex(graph); // 3
graph_add_vertex(graph); graph_add_vertex(graph); // 4
graph_add_vertex(graph); graph_add_vertex(graph); // 5
graph_add_vertex(graph); // 6
graph_add_vertex(graph); // 7
graph_connect_vertex(graph, 0, 1, 9); graph_connect_vertex(graph, 0, 1, 5);
graph_connect_vertex(graph, 0, 2, 4); graph_connect_vertex(graph, 0, 2, 2);
graph_connect_vertex(graph, 1, 2, 2); graph_connect_vertex(graph, 1, 2, 1);
graph_connect_vertex(graph, 1, 4, 3); graph_connect_vertex(graph, 1, 3, 3);
graph_connect_vertex(graph, 1, 3, 7); graph_connect_vertex(graph, 1, 4, 12);
graph_connect_vertex(graph, 2, 3, 1); graph_connect_vertex(graph, 2, 3, 7);
graph_connect_vertex(graph, 2, 4, 6); graph_connect_vertex(graph, 2, 5, 10);
graph_connect_vertex(graph, 3, 4, 4); graph_connect_vertex(graph, 3, 4, 2);
graph_connect_vertex(graph, 3, 5, 8); graph_connect_vertex(graph, 3, 5, 6);
graph_connect_vertex(graph, 4, 5, 2); graph_connect_vertex(graph, 4, 6, 1);
graph_connect_vertex(graph, 5, 6, 3);
graph_connect_vertex(graph, 5, 7, 5);
graph_connect_vertex(graph, 6, 7, 2);
DijkstraResult result; DijkstraResult result;
graph_dijkstra(graph, 0, &result); graph_dijkstra(graph, 0, &result);