Skip to content

Commit a9abe2e

Browse files
Merge pull request #68 from nextmv-io/develop
Release v0.18.0
2 parents f02c634 + b59b1de commit a9abe2e

5 files changed

+35
-1
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.17.0
1+
v0.18.0

mip/example_constraint_test.go

+8
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ func ExampleConstraint_greaterThanEqual() {
1414

1515
fmt.Println(c.Sense())
1616
fmt.Println(c.RightHandSide())
17+
fmt.Println(c)
1718
// Output:
1819
// 2
1920
// 1
21+
// >= 1
2022
}
2123

2224
func ExampleConstraint_equal() {
@@ -26,9 +28,11 @@ func ExampleConstraint_equal() {
2628

2729
fmt.Println(c.Sense())
2830
fmt.Println(c.RightHandSide())
31+
fmt.Println(c)
2932
// Output:
3033
// 1
3134
// 1
35+
// = 1
3236
}
3337

3438
func ExampleConstraint_lessThanOrEqual() {
@@ -38,9 +42,11 @@ func ExampleConstraint_lessThanOrEqual() {
3842

3943
fmt.Println(c.Sense())
4044
fmt.Println(c.RightHandSide())
45+
fmt.Println(c)
4146
// Output:
4247
// 0
4348
// 1
49+
// <= 1
4450
}
4551

4652
func ExampleConstraint_terms() {
@@ -57,12 +63,14 @@ func ExampleConstraint_terms() {
5763
fmt.Println(t2.Coefficient())
5864
fmt.Println(len(c.Terms()))
5965
fmt.Println(c.Terms()[0].Coefficient())
66+
fmt.Println(c)
6067
// Output:
6168
// 0
6269
// 1
6370
// 2
6471
// 1
6572
// 3
73+
// 3 B0 = 1
6674
}
6775

6876
func benchmarkNewConstraintNewTerms(nrTerms int, b *testing.B) {

mip/example_model_test.go

+8
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ func ExampleModel_empty() {
1313
fmt.Println(len(model.Vars()))
1414
fmt.Println(len(model.Objective().Terms()))
1515
fmt.Println(model.Objective().IsMaximize())
16+
fmt.Println(model)
1617
// Output:
1718
// 0
1819
// 0
1920
// 0
2021
// false
22+
// minimize
2123
}
2224

2325
func ExampleModel_queries() {
@@ -43,7 +45,13 @@ func ExampleModel_queries() {
4345

4446
fmt.Println(len(model.Vars()))
4547
fmt.Println(len(model.Constraints()))
48+
fmt.Println(model)
4649
// Output:
4750
// 3
4851
// 1
52+
// minimize
53+
// 0: = 0
54+
// 0: B0 [0, 1]
55+
// 1: C1 [1, 2]
56+
// 2: B2 [0, 1]
4957
}

mip/example_objective_test.go

+12
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ func ExampleObjective_sense() {
1313
model.Objective().SetMaximize()
1414

1515
fmt.Println(model.Objective().IsMaximize())
16+
fmt.Println(model.Objective())
1617

1718
model.Objective().SetMinimize()
1819

1920
fmt.Println(model.Objective().IsMaximize())
21+
fmt.Println(model.Objective())
2022
// Output:
2123
// true
24+
// maximize
2225
// false
26+
// minimize
2327
}
2428

2529
func ExampleObjective_terms() {
@@ -31,8 +35,11 @@ func ExampleObjective_terms() {
3135
fmt.Println(len(model.Objective().Terms()))
3236

3337
t1 := model.Objective().NewTerm(2.0, v1)
38+
fmt.Println(t1)
3439
t2 := model.Objective().NewTerm(1.0, v1)
40+
fmt.Println(t2)
3541
t3 := model.Objective().NewTerm(3.0, v2)
42+
fmt.Println(t3)
3643

3744
fmt.Println(t1.Var().Index())
3845
fmt.Println(t1.Coefficient())
@@ -45,8 +52,12 @@ func ExampleObjective_terms() {
4552

4653
fmt.Println(len(model.Objective().Terms()))
4754
fmt.Println(model.Objective().Terms()[0].Coefficient())
55+
fmt.Println(model.Objective())
4856
// Output:
4957
// 0
58+
// 2 B0
59+
// 1 B0
60+
// 3 B1
5061
// 0
5162
// 2
5263
// 0
@@ -55,6 +66,7 @@ func ExampleObjective_terms() {
5566
// 3
5667
// 2
5768
// 3
69+
// minimize 3 B0 + 3 B1
5870
}
5971

6072
func benchmarkObjectiveNewTerms(nrTerms int, b *testing.B) {

mip/example_var_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ func ExampleVar_continuous() {
2020
fmt.Println(v.IsContinuous())
2121
fmt.Println(v.IsInteger())
2222
fmt.Println(v.IsBinary())
23+
fmt.Println(v)
2324
// Output:
2425
// -1
2526
// 1
2627
// true
2728
// false
2829
// false
30+
// C0
2931
}
3032

3133
func ExampleVar_integer() {
@@ -41,12 +43,14 @@ func ExampleVar_integer() {
4143
fmt.Println(v.IsContinuous())
4244
fmt.Println(v.IsInteger())
4345
fmt.Println(v.IsBinary())
46+
fmt.Println(v)
4447
// Output:
4548
// -1
4649
// 1
4750
// false
4851
// true
4952
// false
53+
// I0
5054
}
5155

5256
func ExampleVar_binary() {
@@ -62,12 +66,14 @@ func ExampleVar_binary() {
6266
fmt.Println(v.IsContinuous())
6367
fmt.Println(v.IsInteger())
6468
fmt.Println(v.IsBinary())
69+
fmt.Println(v)
6570
// Output:
6671
// 0
6772
// 1
6873
// false
6974
// true
7075
// true
76+
// B0
7177
}
7278

7379
func ExampleVar_vars() {

0 commit comments

Comments
 (0)