/*!The engine ensures that these variables will themselves be initialized * when they are used to initialize the class. An error occurs if the variables are not found * in the input or there is a loop of dependencies, this is a depends on b, which depends on c, * which in turn depends back on a. * * * \note * This class depends on val1, val2, and random_info * @return List of dependencies */ std::vector<std::string> example_rhs::dependencies() const{ std::string deps[] = {"val1", "val2", "random_info"}; //this array holds the dependencies //This function appenps an array of strings and a vector of strings, //returning a vector of the results return make_append(deps, rhs::dependencies()); //return the dependencies for this class along with any dependencies the parent classes have }
/* * Generate plan for a UNION or UNION ALL node */ static Plan * generate_union_plan(SetOperationStmt *op, Query *parse, List *refnames_tlist) { List *planlist; List *tlist; Plan *plan; /* * If any of my children are identical UNION nodes (same op, all-flag, * and colTypes) then they can be merged into this node so that we * generate only one Append and Sort for the lot. Recurse to find * such nodes and compute their children's plans. */ planlist = nconc(recurse_union_children(op->larg, parse, op, refnames_tlist), recurse_union_children(op->rarg, parse, op, refnames_tlist)); /* * Generate tlist for Append plan node. * * The tlist for an Append plan isn't important as far as the Append is * concerned, but we must make it look real anyway for the benefit of * the next plan level up. */ tlist = generate_append_tlist(op->colTypes, false, planlist, refnames_tlist); /* * Append the child results together. */ plan = (Plan *) make_append(planlist, false, tlist); /* * For UNION ALL, we just need the Append plan. For UNION, need to * add Sort and Unique nodes to produce unique output. */ if (!op->all) { List *sortList; tlist = copyObject(tlist); sortList = addAllTargetsToSortList(NULL, NIL, tlist, false); plan = (Plan *) make_sort_from_sortclauses(parse, tlist, plan, sortList); plan = (Plan *) make_unique(tlist, plan, sortList); } return plan; }
/* * This function returns the dependencies of the toroidal class * This class has the same dependencies as the controller class, along with * * - int iterations: The number of iterations the controller will perform * - double initial_inc: The stepsize of the first variable * - double mul_fac: The multiplying factor to find the increment of the next variable, inc2=mul_fac*inc1, inc3=mul_fac*inc2, etc. * *\sa controller::dependencies, item_dim::dependencies */ std::vector<std::string> toroidal::dependencies() const{ std::string deps[] = {"iterations", "initial_inc", "mul_fac"}; return make_append(deps, controller::dependencies()); }
std::vector<std::string> rhs_CNLS::dependencies() const{ std::string deps[] = {"g0", "e0", "t_int"}; return make_append(deps, rhs::dependencies()); }
/* * Generate plan for an INTERSECT, INTERSECT ALL, EXCEPT, or EXCEPT ALL node */ static Plan * generate_nonunion_plan(SetOperationStmt *op, Query *parse, List *refnames_tlist) { Plan *lplan, *rplan, *plan; List *tlist, *sortList, *planlist; SetOpCmd cmd; /* Recurse on children, ensuring their outputs are marked */ lplan = recurse_set_operations(op->larg, parse, op->colTypes, false, 0, refnames_tlist); rplan = recurse_set_operations(op->rarg, parse, op->colTypes, false, 1, refnames_tlist); planlist = makeList2(lplan, rplan); /* * Generate tlist for Append plan node. * * The tlist for an Append plan isn't important as far as the Append is * concerned, but we must make it look real anyway for the benefit of * the next plan level up. In fact, it has to be real enough that the * flag column is shown as a variable not a constant, else setrefs.c * will get confused. */ tlist = generate_append_tlist(op->colTypes, true, planlist, refnames_tlist); /* * Append the child results together. */ plan = (Plan *) make_append(planlist, false, tlist); /* * Sort the child results, then add a SetOp plan node to generate the * correct output. */ tlist = copyObject(tlist); sortList = addAllTargetsToSortList(NULL, NIL, tlist, false); plan = (Plan *) make_sort_from_sortclauses(parse, tlist, plan, sortList); switch (op->op) { case SETOP_INTERSECT: cmd = op->all ? SETOPCMD_INTERSECT_ALL : SETOPCMD_INTERSECT; break; case SETOP_EXCEPT: cmd = op->all ? SETOPCMD_EXCEPT_ALL : SETOPCMD_EXCEPT; break; default: elog(ERROR, "unrecognized set op: %d", (int) op->op); cmd = SETOPCMD_INTERSECT; /* keep compiler quiet */ break; } plan = (Plan *) make_setop(cmd, tlist, plan, sortList, length(op->colTypes) + 1); return plan; }
/*! * This returns the dependencies of the jones matrix class. * jones matrix has the same dependencies as stable_spectral_pde_1d_tmpl, as well as * * - int num_jones_segments: The number of sets of waveplates to have * - double jones_int_dist: The distance to integrate between waveplates */ std::vector<std::string> jones_optical::dependencies() const{ std::string deps[] = {"num_jones_segments", "jones_int_dist"}; return make_append(deps, stable_spectral_pde_1d_tmpl<comp>::dependencies()); }
/*! * This class has the same dependencies os the objective class, * along with: * * - integer num_pulses: The number of pulses in the solution * */ std::vector<std::string> n_pulse_score::dependencies() const { std::string deps[] = {"num_pulses"}; return make_append(deps, objective::dependencies()); }
/*! * This function returns the dependencies of the integrator class * \note * Integrator has no explicit dependencies, returns item_dim::dependencies * * @return A vector containing the dependencies for integrator * \sa item_dim::dependencies */ std::vector<std::string> integrator::dependencies() const { std::string rhsval[] = {"rhs"}; return make_append(rhsval, item_dim::dependencies()); }
std::vector<std::string> c_elegans::dependencies() const{ std::string deps[] = {"beta", "memV", "memG", "gchem", "gelec", "num_comb", "tau", "EchemEx", "EchemInh", "ar", "ad", "ag_mat", "a_mat", "iterations", "controller"}; return make_append(deps, rhs_type::dependencies()); }
/* * Generate plan for a UNION or UNION ALL node */ static Plan * generate_union_plan(SetOperationStmt *op, PlannerInfo *root, double tuple_fraction, List *refnames_tlist, List **sortClauses) { List *planlist; List *tlist; Plan *plan; /* * If plain UNION, tell children to fetch all tuples. * * Note: in UNION ALL, we pass the top-level tuple_fraction unmodified to * each arm of the UNION ALL. One could make a case for reducing the * tuple fraction for later arms (discounting by the expected size of the * earlier arms' results) but it seems not worth the trouble. The normal * case where tuple_fraction isn't already zero is a LIMIT at top level, * and passing it down as-is is usually enough to get the desired result * of preferring fast-start plans. */ if (!op->all) tuple_fraction = 0.0; /* * If any of my children are identical UNION nodes (same op, all-flag, and * colTypes) then they can be merged into this node so that we generate * only one Append and Sort for the lot. Recurse to find such nodes and * compute their children's plans. */ planlist = list_concat(recurse_union_children(op->larg, root, tuple_fraction, op, refnames_tlist), recurse_union_children(op->rarg, root, tuple_fraction, op, refnames_tlist)); /* * Generate tlist for Append plan node. * * The tlist for an Append plan isn't important as far as the Append is * concerned, but we must make it look real anyway for the benefit of the * next plan level up. */ tlist = generate_append_tlist(op->colTypes, false, planlist, refnames_tlist); /* * Append the child results together. */ plan = (Plan *) make_append(planlist, false, tlist); /* * For UNION ALL, we just need the Append plan. For UNION, need to add * Sort and Unique nodes to produce unique output. */ if (!op->all) { List *sortList; sortList = addAllTargetsToSortList(NULL, NIL, tlist, false); if (sortList) { plan = (Plan *) make_sort_from_sortclauses(root, sortList, plan); plan = (Plan *) make_unique(plan, sortList); } *sortClauses = sortList; } else *sortClauses = NIL; return plan; }