Skip to content

Commit 3d93ebc

Browse files
authored
Standardize naming conventions (#63)
1 parent ea29705 commit 3d93ebc

34 files changed

+784
-784
lines changed

docs/src/manual/linear_systems.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ Here is a list of currently supported linear solvers:
4949

5050
| Linear solver type | System | Backend | Method |
5151
|:-------------------|:-------|:--------|:-------|
52-
| [`Dense_SymPosDef`](@ref) | Normal equations | Dense / LAPACK | Cholesky
53-
| [`Cholmod_SymQuasDef`](@ref) | Augmented system | CHOLMOD | LDLᵀ
54-
| [`Cholmod_SymPosDef`](@ref) | Normal equations | CHOLMOD | Cholesky
55-
| [`LDLFact_SymQuasDef`](@ref) | Augmented system | [LDLFactorizations.jl](https://github.com/JuliaSmoothOptimizers/LDLFactorizations.jl) | LDLᵀ
56-
| [`KrylovSPDSolver`](@ref) | Normal equations | [Krylov.jl](https://github.com/JuliaSmoothOptimizers/Krylov.jl) | Krylov
57-
| [`KrylovSIDSolver`](@ref) | Augmented system[^1] | [Krylov.jl](https://github.com/JuliaSmoothOptimizers/Krylov.jl) | Krylov
58-
| [`KrylovSQDSolver`](@ref) | Augmented system[^1] | [Krylov.jl](https://github.com/JuliaSmoothOptimizers/Krylov.jl) | Krylov
59-
60-
[^1]: [`KrylovSIDSolver`](@ref)s view the augmented system as a symmetric indefinite system,
61-
while [`KrylovSQDSolver`](@ref)s exploit its 2x2 structure and quasi-definite property.
52+
| [`DenseSPD`](@ref) | Normal equations | Dense / LAPACK | Cholesky
53+
| [`CholmodSQD`](@ref) | Augmented system | CHOLMOD | LDLᵀ
54+
| [`CholmodSPD`](@ref) | Normal equations | CHOLMOD | Cholesky
55+
| [`LDLFactSQD`](@ref) | Augmented system | [LDLFactorizations.jl](https://github.com/JuliaSmoothOptimizers/LDLFactorizations.jl) | LDLᵀ
56+
| [`KrylovSPD`](@ref) | Normal equations | [Krylov.jl](https://github.com/JuliaSmoothOptimizers/Krylov.jl) | Krylov
57+
| [`KrylovSID`](@ref) | Augmented system[^1] | [Krylov.jl](https://github.com/JuliaSmoothOptimizers/Krylov.jl) | Krylov
58+
| [`KrylovSQD`](@ref) | Augmented system[^1] | [Krylov.jl](https://github.com/JuliaSmoothOptimizers/Krylov.jl) | Krylov
59+
60+
[^1]: [`KrylovSID`](@ref)s view the augmented system as a symmetric indefinite system,
61+
while [`KrylovSQD`](@ref)s exploit its 2x2 structure and quasi-definite property.
6262
See the reference documentation for more details.

docs/src/reference/kkt_solvers.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ CurrentModule = Tulip.KKT
4444
## Dense/LAPACK
4545

4646
```@docs
47-
Dense_SymPosDef
47+
DenseSPD
4848
```
4949

5050
## CHOLMOD
@@ -54,17 +54,17 @@ CholmodSolver
5454
```
5555

5656
```@docs
57-
Cholmod_SymQuasDef
57+
CholmodSQD
5858
```
5959

6060
```@docs
61-
Cholmod_SymPosDef
61+
CholmodSPD
6262
```
6363

6464
## LDLFactorizations
6565

6666
```@docs
67-
LDLFact_SymQuasDef
67+
LDLFactSQD
6868
```
6969

7070
## Krylov
@@ -75,13 +75,13 @@ LDLFact_SymQuasDef
7575

7676

7777
```@docs
78-
KrylovSPDSolver
78+
KrylovSPD
7979
```
8080

8181
```@docs
82-
KrylovSIDSolver
82+
KrylovSID
8383
```
8484

8585
```@docs
86-
KrylovSQDSolver
86+
KrylovSQD
8787
```

docs/src/reference/parameters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Numerical tolerances for the interior-point algorithm.
4242
| Parameter | Description | Default |
4343
|:----------|:------------|:--------|
4444
| `MatrixOptions` | See [`TLA.MatrixOptions`](@ref) | `SparseMatrixCSC`
45-
| `KKTOptions` | See [`KKT.SolverOptions`](@ref) | [`KKT.Cholmod_SymQuasDef`](@ref) for `Float64`, [`KKT.LDLFact_SymQuasDef`](@ref) otherwise |
45+
| `KKTOptions` | See [`KKT.SolverOptions`](@ref) | [`KKT.CholmodSQD`](@ref) for `Float64`, [`KKT.LDLFactSQD`](@ref) otherwise |
4646
| `BarrierPRegMin` | Minimum value of primal regularization | ``\sqrt{\epsilon}`` |
4747
| `BarrierDregMin` | Minimum value of dual regularization | ``\sqrt{\epsilon}``
4848

src/Interfaces/MOI/MOI_wrapper.jl

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ end
5353
_bounds(s)
5454
5555
"""
56-
_bounds(s::MOI.EqualTo{Tv}) where{Tv} = s.value, s.value
57-
_bounds(s::MOI.LessThan{Tv}) where{Tv} = Tv(-Inf), s.upper
58-
_bounds(s::MOI.GreaterThan{Tv}) where{Tv} = s.lower, Tv(Inf)
59-
_bounds(s::MOI.Interval{Tv}) where{Tv} = s.lower, s.upper
56+
_bounds(s::MOI.EqualTo{T}) where{T} = s.value, s.value
57+
_bounds(s::MOI.LessThan{T}) where{T} = T(-Inf), s.upper
58+
_bounds(s::MOI.GreaterThan{T}) where{T} = s.lower, T(Inf)
59+
_bounds(s::MOI.Interval{T}) where{T} = s.lower, s.upper
6060

61-
const SCALAR_SETS{Tv} = Union{
62-
MOI.LessThan{Tv},
63-
MOI.GreaterThan{Tv},
64-
MOI.EqualTo{Tv},
65-
MOI.Interval{Tv}
66-
} where{Tv}
61+
const SCALAR_SETS{T} = Union{
62+
MOI.LessThan{T},
63+
MOI.GreaterThan{T},
64+
MOI.EqualTo{T},
65+
MOI.Interval{T}
66+
} where{T}
6767

6868

6969

@@ -76,12 +76,12 @@ const SCALAR_SETS{Tv} = Union{
7676
# ==============================================================================
7777

7878
"""
79-
Optimizer{Tv}
79+
Optimizer{T}
8080
8181
Wrapper for MOI.
8282
"""
83-
mutable struct Optimizer{Tv} <: MOI.AbstractOptimizer
84-
inner::Model{Tv}
83+
mutable struct Optimizer{T} <: MOI.AbstractOptimizer
84+
inner::Model{T}
8585

8686
is_feas::Bool # Model is feasibility problem if true
8787

@@ -91,7 +91,7 @@ mutable struct Optimizer{Tv} <: MOI.AbstractOptimizer
9191
var_indices_moi::Vector{MOI.VariableIndex}
9292
var_indices::Dict{MOI.VariableIndex, Int}
9393
con_indices_moi::Vector{MOI.ConstraintIndex}
94-
con_indices::Dict{MOI.ConstraintIndex{MOI.ScalarAffineFunction{Tv}, <:SCALAR_SETS{Tv}}, Int}
94+
con_indices::Dict{MOI.ConstraintIndex{MOI.ScalarAffineFunction{T}, <:SCALAR_SETS{T}}, Int}
9595

9696
# Variable and constraint names
9797
name2var::Dict{String, MOI.VariableIndex}
@@ -104,14 +104,14 @@ mutable struct Optimizer{Tv} <: MOI.AbstractOptimizer
104104
# Keep track of bound constraints
105105
var2bndtype::Dict{MOI.VariableIndex, Set{Type{<:MOI.AbstractScalarSet}}}
106106

107-
function Optimizer{Tv}(;kwargs...) where{Tv}
108-
m = new{Tv}(
109-
Model{Tv}(), false,
107+
function Optimizer{T}(;kwargs...) where{T}
108+
m = new{T}(
109+
Model{T}(), false,
110110
# Variable and constraint counters
111111
0, 0,
112112
# Index mapping
113113
MOI.VariableIndex[], Dict{MOI.VariableIndex, Int}(),
114-
MOI.ConstraintIndex[], Dict{MOI.ConstraintIndex{MOI.ScalarAffineFunction, <:SCALAR_SETS{Tv}}, Int}(),
114+
MOI.ConstraintIndex[], Dict{MOI.ConstraintIndex{MOI.ScalarAffineFunction, <:SCALAR_SETS{T}}, Int}(),
115115
# Name -> index mapping
116116
Dict{String, MOI.VariableIndex}(), Dict{String, MOI.ConstraintIndex}(),
117117
Dict{MOI.ConstraintIndex, String}(), # Variable bounds tracking

src/Interfaces/MOI/attributes.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ MOI.get(m::Optimizer, ::MOI.NumberOfVariables) = m.inner.pbdata.nvar
111111
# ObjectiveFunctionType
112112
#
113113
MOI.get(
114-
m::Optimizer{Tv}, ::MOI.ObjectiveFunctionType
115-
) where{Tv} = MOI.ScalarAffineFunction{Tv}
114+
m::Optimizer{T}, ::MOI.ObjectiveFunctionType
115+
) where{T} = MOI.ScalarAffineFunction{T}
116116

117117
#
118118
# ObjectiveSense
@@ -140,15 +140,15 @@ end
140140
#
141141
# ObjectiveValue
142142
#
143-
function MOI.get(m::Optimizer{Tv}, attr::MOI.ObjectiveValue) where{Tv}
143+
function MOI.get(m::Optimizer{T}, attr::MOI.ObjectiveValue) where{T}
144144
MOI.check_result_index_bounds(m, attr)
145145
return get_attribute(m.inner, ObjectiveValue())
146146
end
147147

148148
#
149149
# DualObjectiveValue
150150
#
151-
function MOI.get(m::Optimizer{Tv}, attr::MOI.DualObjectiveValue) where{Tv}
151+
function MOI.get(m::Optimizer{T}, attr::MOI.DualObjectiveValue) where{T}
152152
MOI.check_result_index_bounds(m, attr)
153153
return get_attribute(m.inner, DualObjectiveValue())
154154
end
@@ -161,11 +161,11 @@ MOI.get(m::Optimizer, ::MOI.RawSolver) = m.inner
161161
#
162162
# RelativeGap
163163
#
164-
function MOI.get(m::Optimizer{Tv}, ::MOI.RelativeGap) where{Tv}
164+
function MOI.get(m::Optimizer{T}, ::MOI.RelativeGap) where{T}
165165
# TODO: dispatch a function call on m.inner
166166
zp = m.inner.solver.primal_bound_scaled
167167
zd = m.inner.solver.dual_bound_scaled
168-
return (abs(zp - zd) / (Tv(1 // 10^6)) + abs(zd))
168+
return (abs(zp - zd) / (T(1 // 10^6)) + abs(zd))
169169
end
170170

171171
#

0 commit comments

Comments
 (0)