public void TestConstructor() { var vfs = VfsTest(); var cf = new CandidateFinder(vfs); var mch = cf.NextCandidateMatch(); Assert.AreEqual(0, mch.Ivtx1); Assert.AreEqual(0, mch.Ivtx2); mch = cf.NextCandidateMatch(); Assert.AreEqual(1, mch.Ivtx1); Assert.AreEqual(0, mch.Ivtx2); }
public void TestConstructor() { VfState vfs = VfsTest(); CandidateFinder cf = new CandidateFinder(vfs); Match mch = cf.NextCandidateMatch(); Assert.AreEqual(0, mch.Inod1); Assert.AreEqual(0, mch.Inod2); mch = cf.NextCandidateMatch(); Assert.AreEqual(1, mch.Inod1); Assert.AreEqual(0, mch.Inod2); }
bool FMatchRecursive() { Match mchCur; CandidateFinder cf; if (FCompleteMatch()) { return(true); } cf = new CandidateFinder(this); while ((mchCur = cf.NextCandidateMatch()) != null) { if (FFeasible(mchCur)) { BacktrackRecord btr = new BacktrackRecord(); AddMatchToSolution(mchCur, btr); if (FMatchRecursive()) { _fSuccessfulMatch = true; return(true); } btr.Backtrack(this); } } return(false); }