MCPcopy Create free account
hub / github.com/LiangliangNan/PolyFit / create_constraint

Method create_constraint

code/math/linear_program.cpp:304–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302
303
304LinearConstraint* LinearProgram::create_constraint(
305 LinearConstraint::BoundType bt /* = Variable::FREE */,
306 double lb /* = -Variable::infinity() */,
307 double ub /* = +Variable::infinity() */,
308 const std::string& name /* = "" */ )
309{
310 LinearConstraint* c = new LinearConstraint(this, bt, lb, ub);
311
312 std::size_t idx = constraints_.size();
313 c->set_index(idx);
314
315 const std::string& fixed_name = name.empty() ? "c" + from_integer(idx, 9, '0') : name;
316 c->set_name(fixed_name);
317
318 constraints_.push_back(c);
319 return c;
320}
321
322
323std::vector<LinearConstraint*> LinearProgram::create_n_constraints(std::size_t n) {

Callers 2

optimizeMethod · 0.80
re_orientMethod · 0.80

Calls 5

from_integerFunction · 0.85
sizeMethod · 0.45
set_indexMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected