static void range(struct gmi_model* m, struct gmi_ent* e, int dim, double r[2]) { struct gmi_analytic* m2 = to_model(m); ranges_t* rp = ranges_of(m2, agm_from_gmi(e)); r[0] = (*rp)[dim][0]; r[1] = (*rp)[dim][1]; }
struct gmi_ent* gmi_add_analytic(struct gmi_model* m, int dim, int tag, gmi_analytic_fun f, int* periodic, double (*ranges)[2], void* user_data) { struct gmi_analytic* m2; struct agm_ent e; periodic_t* pp; ranges_t* rp; int i; m2 = to_model(m); e = agm_from_gmi(gmi_null_find(m, dim, tag)); *(f_of(m2, e)) = f; pp = periodic_of(m2, e); rp = ranges_of(m2, e); for (i = 0; i < dim; ++i) { (*pp)[i] = periodic[i]; (*rp)[i][0] = ranges[i][0]; (*rp)[i][1] = ranges[i][1]; } for (; i < 2; ++i) { (*pp)[i] = 0; (*rp)[i][0] = 0; (*rp)[i][1] = 0; } *(data_of(m2, e)) = user_data; return gmi_from_agm(e); }
void gmi_add_analytic_reparam(struct gmi_model* m, struct agm_use u, gmi_reparam_fun f, void* user_data) { struct gmi_analytic* m2 = to_model(m); *(reparam_of(m2, u)) = f; *(reparam_data_of(m2, u)) = user_data; }
std::string inductive_property::to_string() const { std::stringstream stm; model_ref md; expr_ref result(m); to_model(md); model_smt2_pp(stm, m, *md.get(), 0); return stm.str(); }
void Z3_API Z3_model_dec_ref(Z3_context c, Z3_model m) { Z3_TRY; LOG_Z3_model_dec_ref(c, m); RESET_ERROR_CODE(); if (m) { to_model(m)->dec_ref(); } Z3_CATCH; }
static void eval(struct gmi_model* m, struct gmi_ent* e, double const p[2], double x[3]) { struct gmi_analytic* m2; struct agm_ent a; void* u; gmi_analytic_fun f; m2 = to_model(m); a = agm_from_gmi(e); u = *(data_of(m2, a)); f = *(f_of(m2, a)); (*f)(p, x, u); }
static void reparam(struct gmi_model* m, struct gmi_ent* from, double const from_p[2], struct gmi_ent* to, double to_p[2]) { struct gmi_analytic* m2; struct agm_ent a; struct agm_ent b; struct agm_use path[4]; int pathlen; m2 = to_model(m); a = agm_from_gmi(from); b = agm_from_gmi(to); pathlen = agm_find_path(m2->base.topo, a, b, path); if (pathlen == -1) gmi_fail("analytic reparam can't find topology path"); reparam_path(m2, path, pathlen, from_p, to_p); }
void* gmi_analytic_reparam_data(struct gmi_model* m, struct agm_use u) { struct gmi_analytic* m2 = to_model(m); return *(reparam_data_of(m2, u)); }
void* gmi_analytic_data(struct gmi_model* m, struct gmi_ent* e) { struct gmi_analytic* m2 = to_model(m); return *(data_of(m2, agm_from_gmi(e))); }
static int periodic(struct gmi_model* m, struct gmi_ent* e, int dim) { struct gmi_analytic* m2 = to_model(m); periodic_t* pp = periodic_of(m2, agm_from_gmi(e)); return (*pp)[dim]; }