-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathcore_interface.jl
3231 lines (2932 loc) · 98.5 KB
/
core_interface.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
usetup(T, libsif, status, input, out, io_buffer, n, x, x_l, x_u)
The usetup subroutine sets up the correct data structures for
subsequent computations in the case where the only possible
constraints are bound constraints. The problem under consideration is
to minimize or maximize an objective function f(x) over all x ∈ Rn
subject to the simple bounds xl≤x≤xu. The objective function is group-
partially separable.
- status: [OUT] Vector{Cint}
- input: [IN] Vector{Cint}
- out: [IN] Vector{Cint}
- io_buffer: [IN] Vector{Cint}
- n: [IN] Vector{Cint}
- x: [OUT] Vector{T}
- x_l: [OUT] Vector{T}
- x_u: [OUT] Vector{T}
"""
function usetup end
for (cutest_usetup, T) in
((:cutest_usetup_s_, :Float32), (:cutest_usetup_, :Float64), (:cutest_usetup_q_, :Float128))
@eval begin
function usetup(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
input::StrideOneVector{Cint},
out::StrideOneVector{Cint},
io_buffer::StrideOneVector{Cint},
n::StrideOneVector{Cint},
x::StrideOneVector{$T},
x_l::StrideOneVector{$T},
x_u::StrideOneVector{$T},
)
$cutest_usetup(libsif, status, input, out, io_buffer, n, x, x_l, x_u)
end
end
end
"""
csetup(libsif, status, input, out, io_buffer, n, m, x, x_l, x_u, y, c_l, c_u, equatn, linear, e_order, l_order, v_order)
The csetup subroutine sets up the correct data structures for
subsequent computations on the problem decoded from a SIF file by the
script sifdecoder. The problem under consideration is to minimize or
maximize an objective function f(x) over all x ∈ Rn subject to general
equations ci(x)=0, (i ∈ 1,...,mE), general inequalities
ci(x)≤ci(x)≤ci(x), (i ∈ mE+1,...,m), and simple bounds xl≤x≤xu. The
objective function is group-partially separable and all constraint
functions are partially separable.
- status: [OUT] Vector{Cint}
- input: [IN] Vector{Cint}
- out: [IN] Vector{Cint}
- io_buffer: [IN] Vector{Cint}
- n: [IN] Vector{Cint}
- m: [IN] Vector{Cint}
- x: [OUT] Vector{T}
- x_l: [OUT] Vector{T}
- x_u: [OUT] Vector{T}
- y: [OUT] Vector{T}
- c_l: [OUT] Vector{T}
- c_u: [OUT] Vector{T}
- equatn: [OUT] Vector{Bool}
- linear: [OUT] Vector{Bool}
- e_order: [IN] Vector{Cint}
- l_order: [IN] Vector{Cint}
- v_order: [IN] Vector{Cint}
"""
function csetup end
for (cutest_cint_csetup, T) in (
(:cutest_cint_csetup_s_, :Float32),
(:cutest_cint_csetup_, :Float64),
(:cutest_cint_csetup_q_, :Float128),
)
@eval begin
function csetup(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
input::StrideOneVector{Cint},
out::StrideOneVector{Cint},
io_buffer::StrideOneVector{Cint},
n::StrideOneVector{Cint},
m::StrideOneVector{Cint},
x::StrideOneVector{$T},
x_l::StrideOneVector{$T},
x_u::StrideOneVector{$T},
y::StrideOneVector{$T},
c_l::StrideOneVector{$T},
c_u::StrideOneVector{$T},
equatn::StrideOneVector{Bool},
linear::StrideOneVector{Bool},
e_order::StrideOneVector{Cint},
l_order::StrideOneVector{Cint},
v_order::StrideOneVector{Cint},
)
$cutest_cint_csetup(
libsif,
status,
input,
out,
io_buffer,
n,
m,
x,
x_l,
x_u,
y,
c_l,
c_u,
equatn,
linear,
e_order,
l_order,
v_order,
)
end
end
end
"""
udimen(T, libsif, status, input, n)
The udimen subroutine discovers how many variables are involved in the
problem decoded from a SIF file by the script sifdecoder. The problem
under consideration is to minimize or maximize an objective function
f(x) over all x ∈ Rn subject to the simple bounds xl≤x≤xu. The
objective function is group-partially separable.
- status: [OUT] Vector{Cint}
- input: [IN] Vector{Cint}
- n: [OUT] Vector{Cint}
"""
function udimen end
for (cutest_udimen, T) in
((:cutest_udimen_s_, :Float32), (:cutest_udimen_, :Float64), (:cutest_udimen_q_, :Float128))
@eval begin
function udimen(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
input::StrideOneVector{Cint},
n::StrideOneVector{Cint},
)
$cutest_udimen(libsif, status, input, n)
end
end
end
"""
udimsh(T, libsif, status, nnzh)
The udimsh subroutine determine the number of nonzeros required to
store the Hessian matrix of the objective function of the problem
decoded from a SIF file by the script sifdecoder at the point X. This
Hessian matrix is stored as a sparse matrix in coordinate format. The
problem under consideration is to minimize or maximize an objective
function f(x) over all x ∈ Rn subject to the simple bounds xl≤x≤xu.
The objective function is group-partially separable.
- status: [OUT] Vector{Cint}
- nnzh: [OUT] Vector{Cint}
"""
function udimsh end
for (cutest_udimsh, T) in
((:cutest_udimsh_s_, :Float32), (:cutest_udimsh_, :Float64), (:cutest_udimsh_q_, :Float128))
@eval begin
function udimsh(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
nnzh::StrideOneVector{Cint},
)
$cutest_udimsh(libsif, status, nnzh)
end
end
end
"""
udimse(T, libsif, status, ne, he_val_ne, he_row_ne)
The udimse subroutine determine the number of nonzeros required to
store the Hessian matrix of the objective function of the problem
decoded from a SIF file by the script sifdecoder at the point X. This
Hessian matrix is stored as a sparse matrix in finite element format
H=eΣ1He, where each square symmetric element H_i involves a small
subset of the rows of the Hessian matrix. The problem under
consideration is to minimize or maximize an objective function f(x)
over all x ∈ Rn subject to the simple bounds xl≤x≤xu. The objective
function is group-partially separable.
- status: [OUT] Vector{Cint}
- ne: [OUT] Vector{Cint}
- he_val_ne: [OUT] Vector{Cint}
- he_row_ne: [OUT] Vector{Cint}
"""
function udimse end
for (cutest_udimse, T) in
((:cutest_udimse_s_, :Float32), (:cutest_udimse_, :Float64), (:cutest_udimse_q_, :Float128))
@eval begin
function udimse(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
ne::StrideOneVector{Cint},
he_val_ne::StrideOneVector{Cint},
he_row_ne::StrideOneVector{Cint},
)
$cutest_udimse(libsif, status, ne, he_val_ne, he_row_ne)
end
end
end
"""
uvartype(T, libsif, status, n, x_type)
The uvartype subroutine determines the type (continuous, 0-1, integer)
of each variable involved in the problem decoded from a SIF file by
the script sifdecoder. The problem under consideration is to minimize
or maximize an objective function f(x) over all x ∈ Rn subject to the
simple bounds xl≤x≤xu. The objective function is group-partially
separable.
- status: [OUT] Vector{Cint}
- n: [IN] Vector{Cint}
- x_type: [OUT] Vector{Cint}
"""
function uvartype end
for (cutest_uvartype, T) in (
(:cutest_uvartype_s_, :Float32),
(:cutest_uvartype_, :Float64),
(:cutest_uvartype_q_, :Float128),
)
@eval begin
function uvartype(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
n::StrideOneVector{Cint},
x_type::StrideOneVector{Cint},
)
$cutest_uvartype(libsif, status, n, x_type)
end
end
end
"""
unames(T, libsif, status, n, pname, vname)
The unames subroutine obtains the names of the problem and its
variables. The problem under consideration is to minimize or maximize
an objective function f(x) over all x ∈ Rn subject to the simple
bounds xl≤x≤xu. The objective function is group-partially separable.
- status: [OUT] Vector{Cint}
- n: [IN] Vector{Cint}
- pname: [OUT] Vector{Cchar}
- vname: [OUT] Vector{Cchar}
To get useful names, use `String(x)` where `x` can be `pname` or `vname[:,i]`.
"""
function unames end
for (cutest_unames, T) in
((:cutest_unames_s_, :Float32), (:cutest_unames_, :Float64), (:cutest_unames_q_, :Float128))
@eval begin
function unames(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
n::StrideOneVector{Cint},
pname::StrideOneVector{Cchar},
vname::Matrix{Cchar},
)
$cutest_unames(libsif, status, n, pname, vname)
end
end
end
"""
ureport(T, libsif, status, calls, time)
The ureport subroutine obtains statistics concerning function
evaluation and CPU time used for unconstrained or bound-constrained
optimization in a standardized format. The problem under consideration
is to minimize or maximize an objective function f(x) over all x ∈ Rn
subject to the simple bounds xl≤x≤xu. The objective function is group-
partially separable.
- status: [OUT] Vector{Cint}
- calls: [OUT] Vector{T}
- time: [OUT] Vector{T}
"""
function ureport end
for (cutest_ureport, T) in
((:cutest_ureport_s_, :Float32), (:cutest_ureport_, :Float64), (:cutest_ureport_q_, :Float128))
@eval begin
function ureport(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
calls::StrideOneVector{$T},
time::StrideOneVector{$T},
)
$cutest_ureport(libsif, status, calls, time)
end
end
end
"""
cdimen(T, libsif, status, input, n, m)
The cdimen subroutine discovers how many variables and constraints are
involved in the problem decoded from a SIF file by the script
sifdecoder. The problem under consideration is to minimize or maximize
an objective function f(x) over all x ∈ Rn subject to general
equations ci(x)=0, (i ∈ 1,...,mE), general inequalities
ci(x)≤ci(x)≤ci(x), (i ∈ mE+1,...,m), and simple bounds xl≤x≤xu. The
objective function is group-partially separable and all constraint
functions are partially separable.
- status: [OUT] Vector{Cint}
- input: [IN] Vector{Cint}
- n: [OUT] Vector{Cint}
- m: [OUT] Vector{Cint}
"""
function cdimen end
for (cutest_cdimen, T) in
((:cutest_cdimen_s_, :Float32), (:cutest_cdimen_, :Float64), (:cutest_cdimen_q_, :Float128))
@eval begin
function cdimen(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
input::StrideOneVector{Cint},
n::StrideOneVector{Cint},
m::StrideOneVector{Cint},
)
$cutest_cdimen(libsif, status, input, n, m)
end
end
end
"""
cdimsj(T, libsif, status, nnzj)
The cdimsj subroutine determines the number of nonzero elements
required to store the matrix of gradients of the objective function
and constraint functions for the problem decoded into OUTSDIF.d in the
constrained minimization case. The matrix is stored in sparse format.
The problem under consideration is to minimize or maximize an
objective function f(x) over all x ∈ Rn subject to general equations
ci(x)=0, (i ∈ 1,...,mE), general inequalities ci(x)≤ci(x)≤ci(x), (i ∈
mE+1,...,m), and simple bounds xl≤x≤xu. The objective function is
group-partially separable and all constraint functions are partially
separable.
- status: [OUT] Vector{Cint}
- nnzj: [OUT] Vector{Cint}
"""
function cdimsj end
for (cutest_cdimsj, T) in
((:cutest_cdimsj_s_, :Float32), (:cutest_cdimsj_, :Float64), (:cutest_cdimsj_q_, :Float128))
@eval begin
function cdimsj(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
nnzj::StrideOneVector{Cint},
)
$cutest_cdimsj(libsif, status, nnzj)
end
end
end
"""
cdimsh(T, libsif, status, nnzh)
The cdimsh subroutine determines the number of nonzero elements
required to store the Hessian matrix of the Lagrangian function for
the problem decoded into OUTSDIF.d in the constrained minimization
case. The matrix is stored in sparse "coordinate" format. The problem
under consideration is to minimize or maximize an objective function
f(x) over all x ∈ Rn subject to general equations ci(x)=0, (i ∈
1,...,mE), general inequalities ci(x)≤ci(x)≤ci(x), (i ∈ mE+1,...,m),
and simple bounds xl≤x≤xu. The objective function is group-partially
separable and all constraint functions are partially separable.
- status: [OUT] Vector{Cint}
- nnzh: [OUT] Vector{Cint}
"""
function cdimsh end
for (cutest_cdimsh, T) in
((:cutest_cdimsh_s_, :Float32), (:cutest_cdimsh_, :Float64), (:cutest_cdimsh_q_, :Float128))
@eval begin
function cdimsh(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
nnzh::StrideOneVector{Cint},
)
$cutest_cdimsh(libsif, status, nnzh)
end
end
end
"""
cdimchp(T, libsif, status, nnzchp)
The cdimchp subroutine determines the number of nonzero elements
required to store the products of the Hessian matrices of the
constraint functions with a specified vector for the problem decoded
into OUTSDIF.d in the constrained minimization case. The problem under
consideration is to minimize or maximize an objective function f(x)
over all x ∈ Rn subject to general equations ci(x)=0, (i ∈ 1,...,mE),
general inequalities ci(x)≤ci(x)≤ci(x), (i ∈ mE+1,...,m), and simple
bounds xl≤x≤xu. The objective function is group-partially separable
and all constraint functions are partially separable.
- status: [OUT] Vector{Cint}
- nnzchp: [OUT] Vector{Cint}
"""
function cdimchp end
for (cutest_cdimchp, T) in
((:cutest_cdimchp_s_, :Float32), (:cutest_cdimchp_, :Float64), (:cutest_cdimchp_q_, :Float128))
@eval begin
function cdimchp(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
nnzchp::StrideOneVector{Cint},
)
$cutest_cdimchp(libsif, status, nnzchp)
end
end
end
"""
cdimse(T, libsif, status, ne, he_val_ne, he_row_ne)
The cdimse subroutine determines the number of nonzero elements
required to store the Hessian matrix of the Lagrangian function for
the problem decoded from a SIF file by the script sifdecoder. The
matrix is stored in sparse "finite element" format H=eΣ1He, where each
square symmetric element He involves a small subset of the rows of the
Hessian matrix. The problem under consideration is to minimize or
maximize an objective function f(x) over all x ∈ Rn subject to general
equations ci(x)=0, (i ∈ 1,...,mE), general inequalities
ci(x)≤ci(x)≤ci(x), (i ∈ mE+1,...,m), and simple bounds xl≤x≤xu. The
objective function is group-partially separable and all constraint
functions are partially separable.
- status: [OUT] Vector{Cint}
- ne: [OUT] Vector{Cint}
- he_val_ne: [OUT] Vector{Cint}
- he_row_ne: [OUT] Vector{Cint}
"""
function cdimse end
for (cutest_cdimse, T) in
((:cutest_cdimse_s_, :Float32), (:cutest_cdimse_, :Float64), (:cutest_cdimse_q_, :Float128))
@eval begin
function cdimse(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
ne::StrideOneVector{Cint},
he_val_ne::StrideOneVector{Cint},
he_row_ne::StrideOneVector{Cint},
)
$cutest_cdimse(libsif, status, ne, he_val_ne, he_row_ne)
end
end
end
"""
cstats(T, libsif, status, nonlinear_variables_objective, nonlinear_variables_constraints, equality_constraints, linear_constraints)
- status: [OUT] Vector{Cint}
- nonlinear_variables_objective: [OUT] Vector{Cint}
- nonlinear_variables_constraints: [OUT] Vector{Cint}
- equality_constraints: [OUT] Vector{Cint}
- linear_constraints: [OUT] Vector{Cint}
"""
function cstats end
for (cutest_cstats, T) in
((:cutest_cstats_s_, :Float32), (:cutest_cstats_, :Float64), (:cutest_cstats_q_, :Float128))
@eval begin
function cstats(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
nonlinear_variables_objective::StrideOneVector{Cint},
nonlinear_variables_constraints::StrideOneVector{Cint},
equality_constraints::StrideOneVector{Cint},
linear_constraints::StrideOneVector{Cint},
)
$cutest_cstats(
libsif,
status,
nonlinear_variables_objective,
nonlinear_variables_constraints,
equality_constraints,
linear_constraints,
)
end
end
end
"""
cvartype(T, libsif, status, n, x_type)
The cvartype subroutine determines the type (continuous, 0-1, integer)
of each variable involved in the problem decoded from a SIF file by
the script sifdecoder. The problem under consideration is to minimize
or maximize an objective function f(x) over all x ∈ Rn subject to
general equations ci(x)=0, (i ∈ 1,...,mE), general inequalities
ci(x)≤ci(x)≤ci(x), (i ∈ mE+1,...,m), and simple bounds xl≤x≤xu. The
objective function is group-partially separable and all constraint
functions are partially separable.
- status: [OUT] Vector{Cint}
- n: [IN] Vector{Cint}
- x_type: [OUT] Vector{Cint}
"""
function cvartype end
for (cutest_cvartype, T) in (
(:cutest_cvartype_s_, :Float32),
(:cutest_cvartype_, :Float64),
(:cutest_cvartype_q_, :Float128),
)
@eval begin
function cvartype(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
n::StrideOneVector{Cint},
x_type::StrideOneVector{Cint},
)
$cutest_cvartype(libsif, status, n, x_type)
end
end
end
"""
cnames(T, libsif, status, n, m, pname, vname, cname)
The cnames subroutine obtains the names of the problem, its variables
and general constraints. The problem under consideration is to
minimize or maximize an objective function f(x) over all x ∈ Rn
subject to general equations ci(x)=0, (i ∈ 1,...,mE), general
inequalities ci(x)≤ci(x)≤ci(x), (i ∈ mE+1,...,m), and simple bounds
xl≤x≤xu. The objective function is group-partially separable and all
constraint functions are partially separable.
- status: [OUT] Vector{Cint}
- n: [IN] Vector{Cint}
- m: [IN] Vector{Cint}
- pname: [OUT] Vector{Cchar}
- vname: [OUT] Vector{Cchar}
- cname: [OUT] Vector{Cchar}
To get useful names, use `String(x)` where `x` can be `pname`, `vname[:,i]`,
or `cname[:,i]`.
"""
function cnames end
for (cutest_cnames, T) in
((:cutest_cnames_s_, :Float32), (:cutest_cnames_, :Float64), (:cutest_cnames_q_, :Float128))
@eval begin
function cnames(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
n::StrideOneVector{Cint},
m::StrideOneVector{Cint},
pname::StrideOneVector{Cchar},
vname::Matrix{Cchar},
cname::Matrix{Cchar},
)
$cutest_cnames(libsif, status, n, m, pname, vname, cname)
end
end
end
"""
creport(T, libsif, status, calls, time)
The creport subroutine obtains statistics concerning function
evaluation and CPU time used for constrained optimization in a
standardized format. The problem under consideration is to minimize or
maximize an objective function f(x) over all x ∈ Rn subject to general
equations ci(x)=0, (i ∈ 1,...,mE), general inequalities
ci(x)≤ci(x)≤ci(x), (i ∈ mE+1,...,m), and simple bounds xl≤x≤xu. The
objective function is group-partially separable and all constraint
functions are partially separable.
- status: [OUT] Vector{Cint}
- calls: [OUT] Vector{T}
- time: [OUT] Vector{T}
"""
function creport end
for (cutest_creport, T) in
((:cutest_creport_s_, :Float32), (:cutest_creport_, :Float64), (:cutest_creport_q_, :Float128))
@eval begin
function creport(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
calls::StrideOneVector{$T},
time::StrideOneVector{$T},
)
$cutest_creport(libsif, status, calls, time)
end
end
end
"""
connames(T, libsif, status, m, cname)
The connames subroutine obtains the names of the general constraints
of the problem. The problem under consideration is to minimize or
maximize an objective function f(x) over all x ∈ Rn subject to general
equations ci(x)=0, (i ∈ 1,...,mE), general inequalities
ci(x)≤ci(x)≤ci(x), (i ∈ mE+1,...,m), and simple bounds xl≤x≤xu. The
objective function is group-partially separable and all constraint
functions are partially separable.
- status: [OUT] Vector{Cint}
- m: [IN] Vector{Cint}
- cname: [OUT] Vector{Cchar}
To get useful names, use `String(cname[:,i])`.
"""
function connames end
for (cutest_connames, T) in (
(:cutest_connames_s_, :Float32),
(:cutest_connames_, :Float64),
(:cutest_connames_q_, :Float128),
)
@eval begin
function connames(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
m::StrideOneVector{Cint},
cname::Matrix{Cchar},
)
$cutest_connames(libsif, status, m, cname)
end
end
end
"""
pname(T, libsif, status, input, pname)
The pname subroutine obtains the name of the problem directly from the
datafile OUTSDIF.d that was created by the script sifdecoder when
decoding a SIF file. The problem under consideration is to minimize or
maximize an objective function f(x) over all x ∈ Rn subject to general
equations ci(x)=0, (i ∈ 1,...,mE), general inequalities
ci(x)≤ci(x)≤ci(x), (i ∈ mE+1,...,m), and simple bounds xl≤x≤xu. The
objective function is group-partially separable and all constraint
functions are partially separable.
- status: [OUT] Vector{Cint}
- input: [IN] Vector{Cint}
- pname: [OUT] Vector{Cchar}
"""
function pname end
for (cutest_pname, T) in
((:cutest_pname_s_, :Float32), (:cutest_pname_, :Float64), (:cutest_pname_q_, :Float128))
@eval begin
function pname(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
input::StrideOneVector{Cint},
pname::StrideOneVector{Cchar},
)
$cutest_pname(libsif, status, input, pname)
end
end
end
"""
probname(T, libsif, status, pname)
The probname subroutine obtains the name of the problem. The problem
under consideration is to minimize or maximize an objective function
f(x) over all x ∈ Rn subject to general equations ci(x)=0, (i ∈
1,...,mE), general inequalities ci(x)≤ci(x)≤ci(x), (i ∈ mE+1,...,m),
and simple bounds xl≤x≤xu. The objective function is group-partially
separable and all constraint functions are partially separable.
- status: [OUT] Vector{Cint}
- pname: [OUT] Vector{Cchar}
To get a useful name, use `String(pname)`.
"""
function probname end
for (cutest_probname, T) in (
(:cutest_probname_s_, :Float32),
(:cutest_probname_, :Float64),
(:cutest_probname_q_, :Float128),
)
@eval begin
function probname(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
pname::StrideOneVector{Cchar},
)
$cutest_probname(libsif, status, pname)
end
end
end
"""
varnames(T, libsif, status, n, vname)
The varnames subroutine obtains the names of the problem variables.
The problem under consideration is to minimize or maximize an
objective function f(x) over all x ∈ Rn subject to general equations
ci(x)=0, (i ∈ 1,...,mE), general inequalities ci(x)≤ci(x)≤ci(x), (i ∈
mE+1,...,m), and simple bounds xl≤x≤xu. The objective function is
group-partially separable and all constraint functions are partially
separable.
- status: [OUT] Vector{Cint}
- n: [IN] Vector{Cint}
- vname: [OUT] Vector{Cchar}
To get useful names, use `String(vname[:, i])`.
"""
function varnames end
for (cutest_varnames, T) in (
(:cutest_varnames_s_, :Float32),
(:cutest_varnames_, :Float64),
(:cutest_varnames_q_, :Float128),
)
@eval begin
function varnames(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
n::StrideOneVector{Cint},
vname::Matrix{Cchar},
)
$cutest_varnames(libsif, status, n, vname)
end
end
end
"""
ufn(T, libsif, status, n, x, f)
The ufn subroutine evaluates the value of the objective function of
the problem decoded from a SIF file by the script sifdecoder at the
point X. The problem under consideration is to minimize or maximize an
objective function f(x) over all x ∈ Rn subject to the simple bounds
xl≤x≤xu. The objective function is group-partially separable.
- status: [OUT] Vector{Cint}
- n: [IN] Vector{Cint}
- x: [IN] Vector{T}
- f: [OUT] Vector{T}
"""
function ufn end
for (cutest_ufn, T) in
((:cutest_ufn_s_, :Float32), (:cutest_ufn_, :Float64), (:cutest_ufn_q_, :Float128))
@eval begin
function ufn(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
n::StrideOneVector{Cint},
x::StrideOneVector{$T},
f::StrideOneVector{$T},
)
$cutest_ufn(libsif, status, n, x, f)
end
end
end
"""
ugr(T, libsif, status, n, x, g)
The ugr subroutine evaluates the gradient of the objective function of
the problem decoded from a SIF file by the script sifdecoder at the
point X. The problem under consideration is to minimize or maximize an
objective function f(x) over all x ∈ Rn subject to the simple bounds
xl≤x≤xu. The objective function is group-partially separable.
- status: [OUT] Vector{Cint}
- n: [IN] Vector{Cint}
- x: [IN] Vector{T}
- g: [OUT] Vector{T}
"""
function ugr end
for (cutest_ugr, T) in
((:cutest_ugr_s_, :Float32), (:cutest_ugr_, :Float64), (:cutest_ugr_q_, :Float128))
@eval begin
function ugr(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
n::StrideOneVector{Cint},
x::StrideOneVector{$T},
g::StrideOneVector{$T},
)
$cutest_ugr(libsif, status, n, x, g)
end
end
end
"""
uofg(T, libsif, status, n, x, f, g, grad)
The uofg subroutine evaluates the value of the objective function of
the problem decoded from a SIF file by the script sifdecoder at the
point X, and possibly its gradient. The problem under consideration is
to minimize or maximize an objective function f(x) over all x ∈ Rn
subject to the simple bounds xl≤x≤xu. The objective function is group-
partially separable.
- status: [OUT] Vector{Cint}
- n: [IN] Vector{Cint}
- x: [IN] Vector{T}
- f: [OUT] Vector{T}
- g: [OUT] Vector{T}
- grad: [IN] Vector{Bool}
"""
function uofg end
for (cutest_cint_uofg, T) in (
(:cutest_cint_uofg_s_, :Float32),
(:cutest_cint_uofg_, :Float64),
(:cutest_cint_uofg_q_, :Float128),
)
@eval begin
function uofg(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
n::StrideOneVector{Cint},
x::StrideOneVector{$T},
f::StrideOneVector{$T},
g::StrideOneVector{$T},
grad::StrideOneVector{Bool},
)
$cutest_cint_uofg(libsif, status, n, x, f, g, grad)
end
end
end
"""
udh(T, libsif, status, n, x, lh1, h)
The udh subroutine evaluates the Hessian matrix of the objective
function of the problem decoded from a SIF file by the script
sifdecoder at the point X. This Hessian matrix is stored as a dense
matrix. The problem under consideration is to minimize or maximize an
objective function f(x) over all x ∈ Rn subject to the simple bounds
xl≤x≤xu. The objective function is group-partially separable.
- status: [OUT] Vector{Cint}
- n: [IN] Vector{Cint}
- x: [IN] Vector{T}
- lh1: [IN] Vector{Cint}
- h: [OUT] Matrix{T}
"""
function udh end
for (cutest_udh, T) in
((:cutest_udh_s_, :Float32), (:cutest_udh_, :Float64), (:cutest_udh_q_, :Float128))
@eval begin
function udh(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
n::StrideOneVector{Cint},
x::StrideOneVector{$T},
lh1::StrideOneVector{Cint},
h::Matrix{$T},
)
$cutest_udh(libsif, status, n, x, lh1, h)
end
end
end
"""
ushp(T, libsif, status, n, nnzh, lh, h_row, h_col)
The ushp subroutine evaluates the sparsity pattern of the Hessian
matrix of the objective function of the problem, decoded from a SIF
file by the script sifdecoder, in coordinate format. The problem under
consideration is to minimize or maximize an objective function f(x)
over all x ∈ Rn subject to the simple bounds xl≤x≤xu. The objective
function is group-partially separable.
- status: [OUT] Vector{Cint}
- n: [IN] Vector{Cint}
- nnzh: [OUT] Vector{Cint}
- lh: [IN] Vector{Cint}
- h_row: [OUT] Vector{Cint}
- h_col: [OUT] Vector{Cint}
"""
function ushp end
for (cutest_ushp, T) in
((:cutest_ushp_s_, :Float32), (:cutest_ushp_, :Float64), (:cutest_ushp_q_, :Float128))
@eval begin
function ushp(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
n::StrideOneVector{Cint},
nnzh::StrideOneVector{Cint},
lh::StrideOneVector{Cint},
h_row::StrideOneVector{Cint},
h_col::StrideOneVector{Cint},
)
$cutest_ushp(libsif, status, n, nnzh, lh, h_row, h_col)
end
end
end
"""
ush(T, libsif, status, n, x, nnzh, lh, h_val, h_row, h_col)
The ush subroutine evaluates the Hessian matrix of the objective
function of the problem decoded from a SIF file by the script
sifdecoder at the point X. This Hessian matrix is stored as a sparse
matrix in coordinate format. The problem under consideration is to
minimize or maximize an objective function f(x) over all x ∈ Rn
subject to the simple bounds xl≤x≤xu. The objective function is group-
partially separable.
- status: [OUT] Vector{Cint}
- n: [IN] Vector{Cint}
- x: [IN] Vector{T}
- nnzh: [OUT] Vector{Cint}
- lh: [IN] Vector{Cint}
- h_val: [OUT] Vector{T}
- h_row: [OUT] Vector{Cint}
- h_col: [OUT] Vector{Cint}
"""
function ush end
for (cutest_ush, T) in
((:cutest_ush_s_, :Float32), (:cutest_ush_, :Float64), (:cutest_ush_q_, :Float128))
@eval begin
function ush(
::Type{$T},
libsif::Ptr{Cvoid},
status::StrideOneVector{Cint},
n::StrideOneVector{Cint},
x::StrideOneVector{$T},
nnzh::StrideOneVector{Cint},
lh::StrideOneVector{Cint},
h_val::StrideOneVector{$T},
h_row::StrideOneVector{Cint},
h_col::StrideOneVector{Cint},
)
$cutest_ush(libsif, status, n, x, nnzh, lh, h_val, h_row, h_col)
end
end
end
"""
ueh(T, libsif, status, n, x, ne, lhe_ptr, he_row_ptr, he_val_ptr, lhe_row, he_row, lhe_val, he_val, byrows)
The ueh subroutine evaluates the Hessian matrix of the objective
function of the problem decoded from a SIF file by the script
sifdecoder at the point X. This Hessian matrix is stored as a sparse
matrix in finite element format H=eΣ1He, where each square symmetric
element He involves a small subset of the rows of the Hessian matrix.