Skip to content

Commit 9d724b8

Browse files
committed
chore: Remove duplicated char
1 parent 486a391 commit 9d724b8

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

resources/mosek.lp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ minimize
33
system_cost: + 2e-01 Gen_001d01h01 + 2e-01 Gen_001d01h02 + 2e-01 Gen_001d01h03 + 2e-01 Gen_001d01h04 + 2e-01 Gen_001d01h05 + 2e-01 Gen_001d01h06 + 2e-01 Gen_001d01h07 + 2e-01 Gen_001d01h08 + 2e-01 Gen_001d01h09 + 2e-01 Gen_001d01h10
44
+ 2e-01 Gen_001d01h11 + 2e-01 Gen_001d01h12 + 2e-01 Gen_001d01h13 + 2e-01 Gen_001d01h14 + 2e-01 Gen_001d01h15 + 2e-01 Gen_001d01h16 + 2e-01 Gen_001d01h17 + 2e-01 Gen_001d01h18 + 2e-01 Gen_001d01h19 + 2e-01 Gen_001d01h20
55
Subject To
6-
dummy_constraint: Gen_001d01h01 + Gen_001d01h02 <= 1000
6+
dummy_constraint: Gen_001d01h01 + Gen_001d01h02 + 59.983048643 SO_0_ThPl_GB.Steven's.Croft.(4494) - 0.200000000 STU_7_HyRes_AL.AGG.Hydro.Res.(2857) <= 1000
77
Bounds
88
0 <= Gen_001d01h01 <= 1.0
99
0 <= Gen_001d01h02 <= +infinity

src/lp_file_format.pest

+5-7
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ VALID_COMMENT_CHARS = _{
4545
| "@"
4646
| "_"
4747
| "‘"
48-
| "’"
4948
| "{"
5049
| "}"
5150
| "~"
@@ -74,20 +73,19 @@ VALID_LP_CHARS = _{
7473
| "@"
7574
| "_"
7675
| "‘"
77-
| "’"
7876
| "{"
7977
| "}"
8078
| "~"
79+
| "'"
8180
}
82-
VARIABLE_SUBSET = ${
81+
VARIABLE_SUBSET = ${
8382
!(
8483
FREE | END | SOS_SECTION | CONSTRAINT_SECTION | BOUND_SECTION | BINARIES_SECTION | SEMI_CONTINUOUS_SECTION
8584
) ~ VALID_LP_CHARS{1, 255}
8685
}
87-
VARIABLE = ${
86+
VARIABLE = ${
8887
!(
89-
FREE | END | SOS_SECTION | CONSTRAINT_SECTION | BOUND_SECTION
90-
| GENERALS_SECTION | BINARIES_SECTION | SEMI_CONTINUOUS_SECTION
88+
FREE | END | SOS_SECTION | CONSTRAINT_SECTION | BOUND_SECTION | GENERALS_SECTION | BINARIES_SECTION | SEMI_CONTINUOUS_SECTION
9189
) ~ VALID_LP_CHARS{1, 255}
9290
}
9391

@@ -122,7 +120,7 @@ OBJECTIVES = { OBJECTIVE* }
122120
// Constraints
123121
// https://www.ibm.com/docs/en/icos/22.1.1?topic=representation-constraints-in-lp-file-format
124122
CONSTRAINT_SECTION = _{
125-
(^"subject to" | ^"such that" | ^"S.T." | ^"st") ~ COLON? ~ NEWLINE*
123+
(^"subject to" | ^"such that" | ^"S.T." | ^"st") ~ COLON? ~ NEWLINE+
126124
}
127125
GT = { ">" }
128126
GTE = { ">=" }

tests/snapshots/test_from_file__mosek.snap

+6
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ variables:
3333
Gen_001d01h18: General
3434
Gen_001d01h19: General
3535
Gen_001d01h20: General
36+
"SO_0_ThPl_GB.Steven's.Croft.(4494)": General
37+
STU_7_HyRes_AL.AGG.Hydro.Res.(2857): General
3638
objectives:
3739
- name: system_cost
3840
coefficients:
@@ -85,5 +87,9 @@ constraints:
8587
coefficient: 1
8688
- var_name: Gen_001d01h02
8789
coefficient: 1
90+
- var_name: "SO_0_ThPl_GB.Steven's.Croft.(4494)"
91+
coefficient: 59.983048643
92+
- var_name: STU_7_HyRes_AL.AGG.Hydro.Res.(2857)
93+
coefficient: -0.2
8894
sense: "<="
8995
rhs: 1000

0 commit comments

Comments
 (0)