New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve junctions to store only unique eigenstates. #401
Comments
From @bacekHello. There is attached patch which uniquefy stored eigenstates in -- |
From @bacekjunction_uniq.patchdiff --git a/languages/perl6/src/classes/Junction.pir b/languages/perl6/src/classes/Junction.pir
index 5008892..9ae14e9 100644
--- a/languages/perl6/src/classes/Junction.pir
+++ b/languages/perl6/src/classes/Junction.pir
@@ -217,6 +217,12 @@ Return the components of the Junction.
setattribute junc, '@!eigenstates', eigenstates
.return (junc)
.end
+
+.sub '!UNIQUEFY'
+ .param pmc eigenstates :slurpy
+ $P0 = get_hll_global 'infix:==='
+ .return eigenstates.'uniq'($P0)
+.end
.sub '!DISPATCH_JUNCTION'
.param pmc the_sub
@@ -292,11 +298,13 @@ Return the components of the Junction.
.sub 'any'
.param pmc args :slurpy
args.'!flatten'()
+ args = '!UNIQUEFY'(args)
.tailcall '!MAKE_JUNCTION'(JUNCTION_TYPE_ANY, args)
.end
.sub 'infix:|'
.param pmc args :slurpy
+ args = '!UNIQUEFY'(args)
.tailcall '!MAKE_JUNCTION'(JUNCTION_TYPE_ANY, args)
.end
@@ -325,11 +333,13 @@ Return the components of the Junction.
.sub 'all'
.param pmc args :slurpy
args.'!flatten'()
+ args = '!UNIQUEFY'(args)
.tailcall '!MAKE_JUNCTION'(JUNCTION_TYPE_ALL, args)
.end
.sub 'infix:&'
.param pmc args :slurpy
+ args = '!UNIQUEFY'(args)
.tailcall '!MAKE_JUNCTION'(JUNCTION_TYPE_ALL, args)
.end
@@ -342,6 +352,7 @@ Return the components of the Junction.
.sub 'none'
.param pmc args :slurpy
args.'!flatten'()
+ args = '!UNIQUEFY'(args)
.tailcall '!MAKE_JUNCTION'(JUNCTION_TYPE_NONE, args)
.end
|
From @pmichaudI'd like to get a clarification from p6l as to whether junction states Also, it seems like it would be better to make the list unique inside of Thanks! Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @bacekPatrick R. Michaud via RT wrote:
Revised patch attached. -- |
From @bacekjunction_uniq2.patchdiff --git a/languages/perl6/src/classes/Junction.pir b/languages/perl6/src/classes/Junction.pir
index 5008892..fbc7b40 100644
--- a/languages/perl6/src/classes/Junction.pir
+++ b/languages/perl6/src/classes/Junction.pir
@@ -214,10 +214,16 @@ Return the components of the Junction.
$P0 = get_hll_global 'Junction'
junc = $P0.'new'()
setattribute junc, '$!type', type
+
+ # Uniquefy eigenstates if possible
+ if type == JUNCTION_TYPE_ONE goto set_eugenstates
+ $P0 = get_hll_global 'infix:==='
+ eigenstates = eigenstates.'uniq'($P0)
+ set_eugenstates:
setattribute junc, '@!eigenstates', eigenstates
.return (junc)
.end
-
+
.sub '!DISPATCH_JUNCTION'
.param pmc the_sub
.param pmc args :slurpy
|
From @pmichaudAfter getting confirmation from p6l... Applied in r32625, thanks! Pm |
@pmichaud - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#60444 (status was 'resolved')
Searchable as RT60444$
The text was updated successfully, but these errors were encountered: