Skip to content

Commit

Permalink
Add sense field to Instance (#28)
Browse files Browse the repository at this point in the history
# 変更点

OMMX::Instanceが意味する最適化問題が最小化問題であるか最大化問題であるかが判別できないという課題があった為、senseを追加しました。

# 確認事項

こちらの変更後、Pythonパッケージをv0.1.2として、Rustクレートをv0.1.1としてリリースしても良いでしょうか?(バージョニングは適切でしょうか?)

---------

Co-authored-by: Toshiki Teramura <toshiki.teramura@gmail.com>
  • Loading branch information
NY57 and termoshtt authored Apr 23, 2024
1 parent 1c60033 commit e0f5114
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 8 deletions.
14 changes: 14 additions & 0 deletions proto/ommx/v1/instance.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,18 @@ message Instance {
//
// TODO: Add semi-definite constraints to represent SDP
// repeated SemiDefiniteConstraint semi_definite_constraints = ?;

// The sense of this instance
enum Sense {
SENSE_UNSPECIFIED = 0;
SENSE_MINIMIZE = 1;
SENSE_MAXIMIZE = 2;
}

// The sense of this problem, i.e. minimize the objective or maximize it.
//
// Design decision note:
// - This is a required field. Most mathematical modeling tools allow for an empty sense and default to minimization. Alternatively, some tools do not create such a field and represent maximization problems by negating the objective function. This project prefers explicit descriptions over implicit ones to avoid such ambiguity and to make it unnecessary for developers to look up the reference for the treatment of omitted cases.
//
Sense sense = 5;
}
10 changes: 6 additions & 4 deletions python/ommx/v1/instance_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 39 additions & 1 deletion python/ommx/v1/instance_pb2.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ommx"
version = "0.1.1"
version = "0.2.0"
description = "Open Mathematical prograMming eXchange (OMMX)"
authors = [
{ name="Jij Inc.", email="info@j-ij.com" },
Expand Down
2 changes: 1 addition & 1 deletion rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/ommx/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ommx"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
license = "MIT OR Apache-2.0"

Expand Down
37 changes: 37 additions & 0 deletions rust/ommx/src/ommx.v1.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e0f5114

Please # to comment.