I'm not sure if this is possible but i'm open to ideas.
I have a c++ function. It does some calculation to arrays that are being defined by users as inputs and will generate two output values. Let's call it "myfunction" and it looks something like this:
void myfunction(double array1[18],double array[9],double array [2],double *output1, double *output2)
I want to make this function more generic so that it is able to take in arrays of different size. Meaning, I want users of this function to be able to define array inputs of other size.
For example,
void myfunction(double array1[81],double array[27],double array [3],double *output1, double *output2)
Mathematically, "myfunction" is able to calculate accurate outputs despite the array size. I don't want to make a duplicate of "myfunction" because there are a total of 5 different sets of array size that the user can define as inputs.
Any ideas? thank you in advance