-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_unconstr.cpp
35 lines (26 loc) · 1.01 KB
/
run_unconstr.cpp
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
// Copyright (C) 2023 Yixuan Qiu <yixuan.qiu@cos.name>
// Under MIT license
#include "interface.h"
int main()
{
using json = nlohmann::json;
CUTEstStat stat1, stat2;
unconstr_lbfgs_stat(stat1, false);
json lbfgs = stat_to_json(stat1);
lbfgs["alg"] = "L-BFGS";
lbfgs["solver"] = "Classic";
// std::cout << "#####################################################" << std::endl;
// std::cout << "Solver = L-BFGS" << std::endl;
// print_stat(stat1);
unconstr_lbfgspp_stat(stat2, false);
json lbfgspp = stat_to_json(stat2);
lbfgspp["alg"] = "L-BFGS";
lbfgspp["solver"] = "LBFGS++";
// std::cout << "#####################################################" << std::endl;
// std::cout << "Solver = LBFGS++" << std::endl;
// print_stat(stat2);
// std::cout << "#####################################################" << std::endl;
std::cout << lbfgs.dump(2) << std::endl;
std::cout << lbfgspp.dump(2) << std::endl;
return 0;
}