Compare commits

..

2 Commits

Author SHA1 Message Date
Nina Chlóe Kassandra Reiß 4fa5426a15 Add flake
Alire installation and checkup / build (ubuntu-20.04) (push) Failing after 5m45s
2026-07-18 21:35:06 +02:00
Nina Chlóe Kassandra Reiß e1f7097bc3 Warshall algorithm reference 2026-07-18 21:34:45 +02:00
2 changed files with 91 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
"""
File: adj2con.py
Author: Nina Chloe Kassandra Reiß <nina.reiss@nickr.eu>
Created on: Sa 18. Jul 11:30:03 CEST 2026
Description: Turn adjacency matrices into boolean connectivity matrix
"""
adjacency = [[1, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 1, 0], [0, 0, 0, 1, 0, 0], [0, 0, 0, 1, 1, 0]]
def warshall(adj):
n = len(adj)
# Kopie erzeugen
R = [row[:] for row in adj]
# Jeder Knoten ist von sich selbst erreichbar
for i in range(n):
R[i][i] = 1
for k in range(n):
for i in range(n):
for j in range(n):
R[i][j] = R[i][j] or (R[i][k] and R[k][j])
return R
print(warshall(adjacency))
+61
View File
@@ -0,0 +1,61 @@
{
description = "Ada development environment with Alire";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
};
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [
# Ada
gnat
gprbuild
alire
# Toolchain
gcc
binutils
# Build Tools
gnumake
cmake
pkg-config
# Debugging
gdb
# Utilities
git
which
file
];
shellHook = ''
export ADA_PROJECT_PATH="$PWD''${ADA_PROJECT_PATH:+:$ADA_PROJECT_PATH}"
echo "Ada + Alire development shell"
echo "--------------------------------"
command -v alr >/dev/null && alr --version
command -v gnat >/dev/null && gnat --version | head -n1
command -v gprbuild >/dev/null && gprbuild --version | head -n1
'';
};
}
);
}