Skip to content

Instantly share code, notes, and snippets.

@reportbase
Created March 22, 2015 18:44
Show Gist options
  • Save reportbase/439e988917ee2a91d8ad to your computer and use it in GitHub Desktop.
Save reportbase/439e988917ee2a91d8ad to your computer and use it in GitHub Desktop.
Echo using printf
struct echo
{
void exec()(const float* a, int size)
{
for(int n = 0; n < size; ++n)
printf("%15d%15.5f\n", n, a[n]);
}
void exec()(const float* a, const float* b, int size)
{
for(int n = 0; n < size; ++n)
printf("%15d%15.5f%15.5f\n", n, a[n], b[n]);
}
void exec()(const float* a, const float* b, const float* c, int size)
{
for(int n = 0; n < size; ++n)
printf("%15d%15.5f%15.5f%15.5f\n", n, a[n], b[n], c[n]);
}
void exec()(const float* a, const float* b, const float* c, const float* d, int size)
{
for(int n = 0; n < size; ++n)
printf("%15d%15.5f%15.5f%15.5f%15.5f\n", n, a[n], b[n], c[n], d[n]);
}
void exec()(const float* a, const float* b, const float* c, const float* d, const float* e, int size)
{
for(int n = 0; n < size; ++n)
printf("%15d%15.5f%15.5f%15.5f%15.5f%15.5f\n", n, a[n], b[n], c[n], d[n], e[n]);
}
void exec()(const float* a, const float* b, const float* c, const float* d,
const float* e, const float* f, int size)
{
for(int n = 0; n < size; ++n)
printf("%15d%15.5f%15.5f%15.5f%15.5f%15.5f%15.5f\n", n, a[n], b[n], c[n], d[n], e[n], f[n]);
}
void exec()(const float* a, const float* b, const float* c, const float* d,
const float* e, const float* f, const float* g, int size)
{
for(int n = 0; n < size; ++n)
printf("%15d%15.5f%15.5f%15.5f%15.5f%15.5f%15.5f%15.5f\n", n, a[n], b[n], c[n], d[n], e[n], f[n], g[n]);
}
void exec()(const float* a, const float* b, const float* c, const float* d,
const float* e, const float* f, const float* g, const float* h, int size)
{
for(int n = 0; n < size; ++n)
printf("%15d%15.5f%15.5f%15.5f%15.5f%15.5f%15.5f%15.5f%15.5f\n",
n, a[n], b[n], c[n], d[n], e[n], f[n], g[n], h[n]);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment