How to organize variable which has connection with two objects : <p>In my code, there is a class Func, which denote a function. The class FuncSet is a collection of some functions in class Func. There are two objects FuncSet set1 and FuncSet set2. </p>

<p>Now I would like to make up a variable which is a 2D matrix and stores the convolution of all functions in set1 and set2. I do not know which is the best way to organize this variable. If I declare it as a member in class FuncSet, this does not make sense in logic since it has some connection between two objects.</p>

<pre><code>// class of function
class Func
{
// calculate convolution of this function and function v
double convolution(const Func &amp; v);
}

// class of set of functions
class FuncSet
{
std::vector&lt;Func&gt; func;
}

// two objects set1 and set2, each of them has some Func objects. 
// For example, set1 has 10 functions and set2 has 20 functions
FuncSet set1(10);
FuncSet set2(20);

// calculate convolution of u and v, for all functions u in set1 and all functions v in set2
// it should be a 10*20 double 2D matrix
// where should I store this 2D matrix?
</code></pre>
