Skip to content

Commit

Permalink
Remove Function from names
Browse files Browse the repository at this point in the history
  • Loading branch information
anriseth committed Jan 25, 2018
1 parent 7254141 commit 302f0f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/NLSolversBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export AbstractObjective,
clear!

export AbstractConstraints, DifferentiableConstraints,
TwiceDifferentiableConstraints, ConstraintBounds,
TwiceDifferentiableConstraints, ConstraintBounds

x_of_nans(x) = copy(x).=(eltype(x))(NaN)

Expand Down
18 changes: 9 additions & 9 deletions src/objective_types/constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,30 +85,30 @@ abstract type AbstractConstraints end

nconstraints(constraints::AbstractConstraints) = nconstraints(constraints.bounds)

struct DifferentiableConstraintsFunction{F,J,T} <: AbstractConstraints
struct DifferentiableConstraints{F,J,T} <: AbstractConstraints
c!::F # c!(x, storage) stores the value of the constraint-functions at x
jacobian!::J # jacobian!(x, storage) stores the Jacobian of the constraint-functions
bounds::ConstraintBounds{T}
end

function DifferentiableConstraintsFunction(c!, jacobian!, lx, ux, lc, uc)
function DifferentiableConstraints(c!, jacobian!, lx, ux, lc, uc)
b = ConstraintBounds(lx, ux, lc, uc)
DifferentiableConstraintsFunction(c!, jacobian!, b)
DifferentiableConstraints(c!, jacobian!, b)
end

#TODO: is this constructor necessary?
DifferentiableConstraintsFunction(c!, jacobian!, bounds::ConstraintBounds) =
DifferentiableConstraintsFunction{typeof(c!), typeof(jacobian!), eltype(b)}(c!, jacobian!, b)
DifferentiableConstraints(c!, jacobian!, bounds::ConstraintBounds) =
DifferentiableConstraints{typeof(c!), typeof(jacobian!), eltype(b)}(c!, jacobian!, b)

function DifferentiableConstraintsFunction(lx::AbstractArray, ux::AbstractArray)
function DifferentiableConstraints(lx::AbstractArray, ux::AbstractArray)
bounds = ConstraintBounds(lx, ux, [], [])
DifferentiableConstraintsFunction(bounds)
DifferentiableConstraints(bounds)
end

function DifferentiableConstraintsFunction(bounds::ConstraintBounds)
function DifferentiableConstraints(bounds::ConstraintBounds)
c! = (x,c)->nothing
J! = (x,J)->nothing
DifferentiableConstraintsFunction(c!, J!, bounds)
DifferentiableConstraints(c!, J!, bounds)
end

struct TwiceDifferentiableConstraints{F,J,H,T} <: AbstractConstraints
Expand Down

0 comments on commit 302f0f3

Please sign in to comment.