Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • b7953a0
  • /
  • optimizer.jl
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:03c2b1f836fde3df1c592eecab47e7d7f6222e1c
directory badge Iframe embedding
swh:1:dir:b7953a0181984616831ccdfbbba622e10eb82cca
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
optimizer.jl
# This file contains functions for the DEA optimizers
"""
    AbstractDEAOptimizer
An abstract type representing a DEA optimizer.
"""
abstract type AbstractDEAOptimizerModel end

"""
    DEAOptimizer(optimizer; time_limit, silent)
An data structure storing the configuration of a DEA optimizer.

# Optimizer specification:
- `LP`: linear programming default optimizer, GLPK.
- `NLP`: nonlinear programmin default optimizer, Ipopt.
- Any JuMP supported solver.

# Optional Arguments
- `time_limit=:60`: time limit in seconds.
- `silent=true`: suppress optimizer output.
"""
struct DEAOptimizer <: AbstractDEAOptimizerModel
    optimizer
    time_limit::Float64
    silent::Bool

    function DEAOptimizer(optimizer; time_limit = 60, silent = true)
        
        if optimizer == :LP
            optimizer =  GLPK.Optimizer
        elseif optimizer == :NLP
            optimizer = Ipopt.Optimizer
        end

        new(optimizer, time_limit, silent)
    end

end

"""
    newdeamodel(DEAOptimizer)
Generate a new JuMP model for DEA with the specified optimizer.

This function is used internally and for packages that want to extend the functionality of this package.
"""
function newdeamodel(deaoptimizer::DEAOptimizer)::Model
    deamodel = Model(deaoptimizer.optimizer)

    set_time_limit_sec(deamodel, deaoptimizer.time_limit)

    if deaoptimizer.silent
        set_silent(deamodel)
    end

    return deamodel
end

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API