You are trying to compute the length of the Collatz chain, aren't you. Do you realise that currently you always return 1
? You should modify your code to return the count instead. That means adding the current iteration to the recursive call:
template<class myType>
myType recursionSet<myType>::collatz(myType n)
{
if(n == 1)
return 1;
else {
if(n%2 == 1)
return 1 + collatz(3*n+1);
else
return 1 + collatz(n/2);
}
}