Skip to content

Commit 3024c55

Browse files
authored
Circumvent bug (?) (#7)
* Fix weird bug See JuliaLang/julia#25536 * Remove old comment
1 parent 475ce3d commit 3024c55

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/optim_tests/multivariate/quad_transforms.jl

+3-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ end
3535
function _quadraticproblem(N::Int; mat::AbstractArray{T,2} = spdiagm(float(1:N)),
3636
x0::AbstractVector{T} = ones(N),
3737
initial_x::AbstractVector{T} = zeros(N),
38-
name::AbstractString = "Quadratic Diagonal ($N)") where T
38+
name::AbstractString = "Quadratic Diagonal ($N)") where T <: Number
3939
# Note that _quadraticproblem is a special case of
4040
# _paraboloidproblem, where param.alpha = 0.0
4141
OptimizationProblem(name,
@@ -59,7 +59,6 @@ examples["Quadratic Diagonal"] = _quadraticproblem(100)
5959

6060
immutable ParaboloidStruct{T, Tm <: AbstractArray{T,2},
6161
Tv <: AbstractArray{T}} <: Any where T<:Number
62-
6362
mat::Tm
6463
vec::Tv
6564
xt::Tv
@@ -108,14 +107,14 @@ function _paraboloidproblem(N::Int; mat::AbstractArray{T,2} = spdiagm(float(1:N)
108107
x0::AbstractVector{T} = ones(N),
109108
initial_x::AbstractVector{T} = zeros(N),
110109
alpha::T = 10.0,
111-
name::AbstractString = "Paraboloid Diagonal ($N)") where T
110+
name::AbstractString = "Paraboloid Diagonal ($N)") where T <: Number
112111
OptimizationProblem(name,
113112
paraboloid,
114113
paraboloid_gradient!,
115114
paraboloid_fun_gradient!,
116115
paraboloid_hessian!,
117116
initial_x,
118-
x0,
117+
x0, # x0 means the solution ...
119118
zero(T),
120119
true,
121120
false,

src/optim_tests/multivariate/unconstrained.jl

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import Base.gradient
44

55
export OptimizationProblem, objective, gradient, objective_gradient, hessian
66

7-
#######################
8-
# TODO: We could write fg! calls as well here
9-
#######################
107
immutable OptimizationProblem{P, Tfg, Tf <: Real, TS <: AbstractString}
118
name::TS
129
f::Function

0 commit comments

Comments
 (0)