35
35
function _quadraticproblem (N:: Int ; mat:: AbstractArray{T,2} = spdiagm (float (1 : N)),
36
36
x0:: AbstractVector{T} = ones (N),
37
37
initial_x:: AbstractVector{T} = zeros (N),
38
- name:: AbstractString = " Quadratic Diagonal ($N )" ) where T
38
+ name:: AbstractString = " Quadratic Diagonal ($N )" ) where T <: Number
39
39
# Note that _quadraticproblem is a special case of
40
40
# _paraboloidproblem, where param.alpha = 0.0
41
41
OptimizationProblem (name,
@@ -59,7 +59,6 @@ examples["Quadratic Diagonal"] = _quadraticproblem(100)
59
59
60
60
immutable ParaboloidStruct{T, Tm <: AbstractArray{T,2} ,
61
61
Tv <: AbstractArray{T} } <: Any where T<: Number
62
-
63
62
mat:: Tm
64
63
vec:: Tv
65
64
xt:: Tv
@@ -108,14 +107,14 @@ function _paraboloidproblem(N::Int; mat::AbstractArray{T,2} = spdiagm(float(1:N)
108
107
x0:: AbstractVector{T} = ones (N),
109
108
initial_x:: AbstractVector{T} = zeros (N),
110
109
alpha:: T = 10.0 ,
111
- name:: AbstractString = " Paraboloid Diagonal ($N )" ) where T
110
+ name:: AbstractString = " Paraboloid Diagonal ($N )" ) where T <: Number
112
111
OptimizationProblem (name,
113
112
paraboloid,
114
113
paraboloid_gradient!,
115
114
paraboloid_fun_gradient!,
116
115
paraboloid_hessian!,
117
116
initial_x,
118
- x0,
117
+ x0, # x0 means the solution ...
119
118
zero (T),
120
119
true ,
121
120
false ,
0 commit comments