Example #1
0
std::vector<std::vector<int> > TCheck(std::vector<std::vector<int> > cycles, int num_arcs, std::vector<int> len, int order, int &x, std::vector<bool> doub, std::vector<bool> undoub) {
	std::vector<std::vector<int> > solutions;
	if (len.size() < num_arcs) {
		int a = 0;
		int b = 1;
		if (doub[len.size()]) {b = 2;} 
		while (a < b) {
			std::vector<int> temp = len;
			temp.push_back(a);
			std::vector<std::vector<int> > out = TCheck(cycles, num_arcs, temp, order, x, doub, undoub);
			int b = 0;
			while (b < out.size()) {
				solutions.push_back(out[b]);
				b++;
			}a+=1;
		}
	} else {
		int a = 0;
		int zero = 0;
		int one = 0;
		int three = 0;
		while (a < cycles.size()) {
			int sum = cycles[a][0];
			int b = 1;
			while (b < cycles[a].size()) {
				sum+=len[cycles[a][b]];
				b++;
			}
			if (sum == 3 || sum == 1) {
				three++;
			}
			if ((sum%2)==0) {zero++;}
			else if ((sum%2)==1) {one++;}
			a++;
		} if ((zero == one || zero+2 == one) && three>= 2) {
			int sum = 0;
			a = 0;
			while (a < len.size()) {
				sum+=len[a];
				a++;
			}
			int y = 0;
			if ((order-sum)%2 == 0) {
				x++;
				std::vector<std::vector<int> > out = FCheck(cycles, num_arcs, len, order, 0, y, doub);
				std::cout << "part " << x << " complete" << std::endl;
				a = 0;
				while (a < out.size()) {
					solutions.push_back(out[a]);
					a++;
				}
			}
		}
	} return solutions;
}
Example #2
0
std::vector<std::vector<int> > FCheck(std::vector<std::vector<int> > cycles, int num_arcs, std::vector<int> len, int order, int place, int &x, std::vector<bool> doub) {
	std::vector<std::vector<int> > solutions;
	if (place < len.size()) {
		int a = 0;
		int b = 2;
		if (doub[place]) {b = 4;} 
		while (a < b) {
			std::vector<int> temp = len;
			temp[place]+= a;
			x++;
			std::vector<std::vector<int> > out = FCheck(cycles, num_arcs, temp, order, place+1, x, doub);
			int b = 0;
			while (b < out.size()) {
				solutions.push_back(out[b]);
				b++;
			}a+=2;
		}
	} else {
		int a = 0;
		int zero = 0;
		int one = 0;
		int two = 0;
		int three = 0;
		int low = 0;
		int low2 = 0;
		while (a < cycles.size()) {
			int sum = cycles[a][0];
			int b = 1;
			while (b < cycles[a].size()) {
				sum+=len[cycles[a][b]];
				b++;
			}
			if (sum == 3) {
				low++;
			}
			if (sum == 4 || sum == 0) {
				low2++;
			}
			if ((sum%4)==0) {zero++;}
			else if ((sum%4)==1) {one++;}
			else if ((sum%4)==2) {two++;}
			else if ((sum%4)==3) {three++;}
			a++;
		} if (((three == zero && three == one && (three == two || three == two+2)) || 
		(three == zero && three == one+2 && three == two+2) || 
		(three == zero+2 && three == one+2 && three == two+2))
		&& low >= 2 && low2 >= 2) {
			int sum = 0;
			a = 0;
			while (a < len.size()) {
				sum+=len[a];
				a++;
			}
			if ((order-sum)%4 == 0) {
				std::vector<std::vector<int> > out = PanCheck(cycles, num_arcs, len, order, 0, sum, doub);
				a = 0;
				while (a < out.size()) {
					solutions.push_back(out[a]);
					a++;
				}
			}
		}	
	} return solutions;
}
Example #3
0
void AspectSet::angleslot()
{
  FCheck(Angle, 0.0, 360.0, "angle value", &angle);
}
Example #4
0
void AspectSet::influenceslot()
{
  FCheck(Influence, 0.0, 1.0, "influence value", &influence);
}
Example #5
0
void AspectSet::orbslot()
{
  FCheck(Orb, -30.0, 30.0, "orb value", &orb);
}
Example #6
0
void GraphSettings::globetiltslot()
{
  FCheck(GlobeTilt, -rDegQuad, rDegQuad, transl("degree of tilt"), &Tilt);
}