Macaulay2 Engine
Loading...
Searching...
No Matches

◆ setBettiDisplays()

void SchreyerFrame::setBettiDisplays ( )

Definition at line 836 of file res-schreyer-frame.cpp.

837{
838 int lo, hi, len;
839 getBounds(lo, hi, len);
840 // std::cout << "bounds: lo=" << lo << " hi=" << hi << " len=" << len <<
841 // std::endl;
842 mBettiNonminimal = BettiDisplay(lo, hi, len);
843 mBettiMinimal = BettiDisplay(lo, hi, len);
844 mComputationStatus = BettiDisplay(lo, hi, maxLevel());
845
846 for (int lev = 0; lev <= len; lev++)
847 {
848 auto& myframe = level(lev);
849 for (auto p = myframe.begin(); p != myframe.end(); ++p)
850 {
851 int deg = p->mDegree; // this is actual degree, not slanted degree
852 mBettiNonminimal.entry(deg - lev, lev)++;
853 mBettiMinimal.entry(deg - lev, lev)++;
854 }
855 }
856
857 // std::cout << "--- minimal betti set ---\n";
858 // mBettiMinimal.output();
859#if 0
860 // Now set the todo list of pairs (degree, level) for minimalization.
861 for (int slanted_degree = lo; slanted_degree < hi; slanted_degree++)
862 {
863 for (int lev = 1; lev <= maxLevel()-1; lev++)
864 {
865 if (mBettiNonminimal.entry(slanted_degree, lev) > 0 and mBettiNonminimal.entry(slanted_degree+1, lev-1) > 0)
866 {
867 mMinimalizeTODO.push_back(std::make_pair(slanted_degree, lev));
868 }
869
870 }
871 }
872#endif
873 // Meaning: 0: no syzygies in that (degree,lev)
874 // 1: there are some, but syzygies have not been constructed yet
875 // 2: syzygies have been constructed
876 // 3: syzygies have been constructed AND rank from (deg,lev) to
877 // (deg+1,lev-1) has been
878 // computed, and the ranks taken into account in mMinimalBetti.
879 for (int slanted_degree = lo; slanted_degree <= hi; slanted_degree++)
880 {
881 if (len >= 0)
882 {
883 if (mBettiNonminimal.entry(slanted_degree, 0) == 0)
884 mComputationStatus.entry(slanted_degree, 0) = 0;
885 else
886 mComputationStatus.entry(slanted_degree, 0) = 3;
887 }
888
889 if (len >= 1)
890 {
891 if (mBettiNonminimal.entry(slanted_degree, 1) == 0)
892 mComputationStatus.entry(slanted_degree, 1) = 0;
893 else
894 mComputationStatus.entry(slanted_degree, 1) = 2;
895 }
896
897 for (int lev = 2; lev <= maxLevel(); lev++)
898 {
899 if ((lev > len) or mBettiNonminimal.entry(slanted_degree, lev) == 0)
900 mComputationStatus.entry(slanted_degree, lev) = 0;
901 else
902 mComputationStatus.entry(slanted_degree, lev) = 1;
903 }
904 }
905}
std::vector< std::pair< int, int > > mMinimalizeTODO
BettiDisplay mBettiMinimal
BettiDisplay mComputationStatus
std::vector< FrameElement > & level(int lev)
void getBounds(int &loDegree, int &hiDegree, int &length) const
BettiDisplay mBettiNonminimal
int p

References getBounds(), level(), maxLevel(), mBettiMinimal, mBettiNonminimal, mComputationStatus, mMinimalizeTODO, and p.

Referenced by computeFrame(), and start_computation().