For n\in\mathbf{N} use n = \{0,1,\ldots,n-1\}.
Define n\colon\mathbf{Z}\to n by m\mapsto \mod(m,n).
x\in\mathbf{R}^n is a function n\to\mathbf{R}. x\%n\colon\mathbf{Z}\to\mathbf{R} so x\%n\in\mathbf{R}^\mathbf{Z}.
f\colon\Prod_{i\in I} X_i \to \Prod Y_{j\in J}
Notation for index maps \Prod_{i\in I} X_i) \to \Prod Y_{j\in J}
readdir - functions (x–), inputs (-r), outputs (-w)
attr - functions: signature (name: type) inputs: n-dim homogeneous array outputs: n-dim homogeneous array determined by function and inputs
$ ls -l
-x-- black
--r- forward
--r- vol
--r- strike
--rw value
$ cat forward
100
$ cat vol
$ 0.1
$ cat strike
100
$ black
$ cat value
3.9...
If no ouputs use memfd_create to assign a name to the ouput.
Layout: | n | d[0] | … | d[n-1] | x[0] | … | x[d[0] * … * d[n-1] - 1] |
// x[i0][i1]...
size_t index(size_t n, const size_t* d, const size_t* i)
{
size_t ind = 0;
if (size_t i = 0; i < n; ++i) {
ind = d[0] +
}
return ind;
}
// black.cpp
double black(double f, double s, double k)
{
double x = moneyness(f, s, k);
return k*P(x) - f*P(x + s);
}
int main(int ac, const char* av)
{
// if forward, vol, strike not in cwd get from command line
// `black f - k ` looks for vol
// if value not in cwd set up memory mapped file
}