Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Software
CoPaR
Commits
305ac203
Commit
305ac203
authored
Nov 04, 2020
by
Bastian Kauschke
Browse files
compute... -> enumerate...
parent
44672224
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/Copar/Functors/AbsorbingPolynomial.hs
View file @
305ac203
...
...
@@ -268,7 +268,7 @@ instance MinimizationInterface f => MinimizationInterface (AbsorbingPolynomial f
updateInner
((
PolyLabel
i
Nothing
)
:|
ll
)
=
(
PolyLabel
i
Nothing
)
:
ll
innerLbls
=
map
$
\
(
PolyLabel
_
lbl
)
->
fromJust
lbl
innerFunctors
=
compu
teInnerFunctors
poly
innerFunctors
=
enumera
teInnerFunctors
poly
innerFunctor
::
Int
->
f
()
innerFunctor
i
=
case
innerFunctors
V
.!
i
of
...
...
@@ -305,7 +305,7 @@ instance (PrintMorphism f, Show1 f, Show (Label f), Show (F1 f)) => PrintMorphis
printMorphismPoint
(
()
<$
poly
)
f1'
(
V
.
toList
$
V
.
imap
convertFunctor
(
compu
teInnerFunctors
poly
))
(
V
.
toList
$
V
.
imap
convertFunctor
(
enumera
teInnerFunctors
poly
))
where
convertFunctor
::
Int
->
Inner
f
()
->
(
Label
Polynomial
,
Build
.
Builder
)
convertFunctor
v
(
Direct
()
)
=
(
v
,
snd
$
fromJust
(
find
(
\
(
PolyLabel
n
_
,
_
)
->
n
==
v
)
(
edges
)))
...
...
src/Copar/Functors/Polynomial.hs
View file @
305ac203
...
...
@@ -9,7 +9,7 @@
-- | Polynomial functor with co-products, products, exponentials and constants
module
Copar.Functors.Polynomial
(
compu
teInnerFunctors
(
enumera
teInnerFunctors
,
printPolynomial
-- * Types exported for easier testing
,
Polynomial
(
..
)
...
...
@@ -98,8 +98,8 @@ $(deriveEq1 ''Polynomial)
$
(
deriveShow1
''Factor
)
$
(
deriveShow1
''Polynomial
)
compu
teInnerFunctors
::
Polynomial
a
->
V
.
Vector
a
compu
teInnerFunctors
(
Polynomial
(
Sum
(
prods
)))
=
foldMap
products
prods
enumera
teInnerFunctors
::
Polynomial
a
->
V
.
Vector
a
enumera
teInnerFunctors
(
Polynomial
(
Sum
(
prods
)))
=
foldMap
products
prods
where
products
(
Product
(
fact
))
=
foldMap
factors
fact
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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