}else{
int p;
// TODO this code is wrong, must check if each pattern is in the group table.
for(p=0;p<n_patterns;++p){
// need shallow copy constructor for groups
group new_grp(grp, func.get_pattern(p));
}else{
int p;
// TODO this code is wrong, must check if each pattern is in the group table.
for(p=0;p<n_patterns;++p){
// need shallow copy constructor for groups
group new_grp(grp, func.get_pattern(p));