09.02.2015 Views

Sage Reference Manual: Numerical Optimization - Mirrors

Sage Reference Manual: Numerical Optimization - Mirrors

Sage Reference Manual: Numerical Optimization - Mirrors

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Sage</strong> <strong>Reference</strong> <strong>Manual</strong>: <strong>Numerical</strong> <strong>Optimization</strong>, Release 6.1.1<br />

row(i)<br />

Return a row<br />

INPUT:<br />

•index (integer) – the constraint’s id.<br />

OUTPUT:<br />

A pair (indices, coeffs) where indices lists the entries whose coefficient is nonzero, and to<br />

which coeffs associates their coefficient on the model of the add_linear_constraint method.<br />

EXAMPLE:<br />

sage: from sage.numerical.backends.generic_backend import get_solver<br />

sage: p = get_solver(solver = "PPL")<br />

sage: p.add_variables(5)<br />

4<br />

sage: p.add_linear_constraint(zip(range(5), range(5)), 2, 2)<br />

sage: p.row(0)<br />

([1, 2, 3, 4], [1, 2, 3, 4])<br />

sage: p.row_bounds(0)<br />

(2, 2)<br />

row_bounds(index)<br />

Return the bounds of a specific constraint.<br />

INPUT:<br />

•index (integer) – the constraint’s id.<br />

OUTPUT:<br />

A pair (lower_bound, upper_bound). Each of them can be set to None if the constraint is not<br />

bounded in the corresponding direction, and is a real value otherwise.<br />

EXAMPLE:<br />

sage: from sage.numerical.backends.generic_backend import get_solver<br />

sage: p = get_solver(solver = "PPL")<br />

sage: p.add_variables(5)<br />

4<br />

sage: p.add_linear_constraint(zip(range(5), range(5)), 2, 2)<br />

sage: p.row(0)<br />

([1, 2, 3, 4], [1, 2, 3, 4])<br />

sage: p.row_bounds(0)<br />

(2, 2)<br />

row_name(index)<br />

Return the index th row name<br />

INPUT:<br />

•index (integer) – the row’s id<br />

EXAMPLE:<br />

sage: from sage.numerical.backends.generic_backend import get_solver<br />

sage: p = get_solver(solver = "PPL")<br />

sage: p.add_linear_constraints(1, 2, None, names="Empty constraint 1")<br />

sage: p.row_name(0)<br />

’Empty constraint 1’<br />

5.4. PPL Backend 99

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!