diff options
| author | Tyge Lovset <[email protected]> | 2023-06-08 06:55:42 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2023-06-08 06:55:42 +0200 |
| commit | abd3b4372dee2291a81271f02588228279139960 (patch) | |
| tree | b60b14a94e2c7f676ffe152174e6ba237e731e20 /misc | |
| parent | 2bac1dff09459ce55f6e6813af96f845a8c981a1 (diff) | |
| download | STC-modified-abd3b4372dee2291a81271f02588228279139960.tar.gz STC-modified-abd3b4372dee2291a81271f02588228279139960.zip | |
More small adjustments.
Diffstat (limited to 'misc')
| -rw-r--r-- | misc/benchmarks/plotbench/plot.py | 4 | ||||
| -rw-r--r-- | misc/examples/triples.c | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/misc/benchmarks/plotbench/plot.py b/misc/benchmarks/plotbench/plot.py index 0ba92264..e65631b7 100644 --- a/misc/benchmarks/plotbench/plot.py +++ b/misc/benchmarks/plotbench/plot.py @@ -12,8 +12,8 @@ df = df[df.Method != 'total'] if n > 0: df = df[df.Compiler == comp[n]] -g = sns.catplot(data=df, x='Method', y='Seconds', hue='Library', col='C', kind='bar', - ci=68, legend=False, col_wrap=2, sharex=False, aspect=1.4, height=3.1) +g = sns.catplot(data=df, x='Method', y='Seconds', hue='Library', col='C', kind='bar', orient='v', + errorbar=('ci', 68), legend=False, col_wrap=2, sharex=False, aspect=1.4, height=3.1) g.set_xlabels('') g.add_legend(bbox_to_anchor=(0.75, 0.2), borderaxespad=0.) diff --git a/misc/examples/triples.c b/misc/examples/triples.c index 06142916..17e3d40b 100644 --- a/misc/examples/triples.c +++ b/misc/examples/triples.c @@ -32,7 +32,7 @@ struct triples { int cco_state; }; -bool triples_coro(struct triples* t) { +void triples_coro(struct triples* t) { cco_routine(t) { t->count = 0; for (t->c = 5; t->size; ++t->c) { @@ -41,15 +41,14 @@ bool triples_coro(struct triples* t) { if ((int64_t)t->a*t->a + (int64_t)t->b*t->b == (int64_t)t->c*t->c) { if (t->count++ == t->size) cco_return; - cco_yield(false); + cco_yield(); } } } } - cco_final: + cco_final: puts("done"); } - return true; } int main() @@ -61,7 +60,8 @@ int main() struct triples t = {INT32_MAX}; int n = 0; - while (!triples_coro(&t)) { + while (!cco_done(&t)) { + triples_coro(&t); if (gcd(t.a, t.b) > 1) continue; if (t.c < 100) |
