// static bool SchemaRecordCoder::fieldsEqual(const FieldsMap& x, const FieldsMap& y) { if (x.end_i() != y.end_i()) { return false; } for (size_t i = 0; i < x.end_i(); ++i) { fstring xname = x.key(i); size_t j = y.find_i(xname); if (j == y.end_i()) { return false; } fstring yname = y.key(j); BSONElement xe(xname.data()-1, xname.size()+1, BSONElement::FieldNameSizeTag()); BSONElement ye(yname.data()-1, yname.size()+1, BSONElement::FieldNameSizeTag()); if (xe.type() == NumberDouble || ye.type() == NumberDouble) { double xd = xe.numberDouble(); double yd = ye.numberDouble(); if (fabs((xd - yd) / xd) > 0.1) return false; else continue; } else if (xe != ye) return false; } return true; }
void StandardModel<Two_scale>::set(const DoubleVector& y) { int i, j, k = 0; for (i = 1; i <= 3; i++) for (j = 1; j <= 3; j++) { k++; yu(i, j) = y.display(k); yd(i, j) = y.display(k + 9); ye(i, j) = y.display(k + 18); } k = 27; for (i = 1; i <= 3; i++) { k++; g(i) = y.display(k); } }
void StandardModel<Two_scale>::setYukawaElement(yukawa k, int i, int j, double f) { switch (k) { case YU: yu(i, j) = f; break; case YD: yd(i, j) = f; break; case YE: ye(i, j) = f; break; default: assert(false && "StandardModel<Two_scale>::setYukawaElement called with illegal k"); break; } }
void arrangement::compute_ACScellBeginEnd() { int ncr_begin = -1; int ncr_end = -1; Walk_pl walk_pl(nonCriticalRegions); // get NCR start Rational xt(target_centre.x()); Rational yt(target_centre.y()); Conic_point_2 pt(xt,yt); Arrangement_2::Vertex_handle v = insert_point(nonCriticalRegions, pt, walk_pl); try { ncr_begin = v->face()->data(); nonCriticalRegions.remove_isolated_vertex(v); } catch (const std::exception exn) { target_centre = QPoint(target_centre.x()+1, target_centre.y()+1); compute_ACScellBeginEnd(); return; } // get NCR end Rational xe(target_centre_end.x()); Rational ye(target_centre_end.y()); Conic_point_2 pe(xe,ye); Arrangement_2::Vertex_handle w = insert_point(nonCriticalRegions, pe, walk_pl); try { ncr_end = w->face()->data(); nonCriticalRegions.remove_isolated_vertex(w); } catch (const std::exception exn) { target_centre_end = QPoint(target_centre_end.x()+1, target_centre_end.y()+1); compute_ACScellBeginEnd(); return; } // retrieve ACScell for (int i = 0; i < (int) ACScells.size(); i++) if (ACScells[i].NCR == ncr_begin) { Rational x(manipulator_centre.x()); Rational y(manipulator_centre.y()); Conic_point_2 p(x,y); Walk_pl walk(ACScells[i].arr); Arrangement_2::Vertex_handle u = insert_point(ACScells[i].arr, p, walk); try { if (!u->face()->is_unbounded()) { ACScells[i].arr.remove_isolated_vertex(u); AcscellBegin = i; break; } } catch (const std::exception exn) { manipulator_centre = QPoint(manipulator_centre.x()+1, manipulator_centre.y()+1); compute_ACScellBeginEnd(); return; } } for (int i = 0; i < (int) ACScells.size(); i++) if (ACScells[i].NCR == ncr_end) { Rational x(manipulator_centre_end.x()); Rational y(manipulator_centre_end.y()); Conic_point_2 p(x,y); Walk_pl walk(ACScells[i].arr); Arrangement_2::Vertex_handle u = insert_point(ACScells[i].arr, p, walk); try { if (!u->face()->is_unbounded()) { ACScells[i].arr.remove_isolated_vertex(u); AcscellEnd = i; break; } } catch (const std::exception exn) { manipulator_centre_end = QPoint(manipulator_centre_end.x()+1, manipulator_centre_end.y()+1); compute_ACScellBeginEnd(); return; } } }