Ejemplo n.º 1
0
void SchreyerFrame::setBettiDisplays()
{
  int lo, hi, len;
  getBounds(lo, hi, len);
  //std::cout << "bounds: lo=" << lo << " hi=" << hi << " len=" << len << std::endl;
  mBettiNonminimal = BettiDisplay(lo,hi,len);
  mBettiMinimal = BettiDisplay(lo,hi,len);

  for (int lev=0; lev<=len; lev++)
    {
      auto& myframe = level(lev);
      for (auto p=myframe.begin(); p != myframe.end(); ++p)
        {
          int deg = p->mDegree; // this is actual degree, not slanted degree
          mBettiNonminimal.entry(deg-lev,lev) ++ ;
          mBettiMinimal.entry(deg-lev,lev) ++ ;
        }
    }

  // Now set the todo list of pairs (degree, level) for minimalization.
  for (int slanted_degree = lo; slanted_degree < hi; slanted_degree++)
    {
      for (int lev = 1; lev <= len; lev++)
        {
          if (mBettiNonminimal.entry(slanted_degree, lev) > 0 and mBettiNonminimal.entry(slanted_degree+1, lev-1) > 0)
            {
              mMinimalizeTODO.push_back(std::make_pair(slanted_degree, lev));
            }
        }
    }
}
Ejemplo n.º 2
0
void SchreyerFrame::setBettiDisplays()
{
  int lo, hi, len;
  getBounds(lo, hi, len);
  //std::cout << "bounds: lo=" << lo << " hi=" << hi << " len=" << len << std::endl;
  mBettiNonminimal = BettiDisplay(lo,hi,len);
  mBettiMinimal = BettiDisplay(lo,hi,len);
  mComputationStatus = BettiDisplay(lo,hi,maxLevel());
  
  for (int lev=0; lev<=len; lev++)
    {
      auto& myframe = level(lev);
      for (auto p=myframe.begin(); p != myframe.end(); ++p)
        {
          int deg = p->mDegree; // this is actual degree, not slanted degree
          mBettiNonminimal.entry(deg-lev,lev) ++ ;
          mBettiMinimal.entry(deg-lev,lev) ++ ;
        }
    }

#if 0  
  // Now set the todo list of pairs (degree, level) for minimalization.
  for (int slanted_degree = lo; slanted_degree < hi; slanted_degree++)
    {
      for (int lev = 1; lev <= maxLevel()-1; lev++)
        {
          if (mBettiNonminimal.entry(slanted_degree, lev) > 0 and mBettiNonminimal.entry(slanted_degree+1, lev-1) > 0)
            {
              mMinimalizeTODO.push_back(std::make_pair(slanted_degree, lev));
            }
          
        }
    }
#endif
  // Meaning: 0: no syzygies in that (degree,lev)
  //          1:  there are some, but syzygies have not been constructed yet
  //          2:  syzygies have been constructed
  //          3:  syzygies have been constructed AND rank from (deg,lev) to (deg+1,lev-1) has been
  //              computed, and the ranks taken into account in mMinimalBetti.
  for (int slanted_degree = lo; slanted_degree <= hi; slanted_degree++)
    {
      if (len >= 0)
        {
          if (mBettiNonminimal.entry(slanted_degree, 0) == 0)
            mComputationStatus.entry(slanted_degree, 0) = 0;
          else
            mComputationStatus.entry(slanted_degree, 0) = 3;
        }

      if (len >= 1)
        {
          if (mBettiNonminimal.entry(slanted_degree, 1) == 0)
            mComputationStatus.entry(slanted_degree, 1) = 0;
          else
            mComputationStatus.entry(slanted_degree, 1) = 2;
        }
      
      for (int lev = 2; lev <= maxLevel(); lev++)
        {
          if ((lev > len) or mBettiNonminimal.entry(slanted_degree, lev) == 0)
              mComputationStatus.entry(slanted_degree, lev) = 0;
          else
              mComputationStatus.entry(slanted_degree, lev) = 1;
        }
    }
}