Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move XPRS_ATTRIBUTES to src/api.jl #239

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ set_optimizer(model, "PRESOLVE", 0)

## Options

For other parameters use [Xpress Optimizer manual](https://www.fico.com/fico-xpress-optimization/docs/latest/solver/optimizer/HTML/)
or type `julia -e "using Xpress; println(keys(Xpress.XPRS_ATTRIBUTES))"`.
For other parameters see the [Xpress Optimizer manual](https://www.fico.com/fico-xpress-optimization/docs/latest/solver/optimizer/HTML/).

If `logfile` is set to `""`, the log file is disabled and output is printed
to the console ([there might be issues with console output on windows (it is manually implemented with callbacks)](https://www.fico.com/fico-xpress-optimization/docs/latest/solver/optimizer/HTML/OUTPUTLOG.html)).
If `logfile` is set to a file's path, output is printed to that file.
By default, `logfile = ""` (console).
If `logfile` is set to `""`, the log file is disabled and output is printed to
the console ([there might be issues with console output on windows (it is manually implemented with callbacks)](https://www.fico.com/fico-xpress-optimization/docs/latest/solver/optimizer/HTML/OUTPUTLOG.html)).

If `logfile` is set to a file's path, output is printed to that file. By
default, `logfile = ""` (console).

### Custom options

Expand Down
12 changes: 0 additions & 12 deletions src/Xpress.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ include("api.jl")
include("xprs_callbacks.jl")
include("license.jl")

_is_xprs_attribute(name::Symbol) = _is_xprs_attribute(string(name))

function _is_xprs_attribute(name::String)
return startswith(name, "XPRS_") &&
all(isuppercase(c) || isdigit(c) for c in name if c != '_')
end

const XPRS_ATTRIBUTES = Dict{String,Any}(
replace("$name", "XPRS_" => "") => getfield(Lib, name) for
name in filter(_is_xprs_attribute, names(Lib; all = true))
)

function initialize()
Libdl.dlopen(libxprs)
userlic()
Expand Down
12 changes: 12 additions & 0 deletions src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6942,3 +6942,15 @@ function setcontrols!(prob::XpressProblem; kwargs...)
end
return
end

_is_xprs_attribute(name::Symbol) = _is_xprs_attribute(string(name))

function _is_xprs_attribute(name::String)
return startswith(name, "XPRS_") &&
all(isuppercase(c) || isdigit(c) for c in name if c != '_')
end

const XPRS_ATTRIBUTES = Dict{String,Any}(
replace("$name", "XPRS_" => "") => getfield(Lib, name) for
name in filter(_is_xprs_attribute, names(Lib; all = true))
)
Loading