-
Notifications
You must be signed in to change notification settings - Fork 3
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
adjusted L8 to TP and TC #1
base: master
Are you sure you want to change the base?
Conversation
@@ -78,13 +73,11 @@ int[*] escapeTime( complex[*] plane, int depth) | |||
inline | |||
Color8::color[.,.] intArrayToMonochrome( int[.,.] a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add type patterns here as well?
Color8::color[n,m] intArrayToMonochrome( int[n,m] a)
@@ -69,13 +70,11 @@ inline int[*] escapeTime( complex[*] plane, int depth) | |||
inline | |||
Color8::color[.,.] intArrayToMonochrome( int[.,.] a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add type patterns here as well?
Color8::color[n,m] intArrayToMonochrome( int[n,m] a)
# | ||
# General Setup: | ||
# | ||
SAC2CFLAGS = -check ctb -v2 -O3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add -ecc
so that we don't get a warning:
Warning:
Option -check c implies option -ecc.
d = with { | ||
( .<= iv <= .) : clut[ a[ iv]]; | ||
} : genarray( shape(a), Color8::black()); | ||
return { iv -> clut[ a[ iv]] }; | ||
|
||
return( d); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return( d); needs to be deleted
} : genarray( shape( plane), toc(0)); | ||
|
||
return( times, values); | ||
return { iv -> escapeTimeAndValue (plane[iv]) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not compile for 3 reasons: parser cannot handle the implicated 2 return arguments, escapeTimeAndValue also needs depth, and iv will become an int[3] instead of int[2] as complex[m, n] is typedef'd to double[m, n, 2] currently. This works
escape, values = { iv -> escapeTimeAndValue (plane[iv], depth)
| iv < [m, n] };
return (escape, values);
I cannot compile mandelbrot.sac, giving
|
(. <= iv <= .): pic[ iv / stretch]; | ||
} : genarray( shape(pic) * stretch, black()); | ||
return( res); | ||
return { iv -> pic[ iv / stretch] | iv < shape(pic) * stretch }; | ||
} | ||
|
||
/* Main ******************************************************************** */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plane
does not have a fixed shape, as it increases during the do-while loop.
It is then used outside of this do-while loop in:
q, zoom_coords = getSelectionMulti( disp, [2,2]);
if (all( zoom_coords >= 0)) {
cmin = [plane[ zoom_coords[[0]]]] ++ cmin;
cmax = [plane[ zoom_coords[[1]]]] ++ cmax;
} else {
cmin = all( shape(cmin) > 1) ? drop( [1], cmin) : cmin;
cmax = all( shape(cmax) > 1) ? drop( [1], cmax) : cmax;
}
Which seems to be problematic.
Easiest fix would be to just recalculate plane
with the correct shape, it is relatively cheap anyways.
q, zoom_coords = getSelectionMulti( disp, [2,2]);
if (all( zoom_coords >= 0)) {
plane = genComplexArray(EXPAND * [YRES,XRES], cmin[0], cmax[0]);
cmin = [plane[ zoom_coords[[0]]]] ++ cmin;
cmax = [plane[ zoom_coords[[1]]]] ++ cmax;
} else {
cmin = all( shape(cmin) > 1) ? drop( [1], cmin) : cmin;
cmax = all( shape(cmax) > 1) ? drop( [1], cmax) : cmax;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
???? as you correctly noticed, this is outside the do-loop..... so plane should be at maximum size here anyways.... how can this be "problematic"????
inserted Type Patterns and used Tensor Comprehensions.