I'm pretty inexperienced in such things, but I'm trying to create a template function that evaluates an n- variable function with the argument "rotated" (see the example below) and returns a vector of all these values.
For example, for n = 3 with the function f (x, y, z), the returned triple \ vector should be
< f (x, 0,0), f (0, x, 0), f (0,0, x)>
The naive version of what I need may look like this (itβs not necessary to \ work correctly)
typedef FunctionSignature Function; template<class Function, size_t Dimensions> std::array<Function::Out,Dimensions> F(Function::InComponent x) { std::array<Function::Out,Dimensions> Result; for (i=0; i<Dimensions; i++) Result[i] = Function::f("rotate((x,0,...,0),i)"); return Result; }
But how to do a rotate thing.
I also hope that the for runtime can be eliminated in some way, since n well known at compile time.