void circle_union() {
  for (int c = 1; c <= n; ++c) {
    int cvrcnt = 0;
    e.clear();
    for (int i = 1; i <= n; ++i) {
      if (i != c) {
        int r = testCC(center[c], center[i], radius[c], radius[i]);
        if (r == 2) ++cvrcnt;
        else if (r == 0) {
          pair<double, double> paa = isCC(center[c], center[i], radius[c], radius[i]);
          add(paa.first, paa.second);
        }
      }
    }
    if (e.size() == 0) {
      double a = pi * radius[c] * radius[c];
      cntarea[cvrcnt] -= a;
      cntarea[cvrcnt + 1] += a;
    } else {
      e.push_back(event_t(-pi, 1));
      e.push_back(event_t(pi, -2));
      sort(e.begin(), e.end());
      for (int i = 0; i < int(e.size()) - 1; ++i) {
        cvrcnt += e[i].delta;
        double a = calc(center[c], radius[c], e[i].theta, e[i + 1].theta);
        cntarea[cvrcnt - 1] -= a;
        cntarea[cvrcnt] += a;
      }
    }
  }
}
Beispiel #2
0
void preprocesareInformatii(){
   Points = readFromFile();
   type = testCC(Points);
   direction = ClockWise(Points, pointsType);
   pointsType = ShiftVector(pointsType);
   
}
Beispiel #3
0
/**
 * @brief call the test framework
 */
int main(int argc, char** argv)
{
    // Initialize the wxWidgets library
    wxInitializer initializer;
    // testRetagWorkspace();
    // testStringSearcher();
    testCC();
    return 0;
}
void DisAssembler::parseLine(int lineNum)
{
	if (testCC())
	{
		int stringAdd = 0;
		int currentAdd = 0;
		string x = "\0";

		lines[lineNum][0] = line.substr(1, 2);
		lines[lineNum][1] = line.substr(3, 4);
		lines[lineNum][2] = line.substr(7, 2);

		if (!testEOF(lineNum) && !testStart(lineNum))
		{

			bytenum = hxStrConv(lines[lineNum][0].substr(0, 1)) * 16 + hxStrConv(lines[lineNum][0].substr(1, 1));
			lines[lineNum][3] = line.substr(9, bytenum * 2);

			for (int i = 0; i < bytenum * 2; i += 4)
			{
				currentAdd = 0;

				for (int i = 0; i < 4; ++i)
				{
					currentAdd += hxStrConv(lines[lineNum][1].substr(3 - i, 1)) * pow(16, i);
				}

				currentAdd += i / 4;
				lines[lineNum][4] = lines[lineNum][3].substr(i + 2, 2) + lines[lineNum][3].substr(i, 2);
				x = OpCodeHub(lines[lineNum][4]);
				//cout << setw (5) << currentAdd << setw(20) << x << endl;
				program[currentAdd] = x;
			}

		}

		else;

	}

	else
	{
		errorMessages(2);
	}
}
Beispiel #5
0
//*********************************************************************//
//          Functions parametrize the detected component
//*********************************************************************//
u16 switchPart(type SS) {
    switch (SS) {
        case NFET:
            return testNFET();
        case PFET:
            return testPFET();
        case NMOS:
            return testNMOS();
        case PMOS:
            return testPMOS();
        case NPN:
            return testNPN();
        case CA:
            return testCA();
        case PNP:
            return testPNP();
        case CC:
            return testCC();
        case DIODE:
            return testDIODE();
        case TRIAC:
            return testTRIAC();
        case SCR:
            return testSCR();
        case CAP:
            return testCAP();
        case RES:
            return testRES();
        case ZENER:
            return testZENER();
        case DD:
            return testDD();
        case NPN_D:
            return testNPN_D();
        case PNP_D:
            return testPNP_D();
        default:
            return ERROR;
    }
}