Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jonas Plewinski
pystencils
Commits
341b9704
Commit
341b9704
authored
Dec 05, 2018
by
Martin Bauer
Browse files
Updated n-phase test
parent
da7adf35
Changes
1
Hide whitespace changes
Inline
Side-by-side
utils.py
View file @
341b9704
...
...
@@ -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.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment