int main (void) { cout << __FILE__ << endl; CoolComplex circuit; circuit = in_series (resistor (1.0), in_parallel (in_series (resistor (100.0), inductor (0.2)), in_parallel (capacitor (0.000001), resistor (10000000.0)))); cout << "Circuit impedence is " << circuit << " at frequency " << FREQUENCY << "\n"; return 0; // Exit with OK status }
void initInput(int scale){ double a=(0.3257463)*2; // the numbers in parentheses are "rand's" made deterministic double b=8.65*(0.04039); double c=3.29*(0.55982); double d=(0.727561)*6.171; int n=floor(56.0980*(0.36)); double tol=1.3e-13; // Tolerance. double rel=0.90; // Relaxation parameter. clock_t time0 = clock(); for(int ii=0,i2=scale*10;ii<i2;ii++){ double cap=capacitor(a, b, c, d, n, tol, rel); } double elapsed = (clock() - time0)/1000000.0; printf("{ \"time\": %f }\n", elapsed); }