void TestEval::apply03() { const ExprSymbol& x1 = ExprSymbol::new_("x1"); const ExprSymbol& y1 = ExprSymbol::new_("y1"); const ExprSymbol& x2 = ExprSymbol::new_("x2"); const ExprSymbol& y2 = ExprSymbol::new_("y2"); const ExprSymbol& x3 = ExprSymbol::new_("x3"); Function f1(x1,y1,x1+y1); Function f2(x2,y2,x2*y2); Function f3(x3,f1(x3,x3)-f2(x3,x3)); //cout << f3 << endl; IntervalVector _x3(1,Interval(3,3)); /* e.eval().i(); cout << "f1:---------\n"; f1.cf.print<Domain>(); cout << "f2:---------\n"; f2.cf.print<Domain>(); cout << "f3:---------\n"; f3.cf.print<Domain>(); */ check(f3.eval_domain(_x3).i(), Interval(-3,-3)); CPPUNIT_ASSERT((f3.eval_domain(_x3).i()).is_superset(Interval(-3,-3))); }
void TestEval::apply04() { const ExprSymbol& x1 = ExprSymbol::new_("x1"); const ExprSymbol& x2 = ExprSymbol::new_("x2"); const ExprSymbol& x3 = ExprSymbol::new_("x3"); Function f1(x1,sqr(x1)); Function f2(x2,x2+Interval(1,1)); Function f3(x3,f2(f1(x3))); IntervalVector _x3(1,Interval(3,3)); check(f3.eval_domain(_x3).i(), Interval(10,10)); CPPUNIT_ASSERT((f3.eval_domain(_x3).i()).is_superset(Interval(10,10))); }
static void *parallel64_t(void *input) { int i; threads64_t *in = (threads64_t *) input; const int start = in->thread * in->size / NUM_THREADS; const int stop = in->thread + 1 == NUM_THREADS ? in->size : (in->thread + 1) * in->size / NUM_THREADS; const int curr = in->thread * HIST_SIZE; uint32_t *A = &in->histA[curr]; uint32_t *B = &in->histB[curr]; uint32_t *C = &in->histC[curr]; uint32_t *D = &in->histD[curr]; uint32_t *E = &in->histE[curr]; uint32_t *F = &in->histF[curr]; for (i=start;i<stop;++i) { const uint64_t pos = (in->array[i] = in->position(in->array[i])); A[_x1(pos)]++; B[_x2(pos)]++; C[_x3(pos)]++; D[_x4(pos)]++; E[_x5(pos)]++; F[_x6(pos)]++; } pthread_exit(NULL); }