Skip to content

Commit 0892d56

Browse files
add QAFIRO file ripqp tuto 2 (#77)
* add QAFIRO file ripqp tuto * move QAFIRO to assets * Add assets in path * try copy assets before weave * add example with logs --------- Co-authored-by: tmigot <[email protected]>
1 parent 46afaba commit 0892d56

File tree

3 files changed

+116
-8
lines changed

3 files changed

+116
-8
lines changed

.github/workflows/build_tutorial.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ MD_FILE=markdown/$folder_without_tutorial_prefix/$file_change_suffix
1616
OUTPUT_FILE=parsed/$folder_without_tutorial_prefix/$file_change_suffix
1717
mkdir -p $(dirname $OUTPUT_FILE)
1818

19+
if [ -d "$folder/assets" ]; then
20+
mkdir -p "markdown/$folder_without_tutorial_prefix/assets/"
21+
cp -r "$folder/assets/"* "markdown/$folder_without_tutorial_prefix/assets/"
22+
fi
23+
1924
echo ">> Weaving $file in $folder"
2025
julia --project -e """
2126
using Pkg;
@@ -32,11 +37,6 @@ if [ -d "$folder/figures" ]; then
3237
cp -r "$folder/figures/"* "markdown/$folder_without_tutorial_prefix/figures/"
3338
fi
3439

35-
if [ -d "$folder/assets" ]; then
36-
mkdir -p "markdown/$folder_without_tutorial_prefix/assets/"
37-
cp -r "$folder/assets/"* "markdown/$folder_without_tutorial_prefix/assets/"
38-
fi
39-
4040
if [ -d "markdown/$folder_without_tutorial_prefix/figures" ]; then
4141
cp -r "markdown/$folder_without_tutorial_prefix/figures" "parsed/$folder_without_tutorial_prefix/"
4242
fi
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
NAME QAFIRO
2+
3+
* Problem:
4+
* ********
5+
6+
* A convex QP.
7+
8+
* Source:
9+
* I. Maros and C. Meszaros's convex QP collection
10+
* see http://www.doc.ic.ac.uk/~im/
11+
12+
* SIF input: (already in QPS format)
13+
14+
* classification QLR2-AN-32-27
15+
16+
ROWS
17+
E R09
18+
E R10
19+
L X05
20+
L X21
21+
E R12
22+
E R13
23+
L X17
24+
L X18
25+
L X19
26+
L X20
27+
E R19
28+
E R20
29+
L X27
30+
L X44
31+
E R22
32+
E R23
33+
L X40
34+
L X41
35+
L X42
36+
L X43
37+
L X45
38+
L X46
39+
L X47
40+
L X48
41+
L X49
42+
L X50
43+
L X51
44+
N COST
45+
COLUMNS
46+
X01 X48 .301 R09 -1.
47+
X01 R10 -1.06 X05 1.
48+
X02 X21 -1. R09 1.
49+
X02 COST -.4
50+
X03 X46 -1. R09 1.
51+
X04 X50 1. R10 1.
52+
X06 X49 .301 R12 -1.
53+
X06 R13 -1.06 X17 1.
54+
X07 X49 .313 R12 -1.
55+
X07 R13 -1.06 X18 1.
56+
X08 X49 .313 R12 -1.
57+
X08 R13 -.96 X19 1.
58+
X09 X49 .326 R12 -1.
59+
X09 R13 -.86 X20 1.
60+
X10 X45 2.364 X17 -1.
61+
X11 X45 2.386 X18 -1.
62+
X12 X45 2.408 X19 -1.
63+
X13 X45 2.429 X20 -1.
64+
X14 X21 1.4 R12 1.
65+
X14 COST -.32
66+
X15 X47 -1. R12 1.
67+
X16 X51 1. R13 1.
68+
X22 X46 .109 R19 -1.
69+
X22 R20 -.43 X27 1.
70+
X23 X44 -1. R19 1.
71+
X23 COST -.6
72+
X24 X48 -1. R19 1.
73+
X25 X45 -1. R19 1.
74+
X26 X50 1. R20 1.
75+
X28 X47 .109 R22 -.43
76+
X28 R23 1. X40 1.
77+
X29 X47 .108 R22 -.43
78+
X29 R23 1. X41 1.
79+
X30 X47 .108 R22 -.39
80+
X30 R23 1. X42 1.
81+
X31 X47 .107 R22 -.37
82+
X31 R23 1. X43 1.
83+
X32 X45 2.191 X40 -1.
84+
X33 X45 2.219 X41 -1.
85+
X34 X45 2.249 X42 -1.
86+
X35 X45 2.279 X43 -1.
87+
X36 X44 1.4 R23 -1.
88+
X36 COST -.48
89+
X37 X49 -1. R23 1.
90+
X38 X51 1. R22 1.
91+
X39 R23 1. COST 10.
92+
RHS
93+
B X50 310. X51 300.
94+
B X05 80. X17 80.
95+
B X27 500. R23 44.
96+
B X40 500.
97+
QUADOBJ
98+
X01 X01 10.
99+
X01 X02 1.
100+
X01 X03 1.
101+
X02 X02 10.
102+
X02 X03 1.
103+
X03 X03 10.
104+
ENDATA

tutorials/introduction-to-ripqp/index.jmd

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,17 @@ read convex quadratic problems in MPS or SIF formats: (download [QAFIRO](https:/
5151

5252
```julia
5353
using QPSReader, QuadraticModels
54-
QM = QuadraticModel(readqps("QAFIRO.SIF"))
54+
QM = QuadraticModel(readqps("assets/QAFIRO.SIF"))
5555
```
5656

5757
## Logging
5858

5959
RipQP displays some logs at each iterate.
6060

61+
```julia
62+
stats = ripqp(QM)
63+
```
64+
6165
You can deactivate logging with
6266

6367
```julia
@@ -68,7 +72,7 @@ It is also possible to get a history of several quantities such as the primal an
6872

6973
```julia
7074
stats = ripqp(QM, history = true)
71-
pddH = stats.solver_specific[:pddH]
75+
pddH = stats.solver_specific[:pddH];
7276
```
7377

7478
## Change configuration and tolerances
@@ -104,7 +108,7 @@ Then, you can read the saved files with:
104108
using DelimitedFiles, MatrixMarket
105109
K = MatrixMarket.mmread("test_K_iter4.mtx")
106110
rhs_aff = readdlm("test_rhs_iter4_aff.rhs", Float64)[:]
107-
rhs_cc = readdlm("test_rhs_iter4_cc.rhs", Float64)[:]
111+
rhs_cc = readdlm("test_rhs_iter4_cc.rhs", Float64)[:];
108112
```
109113

110114
## Timers

0 commit comments

Comments
 (0)