jijzepttools.modeling.generate.expression#

Functions#

generate_dual_variable_placeholder(...)

Generate dual variable placeholder from constraint with the shape consistent to the constraint

generate_dual_variable_shape(...)

Generate dual variable shape from constraint

generate_sparse_placeholder(...)

Generate sparse placeholder

Module Contents#

generate_dual_variable_placeholder(variable_name: str, constraint: jijmodeling.Constraint) jijmodeling.Placeholder#

Generate dual variable placeholder from constraint with the shape consistent to the constraint

Parameters:

constraint (jm.Constraint) – constraint

Returns:

dual variable placeholder

Return type:

jm.Placeholder

generate_dual_variable_shape(constraint: jijmodeling.Constraint) Tuple[jijzepttools.modeling.utils.type.Expr, Ellipsis]#

Generate dual variable shape from constraint

Parameters:

constraint (jm.Constraint) – constraint

Returns:

dual variable shape

Return type:

Tuple[Expr, …]

generate_sparse_placeholder(expr: jijmodeling.Subscript, nnz_prefix: str, ind_prefix: str, coord_prefix: str, data_prefix: str) jijzepttools.modeling.utils.type.Expr#

Generate sparse placeholder This function generates jm.Sum Expr which is equivalent to the original expression. Note that the following instnace_data will additionally be needed (below is an exapmle of A[i, j, k]): - nnzA: number of non-zero elements of A - coordA0: coordinate of non-zero elements of A in the first dimension - coordA1: coordinate of non-zero elements of A in the second dimension - coordA2: coordinate of non-zero elements of A in the third dimension - … - dataA: data of non-zero elements of A

Parameters:
  • expr (Expr) – expression

  • nnz_prefix (str) – prefix of nnz

  • ind_prefix (str) – prefix of ind

  • coord_prefix (str) – prefix of coord

  • data_prefix (str) – prefix of data

Returns:

jm.Sum Expr which is equivalent to the original expression

Return type:

Expr