Skip to content

Commit d333980

Browse files
authored
Update README (#66)
1 parent d58bd67 commit d333980

File tree

1 file changed

+30
-68
lines changed

1 file changed

+30
-68
lines changed

README.md

Lines changed: 30 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,29 @@ Optimization Methods and Software 11(1):613-623, 1999.
2222
DOI [10.1080/10556789908805765](http://dx.doi.org/10.1080/10556789908805765).
2323
[Preprint](http://euler.nmt.edu/~brian/csdppaper.pdf).
2424

25-
## Installing CSDP
25+
## Installation
26+
27+
The package can be installed with `Pkg.add`.
2628

27-
You can either use the system LAPACK and BLAS libaries or the libraries shipped with Julia.
28-
First, make sure that you have a compiler available, e.g. on Ubuntu do
29-
```
30-
$ sudo apt-get install build-essential
31-
```
32-
To use the libraries shipped by Julia, simply do
33-
```julia
34-
$ CSDP_USE_JULIA_LAPACK=true julia -e 'import Pkg; Pkg.add("CSDP"); Pkg.build("CSDP")'
35-
```
36-
To use the system libaries, first make sure it is installed, e.g. on Ubuntu do
37-
```julia
38-
$ sudo apt-get install liblapack-dev libopenblas-dev
3929
```
40-
and then do
41-
```julia
42-
$ CSDP_USE_JULIA_LAPACK=false julia -e 'import Pkg; Pkg.add("CSDP"); Pkg.build("CSDP")'
30+
julia> import Pkg; Pkg.add("CSDP")
4331
```
4432

45-
Note that if the environment variable `CSDP_USE_JULIA_LAPACK` is not set, it defaults
46-
to using the system libraries if available and the Julia libraries otherwise.
33+
CSDP.jl will use [BinaryProvider.jl](https://github.com/JuliaPackaging/BinaryProvider.jl) to automatically install the CSDP binaries. This should work for both the [official Julia binaries](https://julialang.org/downloads) and source-builds.
4734

48-
To use CSDP with JuMP v0.19 and later, do
49-
```julia
50-
using JuMP, CSDP
51-
model = Model(with_optimizer(CSDP.Optimizer))
52-
```
53-
and with JuMP v0.18 and earlier, do
35+
### Using with **[JuMP]**
36+
[JuMP]: https://github.com/jump-dev/JuMP.jl
37+
38+
We highly recommend that you use the *CSDP.jl* package with higher level
39+
packages such as [CSDP.jl](https://github.com/jump-dev/CSDP.jl).
40+
41+
This can be done using the ``CSDP.Optimizer`` object. Here is how to create a
42+
*JuMP* model that uses CSDP as the solver.
5443
```julia
5544
using JuMP, CSDP
56-
model = Model(solver=CSDPSolver())
45+
46+
model = Model(CSDP.Optimizer)
47+
set_optimizer_attribute(model, "maxiter", 1000)
5748
```
5849

5950
## CSDP problem representation
@@ -95,20 +86,20 @@ In practice, this is somewhat more conservative than simply requiring all eigenv
9586

9687
## Status
9788

98-
The table below shows how the different CSDP status are converted to [MathProgBase](https://github.com/JuliaOpt/MathProgBase.jl) status.
99-
100-
CSDP code | State | Description | MathProgBase status |
101-
--------- | --------------- | ------------------------------------------------------------- | ------------------- |
102-
`0` | Success | SDP solved | Optimal |
103-
`1` | Success | The problem is primal infeasible, and we have a certificate | Infeasible |
104-
`2` | Success | The problem is dual infeasible, and we have a certificate | Unbounded |
105-
`3` | Partial Success | A solution has been found, but full accuracy was not achieved | Suboptimal |
106-
`4` | Failure | Maximum iterations reached | UserLimit |
107-
`5` | Failure | Stuck at edge of primal feasibility | Error |
108-
`6` | Failure | Stuck at edge of dual infeasibility | Error |
109-
`7` | Failure | Lack of progress | Error |
110-
`8` | Failure | `X`, `Z`, or `O` was singular | Error |
111-
`9` | Failure | Detected `NaN` or `Inf` values | Error |
89+
The table below shows how the different CSDP status are converted to [MathOptInterface (MOI)](https://github.com/jump-dev/MathOptInterface.jl) status.
90+
91+
CSDP code | State | Description | MOI status |
92+
--------- | --------------- | ------------------------------------------------------------- | --------------- |
93+
`0` | Success | SDP solved | OPTIMAL |
94+
`1` | Success | The problem is primal infeasible, and we have a certificate | INFEASIBLE |
95+
`2` | Success | The problem is dual infeasible, and we have a certificate | DUAL_INFEASIBLE |
96+
`3` | Partial Success | A solution has been found, but full accuracy was not achieved | ALMOST_OPTIMAL |
97+
`4` | Failure | Maximum iterations reached | ITERATION_LIMIT |
98+
`5` | Failure | Stuck at edge of primal feasibility | SLOW_PROGRESS |
99+
`6` | Failure | Stuck at edge of dual infeasibility | SLOW_PROGRESS |
100+
`7` | Failure | Lack of progress | SLOW_PROGRESS |
101+
`8` | Failure | `X`, `Z`, or `O` was singular | NUMERICAL_ERROR |
102+
`9` | Failure | Detected `NaN` or `Inf` values | NUMERICAL_ERROR |
112103

113104
If the `printlevel` option is at least `1`, the following will be printed:
114105

@@ -143,32 +134,3 @@ Name |
143134
`perturbobj` | The `perturbobj` parameter determines whether the objective function will be perturbed to help deal with problems that have unbounded optimal solution sets. If `perturbobj` is `0`, then the objective will not be perturbed. If `perturbobj` is `1`, then the objective function will be perturbed by a default amount. Larger values of `perturbobj` (e.g. `100`) increase the size of the perturbation. This can be helpful in solving some difficult problems. | `1` |
144135
`fastmode` | The `fastmode` parameter determines whether or not CSDP will skip certain time consuming operations that slightly improve the accuracy of the solutions. If `fastmode` is set to `1`, then CSDP may be somewhat faster, but also somewhat less accurate | `0` |
145136
`printlevel` | The `printlevel` parameter determines how much debugging information is output. Use a `printlevel` of `0` for no output and a `printlevel` of `1` for normal output. Higher values of printlevel will generate more debugging output | `1` |
146-
147-
## Getting the CSDP Library
148-
The original make-file build system only provides a static library.
149-
The quite old (September 2010) [`pycsdp`](https://github.com/BenjaminKern/pycsdp) interface by [Benjamin Kern](http://ifatwww.et.uni-magdeburg.de/syst/about_us/people/kern/index.shtml) circumvents the problem by writing some C++ [code](https://github.com/BenjaminKern/pycsdp/tree/master/CXX) to which the static library is linked.
150-
The Sage [module](https://github.com/mghasemi/pycsdp) by @mghasemi is a Cython interface; I don't know how the libcsdp is installed or whether they assume that it is already available on the system.
151-
152-
That is why this package tries to parse the makefile and compiles it itself on Unix systems (so `gcc` is needed).
153-
<!-- ~~Furthermore `libblas` and `liblapack` are needed to be installed.~~ -->
154-
For Windows, a pre-compiled DLL is downloaded (unless you configure the `build.jl` differently).
155-
156-
<!-- On Windows you need the MinGW `gcc` compiler available in the `PATH`.
157-
Currently, only the Win32 builds work. -->
158-
159-
160-
## Next Steps (TODOs)
161-
162-
- [ ] Maybe port `libcsdp` to use 64bit Lapack, aka replace “some `int`s” by `long int` (the variables used in a Lapack call). Started in brach `julias_openblas64`
163-
- [ ] Maybe think about an own array type to circumvent the 1-index problems in `libcsdp`.
164-
- [ ] Map Julia's sparse arrays to `sparsematrixblock`.
165-
- [ ] Upload `libcsdp.dll` for Windows via Appveyor deployment as described at
166-
[JuliaCon](https://www.youtube.com/watch?v=XKdKdfHB2KM&index=12&list=PLP8iPy9hna6SQPwZUDtAM59-wPzCPyD_S).
167-
Currently we use a [separate repository](https://github.com/EQt/winlapack).
168-
169-
[build-img]: https://travis-ci.org/jump-dev/CSDP.jl.svg?branch=master
170-
[build-url]: https://travis-ci.org/jump-dev/CSDP.jl
171-
[winbuild-img]: https://ci.appveyor.com/api/projects/status/v8nb0yb7ahn9n7ol?svg=true
172-
[winbuild-url]: https://ci.appveyor.com/project/jump-dev/csdp-jl
173-
[codecov-img]: http://codecov.io/github/jump-dev/CSDP.jl/coverage.svg?branch=master
174-
[codecov-url]: http://codecov.io/github/jump-dev/CSDP.jl?branch=master

0 commit comments

Comments
 (0)