ngn/k
19
63
Fork
You've already forked k
17

Odd behavior trying to scale a problem #75

Closed
opened 2024年01月24日 06:55:00 +01:00 by growler · 1 comment
Collaborator
Copy link

Not a great bug report, but I ran into something strange when trying to test error diffusion to scale.

Here is the code:

opts:0N,10*!21
pk:{x@*<{x|-x}x-y}
fs:{*|+{*|pr[x;*y;z]}[x]\[(&#*y;0N);y]}
pre:{+/y*0^z@(!#z)+/:|x}
pres:{({+/y*z@x-1}.*g;+/(pre.'1_g:+g@/:\:!g:(x[0;1];x[1])@\:=**x)@\:)}
spec:(0 0N 7;3 5 1)
l:(w:&0<spec)-*+&^spec
f:.[spec;]'+w
(ne;pr0):pres@(l;f)
fldrow:{(e,*y;(*|y),'(e:z-n;n:(*x)^pk[x]z:z+ne[*y]%16))}
pr:{fldrow[x]/[(,0.0;(!0;!0)); z+pr0[y]%16]}

I can run something like \t fs[0 1]@rws:700 1000#0.5 as many times as I like, but once I try to increase the dimensions by a factor of 10, not only does it fail, but I can't run this any more.

 \t fs[0 1]@rws:700 1000#0.5
903
 \t fs[0 1]@rws:700 1000#0.5
916
 \t fs[0 1]@rws:700 1000#0.5
910
 \t fs[0 1]@rws:7000 10000#0.5
'length
 {+/y*0^z@(!#z)+/:|x}
 ^
 {fldrow[x]/[(,0.0;(!0;!0)); z+pr0[y]%16]}
 ^
 {*|pr[x;*y;z]}
 ^
 {*|+{*|pr[x;*y;z]}[x]\[(&#*y;0N);y]}
 ^
 ..
 \t fs[0 1]@rws:700 1000#0.5
'length
 {+/y*0^z@(!#z)+/:|x}
 ^
 {fldrow[x]/[(,0.0;(!0;!0)); z+pr0[y]%16]}
 ^
 {*|pr[x;*y;z]}
 ^
 {*|+{*|pr[x;*y;z]}[x]\[(&#*y;0N);y]}
 ^
 ..

Interesting also that it fails relatively quickly. Even \t fs[0 1]@rws:6650 9500#0.5 doesn't fail, but it does take several minutes.

Not a great bug report, but I ran into something strange when trying to test error diffusion to scale. Here is the code: ``` opts:0N,10*!21 pk:{x@*<{x|-x}x-y} fs:{*|+{*|pr[x;*y;z]}[x]\[(&#*y;0N);y]} pre:{+/y*0^z@(!#z)+/:|x} pres:{({+/y*z@x-1}.*g;+/(pre.'1_g:+g@/:\:!g:(x[0;1];x[1])@\:=**x)@\:)} spec:(0 0N 7;3 5 1) l:(w:&0<spec)-*+&^spec f:.[spec;]'+w (ne;pr0):pres@(l;f) fldrow:{(e,*y;(*|y),'(e:z-n;n:(*x)^pk[x]z:z+ne[*y]%16))} pr:{fldrow[x]/[(,0.0;(!0;!0)); z+pr0[y]%16]} ``` I can run something like `\t fs[0 1]@rws:700 1000#0.5` as many times as I like, but once I try to increase the dimensions by a factor of 10, not only does it fail, but I can't run this any more. ``` \t fs[0 1]@rws:700 1000#0.5 903 \t fs[0 1]@rws:700 1000#0.5 916 \t fs[0 1]@rws:700 1000#0.5 910 \t fs[0 1]@rws:7000 10000#0.5 'length {+/y*0^z@(!#z)+/:|x} ^ {fldrow[x]/[(,0.0;(!0;!0)); z+pr0[y]%16]} ^ {*|pr[x;*y;z]} ^ {*|+{*|pr[x;*y;z]}[x]\[(&#*y;0N);y]} ^ .. \t fs[0 1]@rws:700 1000#0.5 'length {+/y*0^z@(!#z)+/:|x} ^ {fldrow[x]/[(,0.0;(!0;!0)); z+pr0[y]%16]} ^ {*|pr[x;*y;z]} ^ {*|+{*|pr[x;*y;z]}[x]\[(&#*y;0N);y]} ^ .. ``` Interesting also that it fails relatively quickly. Even `\t fs[0 1]@rws:6650 9500#0.5` doesn't fail, but it does take several minutes.
Author
Collaborator
Copy link

Doesn’t fail quickly anymore.

Doesn’t fail quickly anymore.
Sign in to join this conversation.
No Branch/Tag specified
master
pages
No results found.
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ngn/k#75
Reference in a new issue
ngn/k
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?