linopy.objective.Objective

linopy.objective.Objective#

class linopy.objective.Objective(expression, model, sense='min')#

An objective expression containing all relevant information.

__init__(expression, model, sense='min')#

Methods

__init__(expression, model[, sense])

assign(**fields)

Wrapper for the expression <function assign_multiindex_safe at 0x790f0edb6340> function for linopy.Objective.

sel([indexers, method, tolerance, drop])

Wrapper for the expression <function Dataset.sel at 0x790f0edb6c00> function for linopy.Objective.

set_value(value)

Sets the value of the objective.

to_matrix(*args, **kwargs)

Wrapper for expression.to_matrix

to_polars(**kwargs)

Returns the objective as a polars DataFrame.

Attributes

attrs

Returns the attributes of the objective.

coeffs

Returns the coefficients of the objective.

coords

Returns the coordinates of the objective.

data

Returns the data of the objective.

expression

Returns the expression of the objective.

flat

Returns the flattened objective.

indexes

Returns the indexes of the objective.

is_linear

Whether the objective expression is linear.

is_quadratic

Whether the objective expression is quadratic.

model

Returns the model of the objective.

nterm

Returns the number of terms in the objective.

sense

Returns the sense of the objective.

sizes

Returns the sizes of the objective.

value

Returns the value of the objective.

vars

Returns the variables of the objective.