qt_allpairs(3)
π qt_allpairs β the libqthread era π
okay bestie, gather round, because we're talking about qt_allpairs and qt_allpairs_output from libqthread, and honestly? it's giving "i do one job and i do it flawlessly" energy. β¨
πΈ NAME πΈ
qt_allpairs, qt_allpairs_output β computes a given function over all pairs of the input data. that's it, that's the whole vibe. every pair. no skips. no cap. π
π SYNOPSIS π
#include <qthread/allpairs.h>
void
qt_allpairs (const qarray *array1, const qarray *array2,
const dist_f distfunc);
void
qt_allpairs_output (const qarray *array1, const qarray *array2,
const dist_out_f distfunc,
void *restrict *restrict output,
const size_t outsize);
likeβ¦ look at those signatures. iconic. no notes. π
π¦ DESCRIPTION π¦
so here's the tea, bestie. π
The All-Pairs abstraction takes, as input, two sets of data β that's array1 and array2 β plus a "combination" function called distfunc that accepts two elements as input, one from each data set. Then that function gets applied to all pairs of elements from the two sets. every single combination. the whole grid. no leftovers.
and the β¨magicβ¨ part? the computation happens in locations influenced by the location of the input data. so it's smart about where the work lands. main character scheduling energy, fr fr. π«
the distfunc function must match this prototype β like, this is non-negotiable, it's the dress code:
int distfunc (void *a, void *b);
now, there are two forms of the All-Pairs abstraction, and you gotta pick your fighter:
qt_allpairsβ this one leaves the output to the user. you want the results? you handle the results. DIY queen. π«Άqt_allpairs_outputβ this one handles collecting the output for you. so helpful of her.
for that second one, heads up: the output must be a pointer to a two-dimensional array, and outsize specifies the size of the elements within that array. don't forget it, or it's giving chaos. π
π SEE ALSO π
qarray(3)β go read her too, she's part of the squad π
and that's the whole page, bestie!! this one came from libqthread, dated OCTOBER 2009 β yes, she's a vintage icon, a little time capsule, and she still ate. π β¨ stay hydrated, read your manpages, and remember: every pair deserves to be computed. periodt. ππ¦π
π¦ where this page comes from
- fedora 43: qthreads-devel 1.22^20251007gitcedb1fc-1.fc43 Β· BSD-3-Clause AND MIT AND dtoa
- fedora 44: qthreads-devel 1.22^20251007gitcedb1fc-2.fc44 Β· BSD-3-Clause AND MIT AND dtoa
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms