bool SumOfIntegrals::hasTestFunctions() const
{
  for (Sundance::Map<RegionQuadCombo, Expr>::const_iterator 
         i=rqcToExprMap_.begin(); i!=rqcToExprMap_.end(); i++)
  {
    Expr e = i->second;
    if (e.hasTestFunctions()) return true;
  }
  return false;
}
bool SumOfIntegrals::integralHasTestFunctions(const OrderedHandle<CellFilterStub>& d) const 
{
  for (Sundance::Map<RegionQuadCombo, Expr>::const_iterator 
         i=rqcToExprMap_.begin(); i!=rqcToExprMap_.end(); i++)
  {
    const RegionQuadCombo& rqc = i->first;
    if (OrderedHandle<CellFilterStub>(rqc.domain()) != d) continue;
    Expr e = i->second;
    if (e.hasTestFunctions()) return true;
  }
  return false;
}