Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
pystencils
Commits
341b9704
Commit
341b9704
authored
6 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
Updated n-phase test
parent
da7adf35
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils.py
+15
-0
15 additions, 0 deletions
utils.py
with
15 additions
and
0 deletions
utils.py
+
15
−
0
View file @
341b9704
...
@@ -5,6 +5,7 @@ from typing import Mapping
...
@@ -5,6 +5,7 @@ from typing import Mapping
from
collections
import
Counter
from
collections
import
Counter
import
sympy
as
sp
import
sympy
as
sp
import
numpy
as
np
class
DotDict
(
dict
):
class
DotDict
(
dict
):
...
@@ -87,6 +88,20 @@ def fully_contains(l1, l2):
...
@@ -87,6 +88,20 @@ def fully_contains(l1, l2):
return
True
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
:
class
LinearEquationSystem
:
"""
Symbolic linear system of equations - consisting of matrix and right hand side.
"""
Symbolic linear system of equations - consisting of matrix and right hand side.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment