Skip to content
Snippets Groups Projects
Commit 341b9704 authored by Martin Bauer's avatar Martin Bauer
Browse files

Updated n-phase test

parent da7adf35
No related merge requests found
......@@ -5,6 +5,7 @@ from typing import Mapping
from collections import Counter
import sympy as sp
import numpy as np
class DotDict(dict):
......@@ -87,6 +88,20 @@ def fully_contains(l1, l2):
return True
def boolean_array_bounding_box(boolean_array):
"""Returns bounding box around "true" area of boolean array"""
dim = len(boolean_array.shape)
bounds = []
for i in range(dim):
for j in range(dim):
if i != j:
arr_1d = np.any(boolean_array, axis=j)
begin = np.argmax(arr_1d)
end = begin + np.argmin(arr_1d[begin:])
bounds.append((begin, end))
return bounds
class LinearEquationSystem:
"""Symbolic linear system of equations - consisting of matrix and right hand side.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment