@@ -10,6 +10,7 @@ Represent a Mixed Integer Linear Program in "cuPDLPx form":
1010
1111 MILP(;
1212 c, lv, uv, A, lc, uc,
13+ At=sametype_transpose(A),
1314 [D1, D2, int_var, var_names, dataset, name, path]
1415 )
1516
@@ -21,6 +22,7 @@ struct MILP{
2122 T <: Number ,
2223 V <: DenseVector{T} ,
2324 M <: AbstractMatrix{T} ,
25+ Mt <: AbstractMatrix{T} ,
2426 Vb <: DenseVector{Bool} ,
2527 }
2628 " objective vector"
@@ -32,7 +34,7 @@ struct MILP{
3234 " constraint matrix"
3335 A:: M
3436 " transposed constraint matrix"
35- At:: M
37+ At:: Mt
3638 " constraint lower bound"
3739 lc:: V
3840 " constraint upper bound"
@@ -57,7 +59,7 @@ struct MILP{
5759 lv,
5860 uv,
5961 A,
60- At = convert ( typeof (A), transpose (A) ),
62+ At = sametype_transpose (A ),
6163 lc,
6264 uc,
6365 D1 = Diagonal (one! (similar (lc))),
@@ -77,13 +79,15 @@ struct MILP{
7779
7880 T = Base. promote_eltype (c, lv, uv, A, At, lc, uc, D1, D2)
7981 V = promote_type (typeof (c), typeof (lv), typeof (uv), typeof (lc), typeof (uc))
80- M = promote_type (typeof (A), typeof (At))
82+ M = typeof (A)
83+ Mt = typeof (At)
8184 Vb = typeof (int_var)
8285
8386 if (
8487 ! isconcretetype (T) ||
8588 ! isconcretetype (V) ||
8689 ! isconcretetype (M) ||
90+ ! isconcretetype (Mt) ||
8791 ! isconcretetype (Vb)
8892 )
8993 throw (ArgumentError (" Abstract type parameter" ))
@@ -95,7 +99,7 @@ struct MILP{
9599 name = splitext (splitpath (path)[end ])[1 ]
96100 end
97101
98- return new {T, V, M, Vb} (
102+ return new {T, V, M, Mt, Vb} (
99103 c,
100104 lv,
101105 uv,
@@ -136,14 +140,14 @@ function MILP(qps::QPSData; kwargs...)
136140 )
137141end
138142
139- function Base. show (io:: IO , milp:: MILP{T, V, M} ) where {T, V, M}
143+ function Base. show (io:: IO , milp:: MILP{T, V, M, Mt } ) where {T, V, M, Mt }
140144 return print (
141145 io, """
142146 MILP instance $(milp. name) from dataset $(milp. dataset) :
143147 - types:
144148 - values $T
145149 - vectors $V
146- - matrices $M
150+ - matrices $(M == Mt ? M : (M, Mt))
147151 - variables: $(nbvar (milp))
148152 - $(nbvar_cont (milp)) continuous
149153 - $(nbvar_int (milp)) integer
0 commit comments