jijmodeling 0.10.15__cp310-cp310-win_amd64.whl → 1.11.0__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of jijmodeling might be problematic. Click here for more details.
- jijmodeling/__init__.py +1 -146
- jijmodeling/__init__.pyi +5152 -0
- jijmodeling/_jijmodeling.cp310-win_amd64.pyd +0 -0
- jijmodeling/dataset.py +5 -0
- jijmodeling/dataset.pyi +106 -0
- jijmodeling/experimental.py +13 -0
- jijmodeling/experimental.pyi +302 -0
- jijmodeling/py.typed +0 -0
- jijmodeling/range/__init__.py +14 -0
- jijmodeling/range/__init__.pyi +56 -0
- jijmodeling/range/size.py +14 -0
- jijmodeling/range/size.pyi +54 -0
- jijmodeling/range/value.py +14 -0
- jijmodeling/range/value.pyi +54 -0
- jijmodeling-1.11.0.dist-info/METADATA +235 -0
- jijmodeling-1.11.0.dist-info/RECORD +18 -0
- {jijmodeling-0.10.15.dist-info → jijmodeling-1.11.0.dist-info}/WHEEL +1 -2
- {jijmodeling-0.10.15.dist-info → jijmodeling-1.11.0.dist-info/licenses}/LICENSE.txt +1 -1
- jijmodeling/__pycache__/__init__.cpython-310.opt-1.pyc +0 -0
- jijmodeling/__pycache__/__init__.cpython-310.pyc +0 -0
- jijmodeling/__pycache__/_version.cpython-310.opt-1.pyc +0 -0
- jijmodeling/__pycache__/_version.cpython-310.pyc +0 -0
- jijmodeling/_version.py +0 -4
- jijmodeling/exceptions/__init__.py +0 -26
- jijmodeling/exceptions/__pycache__/__init__.cpython-310.opt-1.pyc +0 -0
- jijmodeling/exceptions/__pycache__/__init__.cpython-310.pyc +0 -0
- jijmodeling/exceptions/__pycache__/exceptions.cpython-310.opt-1.pyc +0 -0
- jijmodeling/exceptions/__pycache__/exceptions.cpython-310.pyc +0 -0
- jijmodeling/exceptions/exceptions.py +0 -37
- jijmodeling/expression/__init__.py +0 -74
- jijmodeling/expression/__pycache__/__init__.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/__pycache__/__init__.cpython-310.pyc +0 -0
- jijmodeling/expression/__pycache__/condition.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/__pycache__/condition.cpython-310.pyc +0 -0
- jijmodeling/expression/__pycache__/constraint.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/__pycache__/constraint.cpython-310.pyc +0 -0
- jijmodeling/expression/__pycache__/expression.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/__pycache__/expression.cpython-310.pyc +0 -0
- jijmodeling/expression/__pycache__/extract.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/__pycache__/extract.cpython-310.pyc +0 -0
- jijmodeling/expression/__pycache__/from_old_serializable.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/__pycache__/from_old_serializable.cpython-310.pyc +0 -0
- jijmodeling/expression/__pycache__/mathfunc.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/__pycache__/mathfunc.cpython-310.pyc +0 -0
- jijmodeling/expression/__pycache__/prod.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/__pycache__/prod.cpython-310.pyc +0 -0
- jijmodeling/expression/__pycache__/serializable.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/__pycache__/serializable.cpython-310.pyc +0 -0
- jijmodeling/expression/__pycache__/sum.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/__pycache__/sum.cpython-310.pyc +0 -0
- jijmodeling/expression/__pycache__/type_annotations.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/__pycache__/type_annotations.cpython-310.pyc +0 -0
- jijmodeling/expression/__pycache__/utils.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/__pycache__/utils.cpython-310.pyc +0 -0
- jijmodeling/expression/condition.py +0 -362
- jijmodeling/expression/constraint.py +0 -340
- jijmodeling/expression/expression.py +0 -706
- jijmodeling/expression/extract.py +0 -139
- jijmodeling/expression/from_old_serializable.py +0 -133
- jijmodeling/expression/mathfunc.py +0 -269
- jijmodeling/expression/prod.py +0 -117
- jijmodeling/expression/serializable.py +0 -132
- jijmodeling/expression/sum.py +0 -197
- jijmodeling/expression/type_annotations.py +0 -50
- jijmodeling/expression/utils.py +0 -175
- jijmodeling/expression/variables/__init__.py +0 -35
- jijmodeling/expression/variables/__pycache__/__init__.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/variables/__pycache__/__init__.cpython-310.pyc +0 -0
- jijmodeling/expression/variables/__pycache__/deci_vars.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/variables/__pycache__/deci_vars.cpython-310.pyc +0 -0
- jijmodeling/expression/variables/__pycache__/jagged_array.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/variables/__pycache__/jagged_array.cpython-310.pyc +0 -0
- jijmodeling/expression/variables/__pycache__/placeholders.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/variables/__pycache__/placeholders.cpython-310.pyc +0 -0
- jijmodeling/expression/variables/__pycache__/variable.cpython-310.opt-1.pyc +0 -0
- jijmodeling/expression/variables/__pycache__/variable.cpython-310.pyc +0 -0
- jijmodeling/expression/variables/deci_vars.py +0 -136
- jijmodeling/expression/variables/jagged_array.py +0 -73
- jijmodeling/expression/variables/placeholders.py +0 -107
- jijmodeling/expression/variables/variable.py +0 -485
- jijmodeling/latex_repr/__init__.py +0 -11
- jijmodeling/latex_repr/__pycache__/__init__.cpython-310.opt-1.pyc +0 -0
- jijmodeling/latex_repr/__pycache__/__init__.cpython-310.pyc +0 -0
- jijmodeling/latex_repr/__pycache__/latex_repr.cpython-310.opt-1.pyc +0 -0
- jijmodeling/latex_repr/__pycache__/latex_repr.cpython-310.pyc +0 -0
- jijmodeling/latex_repr/__pycache__/problem_latex_repr.cpython-310.opt-1.pyc +0 -0
- jijmodeling/latex_repr/__pycache__/problem_latex_repr.cpython-310.pyc +0 -0
- jijmodeling/latex_repr/latex_repr.py +0 -243
- jijmodeling/latex_repr/problem_latex_repr.py +0 -209
- jijmodeling/marker/__marker__.cp310-win_amd64.pyd +0 -0
- jijmodeling/match/__init__.py +0 -19
- jijmodeling/match/__pycache__/__init__.cpython-310.opt-1.pyc +0 -0
- jijmodeling/match/__pycache__/__init__.cpython-310.pyc +0 -0
- jijmodeling/match/__pycache__/condition_same.cpython-310.opt-1.pyc +0 -0
- jijmodeling/match/__pycache__/condition_same.cpython-310.pyc +0 -0
- jijmodeling/match/__pycache__/constraint_same.cpython-310.opt-1.pyc +0 -0
- jijmodeling/match/__pycache__/constraint_same.cpython-310.pyc +0 -0
- jijmodeling/match/__pycache__/expr_same.cpython-310.opt-1.pyc +0 -0
- jijmodeling/match/__pycache__/expr_same.cpython-310.pyc +0 -0
- jijmodeling/match/__pycache__/is_same_expr.cpython-310.opt-1.pyc +0 -0
- jijmodeling/match/__pycache__/is_same_expr.cpython-310.pyc +0 -0
- jijmodeling/match/__pycache__/penalty_same.cpython-310.opt-1.pyc +0 -0
- jijmodeling/match/__pycache__/penalty_same.cpython-310.pyc +0 -0
- jijmodeling/match/__pycache__/problem_same.cpython-310.opt-1.pyc +0 -0
- jijmodeling/match/__pycache__/problem_same.cpython-310.pyc +0 -0
- jijmodeling/match/condition_same.py +0 -44
- jijmodeling/match/constraint_same.py +0 -53
- jijmodeling/match/expr_same.py +0 -23
- jijmodeling/match/is_same_expr.py +0 -288
- jijmodeling/match/penalty_same.py +0 -31
- jijmodeling/match/problem_same.py +0 -44
- jijmodeling/problem/__init__.py +0 -9
- jijmodeling/problem/__pycache__/__init__.cpython-310.opt-1.pyc +0 -0
- jijmodeling/problem/__pycache__/__init__.cpython-310.pyc +0 -0
- jijmodeling/problem/__pycache__/problem.cpython-310.opt-1.pyc +0 -0
- jijmodeling/problem/__pycache__/problem.cpython-310.pyc +0 -0
- jijmodeling/problem/problem.py +0 -166
- jijmodeling/protobuf/__init__.py +0 -8
- jijmodeling/protobuf/__pycache__/__init__.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/__pycache__/__init__.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__init__.py +0 -47
- jijmodeling/protobuf/from_protobuf/__pycache__/__init__.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/__init__.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/extract_attribute_value_from_header.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/extract_attribute_value_from_header.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/from_protobuf.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/from_protobuf.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_array_shape.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_array_shape.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_binary_op.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_binary_op.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_binary_var.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_binary_var.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_constraint.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_constraint.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_element.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_element.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_expression.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_expression.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_forall.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_forall.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_integer_var.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_integer_var.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_jagged_array.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_jagged_array.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_number_lit.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_number_lit.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_penalty.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_penalty.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_placeholder.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_placeholder.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_problem.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_problem.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_reduction_op.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_reduction_op.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_subscript_op.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_subscript_op.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_unary_op.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/__pycache__/message_to_unary_op.cpython-310.pyc +0 -0
- jijmodeling/protobuf/from_protobuf/extract_attribute_value_from_header.py +0 -26
- jijmodeling/protobuf/from_protobuf/from_protobuf.py +0 -38
- jijmodeling/protobuf/from_protobuf/message_to_array_shape.py +0 -35
- jijmodeling/protobuf/from_protobuf/message_to_binary_op.py +0 -83
- jijmodeling/protobuf/from_protobuf/message_to_binary_var.py +0 -46
- jijmodeling/protobuf/from_protobuf/message_to_constraint.py +0 -48
- jijmodeling/protobuf/from_protobuf/message_to_element.py +0 -30
- jijmodeling/protobuf/from_protobuf/message_to_expression.py +0 -92
- jijmodeling/protobuf/from_protobuf/message_to_forall.py +0 -33
- jijmodeling/protobuf/from_protobuf/message_to_integer_var.py +0 -54
- jijmodeling/protobuf/from_protobuf/message_to_jagged_array.py +0 -25
- jijmodeling/protobuf/from_protobuf/message_to_number_lit.py +0 -41
- jijmodeling/protobuf/from_protobuf/message_to_penalty.py +0 -36
- jijmodeling/protobuf/from_protobuf/message_to_placeholder.py +0 -47
- jijmodeling/protobuf/from_protobuf/message_to_problem.py +0 -51
- jijmodeling/protobuf/from_protobuf/message_to_reduction_op.py +0 -52
- jijmodeling/protobuf/from_protobuf/message_to_subscript_op.py +0 -46
- jijmodeling/protobuf/from_protobuf/message_to_unary_op.py +0 -47
- jijmodeling/protobuf/to_protobuf/__init__.py +0 -43
- jijmodeling/protobuf/to_protobuf/__pycache__/__init__.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/__init__.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/add_header_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/add_header_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/array_shape_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/array_shape_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/binary_op_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/binary_op_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/binary_var_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/binary_var_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/constraint_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/constraint_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/element_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/element_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/expression_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/expression_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/forall_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/forall_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/integer_var_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/integer_var_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/jagged_array_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/jagged_array_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/number_lit_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/number_lit_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/penalty_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/penalty_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/placeholder_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/placeholder_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/problem_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/problem_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/reduction_op_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/reduction_op_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/subscript_op_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/subscript_op_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/to_protobuf.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/to_protobuf.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/unary_op_to_message.cpython-310.opt-1.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/__pycache__/unary_op_to_message.cpython-310.pyc +0 -0
- jijmodeling/protobuf/to_protobuf/add_header_to_message.py +0 -35
- jijmodeling/protobuf/to_protobuf/array_shape_to_message.py +0 -43
- jijmodeling/protobuf/to_protobuf/binary_op_to_message.py +0 -101
- jijmodeling/protobuf/to_protobuf/binary_var_to_message.py +0 -49
- jijmodeling/protobuf/to_protobuf/constraint_to_message.py +0 -52
- jijmodeling/protobuf/to_protobuf/element_to_message.py +0 -43
- jijmodeling/protobuf/to_protobuf/expression_to_message.py +0 -89
- jijmodeling/protobuf/to_protobuf/forall_to_message.py +0 -32
- jijmodeling/protobuf/to_protobuf/integer_var_to_message.py +0 -54
- jijmodeling/protobuf/to_protobuf/jagged_array_to_message.py +0 -37
- jijmodeling/protobuf/to_protobuf/number_lit_to_message.py +0 -52
- jijmodeling/protobuf/to_protobuf/penalty_to_message.py +0 -42
- jijmodeling/protobuf/to_protobuf/placeholder_to_message.py +0 -58
- jijmodeling/protobuf/to_protobuf/problem_to_message.py +0 -54
- jijmodeling/protobuf/to_protobuf/reduction_op_to_message.py +0 -64
- jijmodeling/protobuf/to_protobuf/subscript_op_to_message.py +0 -48
- jijmodeling/protobuf/to_protobuf/to_protobuf.py +0 -36
- jijmodeling/protobuf/to_protobuf/unary_op_to_message.py +0 -58
- jijmodeling/sampleset/__init__.py +0 -33
- jijmodeling/sampleset/__pycache__/__init__.cpython-310.opt-1.pyc +0 -0
- jijmodeling/sampleset/__pycache__/__init__.cpython-310.pyc +0 -0
- jijmodeling/sampleset/__pycache__/evaluation.cpython-310.opt-1.pyc +0 -0
- jijmodeling/sampleset/__pycache__/evaluation.cpython-310.pyc +0 -0
- jijmodeling/sampleset/__pycache__/measuring_time.cpython-310.opt-1.pyc +0 -0
- jijmodeling/sampleset/__pycache__/measuring_time.cpython-310.pyc +0 -0
- jijmodeling/sampleset/__pycache__/record.cpython-310.opt-1.pyc +0 -0
- jijmodeling/sampleset/__pycache__/record.cpython-310.pyc +0 -0
- jijmodeling/sampleset/__pycache__/sampleset.cpython-310.opt-1.pyc +0 -0
- jijmodeling/sampleset/__pycache__/sampleset.cpython-310.pyc +0 -0
- jijmodeling/sampleset/__pycache__/solving_time.cpython-310.opt-1.pyc +0 -0
- jijmodeling/sampleset/__pycache__/solving_time.cpython-310.pyc +0 -0
- jijmodeling/sampleset/__pycache__/system_time.cpython-310.opt-1.pyc +0 -0
- jijmodeling/sampleset/__pycache__/system_time.cpython-310.pyc +0 -0
- jijmodeling/sampleset/evaluation.py +0 -198
- jijmodeling/sampleset/measuring_time.py +0 -59
- jijmodeling/sampleset/record.py +0 -158
- jijmodeling/sampleset/sampleset.py +0 -381
- jijmodeling/sampleset/solving_time.py +0 -38
- jijmodeling/sampleset/system_time.py +0 -48
- jijmodeling/type_annotations/__init__.py +0 -38
- jijmodeling/type_annotations/__pycache__/__init__.cpython-310.opt-1.pyc +0 -0
- jijmodeling/type_annotations/__pycache__/__init__.cpython-310.pyc +0 -0
- jijmodeling/type_annotations/__pycache__/type_annotations.cpython-310.opt-1.pyc +0 -0
- jijmodeling/type_annotations/__pycache__/type_annotations.cpython-310.pyc +0 -0
- jijmodeling/type_annotations/type_annotations.py +0 -44
- jijmodeling/utils/__init__.py +0 -28
- jijmodeling/utils/__pycache__/__init__.cpython-310.opt-1.pyc +0 -0
- jijmodeling/utils/__pycache__/__init__.cpython-310.pyc +0 -0
- jijmodeling/utils/__pycache__/utils.cpython-310.opt-1.pyc +0 -0
- jijmodeling/utils/__pycache__/utils.cpython-310.pyc +0 -0
- jijmodeling/utils/utils.py +0 -146
- jijmodeling-0.10.15.dist-info/METADATA +0 -59
- jijmodeling-0.10.15.dist-info/RECORD +0 -255
- jijmodeling-0.10.15.dist-info/top_level.txt +0 -1
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import jijmodeling_schema as pb
|
|
4
|
-
|
|
5
|
-
from jijmodeling.problem.problem import Problem, ProblemSense
|
|
6
|
-
from jijmodeling.protobuf.from_protobuf.message_to_constraint import (
|
|
7
|
-
message_to_constraint,
|
|
8
|
-
)
|
|
9
|
-
from jijmodeling.protobuf.from_protobuf.message_to_expression import (
|
|
10
|
-
message_to_expression,
|
|
11
|
-
)
|
|
12
|
-
from jijmodeling.protobuf.from_protobuf.message_to_penalty import message_to_penalty
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def message_to_problem(problem: pb.Problem) -> Problem:
|
|
16
|
-
"""
|
|
17
|
-
Convert a `Problem` message into a `Problem` object.
|
|
18
|
-
|
|
19
|
-
Args:
|
|
20
|
-
problem (pb.Problem): a `Problem` message
|
|
21
|
-
|
|
22
|
-
Returns:
|
|
23
|
-
Problem: a `Problem` object
|
|
24
|
-
"""
|
|
25
|
-
# Set sense of the problem.
|
|
26
|
-
if problem.sense == pb.ProblemSense.MIN:
|
|
27
|
-
sense = ProblemSense.MINIMUM
|
|
28
|
-
else:
|
|
29
|
-
sense = ProblemSense.MAXIMUM
|
|
30
|
-
|
|
31
|
-
# Set the objective function.
|
|
32
|
-
objective = message_to_expression(problem.objective)
|
|
33
|
-
|
|
34
|
-
# Set the constraints.
|
|
35
|
-
constraints = {
|
|
36
|
-
constraint.name: message_to_constraint(constraint)
|
|
37
|
-
for constraint in problem.constraints
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
# Set the penalties.
|
|
41
|
-
penalties = {
|
|
42
|
-
penalty.name: message_to_penalty(penalty) for penalty in problem.penalties
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return Problem(
|
|
46
|
-
name=problem.name,
|
|
47
|
-
sense=sense,
|
|
48
|
-
objective=objective,
|
|
49
|
-
constraints=constraints,
|
|
50
|
-
penalties=penalties,
|
|
51
|
-
)
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import List
|
|
4
|
-
|
|
5
|
-
import jijmodeling_schema as pb
|
|
6
|
-
|
|
7
|
-
from jijmodeling.expression.prod import ProdOperator
|
|
8
|
-
from jijmodeling.expression.sum import ReductionOperator, SumOperator
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def message_to_reduction_op(
|
|
12
|
-
id: str, message: pb.ReductionOp, children: List[pb.Expression]
|
|
13
|
-
) -> ReductionOperator:
|
|
14
|
-
"""
|
|
15
|
-
Convert a message to a `ReductionOperator` object.
|
|
16
|
-
|
|
17
|
-
Args:
|
|
18
|
-
id (str): the id of the `ReductionOperator` object.
|
|
19
|
-
message (pb.ReductionOp): the `ReductionOp` message
|
|
20
|
-
children (List[pb.Expression]): 0: the index, 1: the operand, 2(optional): the condition expression
|
|
21
|
-
|
|
22
|
-
Returns:
|
|
23
|
-
ReductionOperator: a `ReductionOperator` object.
|
|
24
|
-
"""
|
|
25
|
-
# NOTE: Import a module within a local scope to fix a circular import.
|
|
26
|
-
# - https://stackoverflow.com/questions/59462679/design-of-python-conditional-imports
|
|
27
|
-
# - https://medium.com/@hamana.hadrien/so-you-got-a-circular-import-in-python-e9142fe10591
|
|
28
|
-
from jijmodeling.protobuf.from_protobuf.message_to_expression import (
|
|
29
|
-
message_to_expression,
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
# Set the index.
|
|
33
|
-
index = message_to_expression(children[0])
|
|
34
|
-
|
|
35
|
-
# Set the operand.
|
|
36
|
-
operand = message_to_expression(children[1])
|
|
37
|
-
|
|
38
|
-
# Check if the message has a condition expression.
|
|
39
|
-
if message.has_condition:
|
|
40
|
-
# Set the condition expression.
|
|
41
|
-
condition = message_to_expression(children[2])
|
|
42
|
-
else:
|
|
43
|
-
condition = None
|
|
44
|
-
|
|
45
|
-
if message.kind == pb.ReductionOpKind.SUM:
|
|
46
|
-
return SumOperator(
|
|
47
|
-
sum_index=index, operand=operand, condition=condition, uuid=id
|
|
48
|
-
)
|
|
49
|
-
elif message.kind == pb.ReductionOpKind.PROD:
|
|
50
|
-
return ProdOperator(
|
|
51
|
-
sum_index=index, operand=operand, condition=condition, uuid=id
|
|
52
|
-
)
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import List
|
|
4
|
-
|
|
5
|
-
import jijmodeling_schema as pb
|
|
6
|
-
|
|
7
|
-
from jijmodeling.expression.variables.variable import Subscripts
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def message_to_subscript_op(
|
|
11
|
-
id: str, message: pb.SubscriptOp, children: List[pb.Expression]
|
|
12
|
-
) -> Subscripts:
|
|
13
|
-
"""
|
|
14
|
-
Convert a message to a `Subscripts` object.
|
|
15
|
-
|
|
16
|
-
Args:
|
|
17
|
-
id (str): the id of the `Subscripts` object.
|
|
18
|
-
message (pb.SubscriptOp): the `SubscriptOp` message
|
|
19
|
-
children (List[pb.Expression]): 0: the array, 1..: the subscripts of the `Subscripts` object
|
|
20
|
-
|
|
21
|
-
Raises:
|
|
22
|
-
ValueError: the error occurs if `num_subs` is not equal to length of the subscript
|
|
23
|
-
|
|
24
|
-
Returns:
|
|
25
|
-
Subscripts: a `Subscripts` object
|
|
26
|
-
"""
|
|
27
|
-
# Validate length of the subscripts.
|
|
28
|
-
if message.num_subs + 1 != len(children):
|
|
29
|
-
raise ValueError(
|
|
30
|
-
f"invalid length of the subscripts, expect = {message.num_subs} but actual = {len(children) - 1}"
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
# NOTE: Import a module within a local scope to fix a circular import.
|
|
34
|
-
# - https://stackoverflow.com/questions/59462679/design-of-python-conditional-imports
|
|
35
|
-
# - https://medium.com/@hamana.hadrien/so-you-got-a-circular-import-in-python-e9142fe10591
|
|
36
|
-
from jijmodeling.protobuf.from_protobuf.message_to_expression import (
|
|
37
|
-
message_to_expression,
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
# Set the array.
|
|
41
|
-
array = message_to_expression(children[0])
|
|
42
|
-
|
|
43
|
-
# Set the subscripts.
|
|
44
|
-
subscripts = [message_to_expression(expr) for expr in children[1:]]
|
|
45
|
-
|
|
46
|
-
return Subscripts(variable=array, subscripts=subscripts, uuid=id)
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import jijmodeling_schema as pb
|
|
4
|
-
|
|
5
|
-
from jijmodeling.expression.mathfunc import (
|
|
6
|
-
AbsoluteValue,
|
|
7
|
-
Ceil,
|
|
8
|
-
Floor,
|
|
9
|
-
Log2,
|
|
10
|
-
UnaryOperator,
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def message_to_unary_op(
|
|
15
|
-
id: str, message: pb.UnaryOp, operand: pb.Expression
|
|
16
|
-
) -> UnaryOperator:
|
|
17
|
-
"""
|
|
18
|
-
Convert a message to a `UnaryOperator` object.
|
|
19
|
-
|
|
20
|
-
Args:
|
|
21
|
-
id (str): the id of the `UnaryOperator` object
|
|
22
|
-
message (pb.UnaryOp): the `UnaryOp` message
|
|
23
|
-
operand (pb.Expression): the operand node that the `UnaryOp` message has
|
|
24
|
-
|
|
25
|
-
Raises:
|
|
26
|
-
TypeError: the error happens if the message cannot be converted to a `UnaryOperator` object
|
|
27
|
-
|
|
28
|
-
Returns:
|
|
29
|
-
UnaryOperator: a `UnaryOperator` object
|
|
30
|
-
"""
|
|
31
|
-
# NOTE: Import a module within a local scope to fix a circular import.
|
|
32
|
-
# - https://stackoverflow.com/questions/59462679/design-of-python-conditional-imports
|
|
33
|
-
# - https://medium.com/@hamana.hadrien/so-you-got-a-circular-import-in-python-e9142fe10591
|
|
34
|
-
from jijmodeling.protobuf.from_protobuf.message_to_expression import (
|
|
35
|
-
message_to_expression,
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
if message.kind == pb.UnaryOpKind.ABS:
|
|
39
|
-
return AbsoluteValue(uuid=id, operand=message_to_expression(operand))
|
|
40
|
-
elif message.kind == pb.UnaryOpKind.CEIL:
|
|
41
|
-
return Ceil(uuid=id, operand=message_to_expression(operand))
|
|
42
|
-
elif message.kind == pb.UnaryOpKind.FLOOR:
|
|
43
|
-
return Floor(uuid=id, operand=message_to_expression(operand))
|
|
44
|
-
elif message.kind == pb.UnaryOpKind.LOG2:
|
|
45
|
-
return Log2(uuid=id, operand=message_to_expression(operand))
|
|
46
|
-
else:
|
|
47
|
-
raise TypeError(f"cannot convert the unary operator to an expression")
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
from pkgutil import extend_path
|
|
2
|
-
|
|
3
|
-
__path__ = extend_path(__path__, __name__)
|
|
4
|
-
|
|
5
|
-
import jijmodeling.protobuf.to_protobuf.add_header_to_message as add_header_to_message
|
|
6
|
-
import jijmodeling.protobuf.to_protobuf.array_shape_to_message as array_shape_to_message
|
|
7
|
-
import jijmodeling.protobuf.to_protobuf.binary_op_to_message as binary_op_to_message
|
|
8
|
-
import jijmodeling.protobuf.to_protobuf.binary_var_to_message as binary_var_to_message
|
|
9
|
-
import jijmodeling.protobuf.to_protobuf.constraint_to_message as constraint_to_message
|
|
10
|
-
import jijmodeling.protobuf.to_protobuf.element_to_message as element_to_message
|
|
11
|
-
import jijmodeling.protobuf.to_protobuf.expression_to_message as expression_to_message
|
|
12
|
-
import jijmodeling.protobuf.to_protobuf.forall_to_message as forall_to_message
|
|
13
|
-
import jijmodeling.protobuf.to_protobuf.integer_var_to_message as integer_var_to_message
|
|
14
|
-
import jijmodeling.protobuf.to_protobuf.jagged_array_to_message as jagged_array_to_message
|
|
15
|
-
import jijmodeling.protobuf.to_protobuf.number_lit_to_message as number_lit_to_message
|
|
16
|
-
import jijmodeling.protobuf.to_protobuf.penalty_to_message as penalty_to_message
|
|
17
|
-
import jijmodeling.protobuf.to_protobuf.placeholder_to_message as placeholder_to_message
|
|
18
|
-
import jijmodeling.protobuf.to_protobuf.problem_to_message as problem_to_message
|
|
19
|
-
import jijmodeling.protobuf.to_protobuf.reduction_op_to_message as reduction_op_to_message
|
|
20
|
-
import jijmodeling.protobuf.to_protobuf.subscript_op_to_message as subscript_op_to_message
|
|
21
|
-
import jijmodeling.protobuf.to_protobuf.to_protobuf as to_protobuf
|
|
22
|
-
import jijmodeling.protobuf.to_protobuf.unary_op_to_message as unary_op_to_message
|
|
23
|
-
|
|
24
|
-
__all__ = [
|
|
25
|
-
"add_header_to_message",
|
|
26
|
-
"array_shape_to_message",
|
|
27
|
-
"binary_op_to_message",
|
|
28
|
-
"binary_var_to_message",
|
|
29
|
-
"constraint_to_message",
|
|
30
|
-
"element_to_message",
|
|
31
|
-
"expression_to_message",
|
|
32
|
-
"forall_to_message",
|
|
33
|
-
"integer_var_to_message",
|
|
34
|
-
"jagged_array_to_message",
|
|
35
|
-
"number_lit_to_message",
|
|
36
|
-
"penalty_to_message",
|
|
37
|
-
"placeholder_to_message",
|
|
38
|
-
"problem_to_message",
|
|
39
|
-
"reduction_op_to_message",
|
|
40
|
-
"subscript_op_to_message",
|
|
41
|
-
"to_protobuf",
|
|
42
|
-
"unary_op_to_message",
|
|
43
|
-
]
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import Union
|
|
4
|
-
|
|
5
|
-
import jijmodeling_schema as pb
|
|
6
|
-
|
|
7
|
-
from ulid import ULID
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def add_header_to_message(message: Union[pb.Expression, pb.Problem]) -> pb.Header:
|
|
11
|
-
"""
|
|
12
|
-
Add header meta data to the `Expression` type message.
|
|
13
|
-
|
|
14
|
-
Args:
|
|
15
|
-
message (jijmodeling_schema.Expression): an `Expression` message
|
|
16
|
-
|
|
17
|
-
Returns:
|
|
18
|
-
jijmodeling_schema.Header: a `Header` message
|
|
19
|
-
"""
|
|
20
|
-
# Create an empty `Header` message.
|
|
21
|
-
header = pb.Header()
|
|
22
|
-
|
|
23
|
-
# Make the id of the `Header` message.
|
|
24
|
-
header.id = str(ULID())
|
|
25
|
-
|
|
26
|
-
# Set the version of the JijModeling schema.
|
|
27
|
-
header.version = "0.10.0"
|
|
28
|
-
|
|
29
|
-
# Set the target message to the `header.value`.
|
|
30
|
-
if type(message) is pb.Problem:
|
|
31
|
-
header.value.problem = message
|
|
32
|
-
elif type(message) is pb.Expression:
|
|
33
|
-
header.value.expression = message
|
|
34
|
-
|
|
35
|
-
return header
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import jijmodeling_schema as pb
|
|
4
|
-
|
|
5
|
-
from jijmodeling.expression.variables.placeholders import ArrayShape
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def array_shape_to_message(array_shape: ArrayShape) -> pb.Expression:
|
|
9
|
-
"""
|
|
10
|
-
Convert an `ArrayShape` object to an `Expression` message.
|
|
11
|
-
|
|
12
|
-
Args:
|
|
13
|
-
array_shape (ArrayShape): an `ArrayShape` object
|
|
14
|
-
|
|
15
|
-
Returns:
|
|
16
|
-
pb.Expression: an `Expression` message
|
|
17
|
-
"""
|
|
18
|
-
# Create an empty `ArrayShape` message.
|
|
19
|
-
array_shape_message = pb.ArrayShape()
|
|
20
|
-
|
|
21
|
-
# Set the number of axis
|
|
22
|
-
array_shape_message.axis = array_shape.dimension
|
|
23
|
-
|
|
24
|
-
# Create an empty `Expression` message.
|
|
25
|
-
message = pb.Expression()
|
|
26
|
-
|
|
27
|
-
# Set the id that the `ArrayShape` object has.
|
|
28
|
-
message.id = array_shape.uuid
|
|
29
|
-
|
|
30
|
-
# Set the kind of nodes to an `ArrayShape` message.
|
|
31
|
-
message.kind.array_shape = array_shape_message
|
|
32
|
-
|
|
33
|
-
# NOTE: Import a module within a local scope to fix a circular import.
|
|
34
|
-
# - https://stackoverflow.com/questions/59462679/design-of-python-conditional-imports
|
|
35
|
-
# - https://medium.com/@hamana.hadrien/so-you-got-a-circular-import-in-python-e9142fe10591
|
|
36
|
-
from jijmodeling.protobuf.to_protobuf.expression_to_message import (
|
|
37
|
-
expression_to_message,
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
# Set the array of the ArrayShape.
|
|
41
|
-
message.children.append(expression_to_message(array_shape.array))
|
|
42
|
-
|
|
43
|
-
return message
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import Union
|
|
4
|
-
|
|
5
|
-
import jijmodeling_schema as pb
|
|
6
|
-
|
|
7
|
-
from jijmodeling.expression.condition import (
|
|
8
|
-
AndOperator,
|
|
9
|
-
Condition,
|
|
10
|
-
Equal,
|
|
11
|
-
LessThan,
|
|
12
|
-
LessThanEqual,
|
|
13
|
-
NotEqual,
|
|
14
|
-
OrOperator,
|
|
15
|
-
XorOperator,
|
|
16
|
-
)
|
|
17
|
-
from jijmodeling.expression.expression import Add, BinaryOperator, Div, Mod, Mul, Power
|
|
18
|
-
from jijmodeling.expression.variables.variable import Range
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def binary_op_to_message(
|
|
22
|
-
binary_op: Union[BinaryOperator, Range, Condition]
|
|
23
|
-
) -> pb.Expression:
|
|
24
|
-
"""
|
|
25
|
-
Convert a `BinaryOperator | Range | Condition` object to an `Expression`.
|
|
26
|
-
|
|
27
|
-
message.
|
|
28
|
-
|
|
29
|
-
Args:
|
|
30
|
-
unary_op (BinaryOperator): an expression node that has two children
|
|
31
|
-
|
|
32
|
-
Returns:
|
|
33
|
-
pb.Expression: an `Expression` message
|
|
34
|
-
"""
|
|
35
|
-
# Create an empty `BinaryOp` message.
|
|
36
|
-
binary_op_message = pb.BinaryOp()
|
|
37
|
-
|
|
38
|
-
# Set the kind of the binary operator node.
|
|
39
|
-
# BinaryOp
|
|
40
|
-
if type(binary_op) is Add:
|
|
41
|
-
binary_op_message.kind = pb.BinaryOpKind.ADD
|
|
42
|
-
elif type(binary_op) is Mul:
|
|
43
|
-
binary_op_message.kind = pb.BinaryOpKind.MUL
|
|
44
|
-
elif type(binary_op) is Div:
|
|
45
|
-
binary_op_message.kind = pb.BinaryOpKind.DIV
|
|
46
|
-
elif type(binary_op) is Power:
|
|
47
|
-
binary_op_message.kind = pb.BinaryOpKind.POW
|
|
48
|
-
elif type(binary_op) is Mod:
|
|
49
|
-
binary_op_message.kind = pb.BinaryOpKind.MOD
|
|
50
|
-
# Range
|
|
51
|
-
elif type(binary_op) is Range:
|
|
52
|
-
binary_op_message.kind = pb.BinaryOpKind.RANGE
|
|
53
|
-
# ComparisonOp
|
|
54
|
-
elif type(binary_op) is Equal:
|
|
55
|
-
binary_op_message.kind = pb.BinaryOpKind.EQ
|
|
56
|
-
elif type(binary_op) is NotEqual:
|
|
57
|
-
binary_op_message.kind = pb.BinaryOpKind.NOT_EQ
|
|
58
|
-
elif type(binary_op) is LessThan:
|
|
59
|
-
binary_op_message.kind = pb.BinaryOpKind.LESS_THAN
|
|
60
|
-
elif type(binary_op) is LessThanEqual:
|
|
61
|
-
binary_op_message.kind = pb.BinaryOpKind.LESS_THAN_EQ
|
|
62
|
-
# LogicalOp
|
|
63
|
-
elif type(binary_op) is AndOperator:
|
|
64
|
-
binary_op_message.kind = pb.BinaryOpKind.AND
|
|
65
|
-
elif type(binary_op) is OrOperator:
|
|
66
|
-
binary_op_message.kind = pb.BinaryOpKind.OR
|
|
67
|
-
elif type(binary_op) is XorOperator:
|
|
68
|
-
binary_op_message.kind = pb.BinaryOpKind.XOR
|
|
69
|
-
# Otherwise
|
|
70
|
-
else:
|
|
71
|
-
raise TypeError(f"{binary_op.__class__.__name__} is not supported")
|
|
72
|
-
|
|
73
|
-
# Create an empty `Expression` message.
|
|
74
|
-
message = pb.Expression()
|
|
75
|
-
|
|
76
|
-
# Set the id that the `Expression` object has.
|
|
77
|
-
message.id = binary_op.uuid
|
|
78
|
-
|
|
79
|
-
# Set the kind of nodes to the `BinaryOp` message.
|
|
80
|
-
message.kind.binary_op = binary_op_message
|
|
81
|
-
|
|
82
|
-
# NOTE: Import a module within a local scope to fix a circular import.
|
|
83
|
-
# - https://stackoverflow.com/questions/59462679/design-of-python-conditional-imports
|
|
84
|
-
# - https://medium.com/@hamana.hadrien/so-you-got-a-circular-import-in-python-e9142fe10591
|
|
85
|
-
from jijmodeling.protobuf.to_protobuf.expression_to_message import (
|
|
86
|
-
expression_to_message,
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
if type(binary_op) is Range:
|
|
90
|
-
# Set the range of the `Range` object.
|
|
91
|
-
message.children.append(expression_to_message(binary_op.start))
|
|
92
|
-
message.children.append(expression_to_message(binary_op.last))
|
|
93
|
-
elif isinstance(binary_op, (BinaryOperator, Condition)):
|
|
94
|
-
# Set the children of the `BinaryOperator` object.
|
|
95
|
-
message.children.append(expression_to_message(binary_op.left))
|
|
96
|
-
message.children.append(expression_to_message(binary_op.right))
|
|
97
|
-
# Otherwise
|
|
98
|
-
else:
|
|
99
|
-
raise TypeError(f"{binary_op.__class__.__name__} is not supported")
|
|
100
|
-
|
|
101
|
-
return message
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import jijmodeling_schema as pb
|
|
4
|
-
|
|
5
|
-
from jijmodeling.expression.variables.deci_vars import Binary
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def binary_var_to_message(binary_var: Binary) -> pb.Expression:
|
|
9
|
-
"""
|
|
10
|
-
Convert a `Binary` object to an `BinaryVar` message.
|
|
11
|
-
|
|
12
|
-
Args:
|
|
13
|
-
binary_var (Binary): a `Binary` object.
|
|
14
|
-
|
|
15
|
-
Returns:
|
|
16
|
-
pb.Expression: an `Expression` message.
|
|
17
|
-
"""
|
|
18
|
-
# Create an empty `BinaryVar` message.
|
|
19
|
-
binary_var_message = pb.BinaryVar()
|
|
20
|
-
|
|
21
|
-
# Set the symbol.
|
|
22
|
-
binary_var_message.symbol = binary_var.label
|
|
23
|
-
|
|
24
|
-
# Set length of the shape.
|
|
25
|
-
binary_var_message.dim = binary_var.dim
|
|
26
|
-
|
|
27
|
-
# Create an empty `Expression` message.
|
|
28
|
-
message = pb.Expression()
|
|
29
|
-
|
|
30
|
-
# Set the id that the `Binary` object has.
|
|
31
|
-
message.id = binary_var.uuid
|
|
32
|
-
|
|
33
|
-
# Set the kind of nodes to a `BinaryVar` message.
|
|
34
|
-
message.kind.binary_var = binary_var_message
|
|
35
|
-
|
|
36
|
-
# NOTE: Import a module within a local scope to fix a circular import.
|
|
37
|
-
# - https://stackoverflow.com/questions/59462679/design-of-python-conditional-imports
|
|
38
|
-
# - https://medium.com/@hamana.hadrien/so-you-got-a-circular-import-in-python-e9142fe10591
|
|
39
|
-
from jijmodeling.protobuf.to_protobuf.expression_to_message import (
|
|
40
|
-
expression_to_message,
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
# Set the shape.
|
|
44
|
-
message.children = [
|
|
45
|
-
expression_to_message(shape_element) for shape_element in binary_var.shape
|
|
46
|
-
]
|
|
47
|
-
|
|
48
|
-
# Serialize the `Expression` object into a bytes object.
|
|
49
|
-
return message
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import jijmodeling_schema as pb
|
|
4
|
-
|
|
5
|
-
from ulid import ULID
|
|
6
|
-
|
|
7
|
-
from jijmodeling.expression.constraint import Constraint
|
|
8
|
-
from jijmodeling.protobuf.to_protobuf.expression_to_message import expression_to_message
|
|
9
|
-
from jijmodeling.protobuf.to_protobuf.forall_to_message import forall_to_message
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def constraint_to_message(constraint: Constraint) -> pb.Constraint:
|
|
13
|
-
"""
|
|
14
|
-
Convert a `Constraint` object into a `Constraint` message.
|
|
15
|
-
|
|
16
|
-
Args:
|
|
17
|
-
constraint (Constraint): a `Constraint` object
|
|
18
|
-
|
|
19
|
-
Returns:
|
|
20
|
-
pb.Constraint: a `Constraint` message
|
|
21
|
-
"""
|
|
22
|
-
# Create an empty `Constraint` message.
|
|
23
|
-
message = pb.Constraint()
|
|
24
|
-
|
|
25
|
-
# Set the id of the constraint.
|
|
26
|
-
message.id = str(ULID())
|
|
27
|
-
|
|
28
|
-
# Set the name of the constraint.
|
|
29
|
-
message.name = constraint.label
|
|
30
|
-
|
|
31
|
-
# Set the expression of the constraint.
|
|
32
|
-
message.expression = expression_to_message(constraint.condition)
|
|
33
|
-
|
|
34
|
-
# Set the list of forall.
|
|
35
|
-
message.forall.extend(
|
|
36
|
-
[
|
|
37
|
-
forall_to_message(element, condition)
|
|
38
|
-
for element, condition in constraint.forall
|
|
39
|
-
]
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
# Set the left_lower.
|
|
43
|
-
if constraint.left_lower is not None:
|
|
44
|
-
message.left_lower = expression_to_message(constraint.left_lower)
|
|
45
|
-
|
|
46
|
-
message.is_penalty = constraint.with_penalty
|
|
47
|
-
|
|
48
|
-
message.needs_multiplier = constraint.with_multiplier
|
|
49
|
-
|
|
50
|
-
message.needs_square = constraint.auto_qubo
|
|
51
|
-
|
|
52
|
-
return message
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import jijmodeling_schema as pb
|
|
4
|
-
|
|
5
|
-
from jijmodeling.expression.variables.variable import Element
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def element_to_message(element: Element) -> pb.Expression:
|
|
9
|
-
"""
|
|
10
|
-
Convert an `Element` object to an `Element` message.
|
|
11
|
-
|
|
12
|
-
Args:
|
|
13
|
-
element (Element): an `Element` object
|
|
14
|
-
|
|
15
|
-
Returns:
|
|
16
|
-
pb.Expression: an `Element` message
|
|
17
|
-
"""
|
|
18
|
-
# Create an empty `ArrayShape` message.
|
|
19
|
-
element_message = pb.Element()
|
|
20
|
-
|
|
21
|
-
# Set the symbol
|
|
22
|
-
element_message.symbol = element.label
|
|
23
|
-
|
|
24
|
-
# Create an empty `Expression` message.
|
|
25
|
-
message = pb.Expression()
|
|
26
|
-
|
|
27
|
-
# Set the id that the `Element` object has.
|
|
28
|
-
message.id = element.uuid
|
|
29
|
-
|
|
30
|
-
# Set the kind of nodes to an `ArrayShape` message.
|
|
31
|
-
message.kind.element = element_message
|
|
32
|
-
|
|
33
|
-
# NOTE: Import a module within a local scope to fix a circular import.
|
|
34
|
-
# - https://stackoverflow.com/questions/59462679/design-of-python-conditional-imports
|
|
35
|
-
# - https://medium.com/@hamana.hadrien/so-you-got-a-circular-import-in-python-e9142fe10591
|
|
36
|
-
from jijmodeling.protobuf.to_protobuf.expression_to_message import (
|
|
37
|
-
expression_to_message,
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
# Set the parent of the `Element` object.
|
|
41
|
-
message.children.append(expression_to_message(element.parent))
|
|
42
|
-
|
|
43
|
-
return message
|