forked from MIT-Lu-Lab/cuPDLPx
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPDLP.py
More file actions
63 lines (59 loc) · 2.03 KB
/
Copy pathPDLP.py
File metadata and controls
63 lines (59 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright 2025 Haihao Lu
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Objective
MINIMIZE = 1
MAXIMIZE = -1
# Status codes
OPTIMAL = 0
PRIMAL_INFEASIBLE = 1
DUAL_INFEASIBLE = 2
TIME_LIMIT = 3
ITERATION_LIMIT = 4
UNSPECIFIED = -1
# parameter name alias
_PARAM_ALIAS = {
# limits / logging
"TimeLimit": "time_sec_limit",
"IterationLimit": "iteration_limit",
"OutputFlag": "verbose",
"LogToConsole": "verbose",
# termination evaluation cadence
"TermCheckFreq": "termination_evaluation_frequency",
# tolerances
"OptimalityTol": "eps_optimal_relative",
"FeasibilityTol": "eps_feasible_relative",
# scaling / step size
"RuizIters": "l_inf_ruiz_iterations",
"UsePCAlpha": "has_pock_chambolle_alpha",
"PCAlpha": "pock_chambolle_alpha",
"BoundObjRescaling": "bound_objective_rescaling",
# restarts
"RestartArtificialThresh": "artificial_restart_threshold",
"RestartSufficientReduction": "sufficient_reduction_for_restart",
"RestartNecessaryReduction": "necessary_reduction_for_restart",
"RestartKp": "k_p",
# reflection
"ReflectionCoeff": "reflection_coefficient",
# feasibility polishing
"FeasibilityPolishing": "feasibility_polishing",
"FeasibilityPolishingTol": "eps_feas_polish_relative",
# termination criteria
"OptimalityNorm": "optimality_norm",
# singular value estimation (power method)
"SVMaxIter": "sv_max_iter",
"SVTol": "sv_tol",
# presolve
"Presolve": "presolve",
"MatrixZeroTol": "matrix_zero_tol",
}