-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDefaultInfo.hpp
More file actions
50 lines (41 loc) · 961 Bytes
/
DefaultInfo.hpp
File metadata and controls
50 lines (41 loc) · 961 Bytes
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
#pragma once
#include "DefaultSettings.hpp"
#include "DefaultSolution.hpp"
#include <cstdint>
#include <type_traits>
namespace clarabel
{
struct LinearSolverInfo
{
ClarabelDirectSolveMethods name;
uint32_t threads;
bool direct;
uint32_t nnzA;
uint32_t nnzL;
};
template<typename T = double>
struct DefaultInfo
{
static_assert(std::is_same<T, float>::value || std::is_same<T, double>::value, "T must be float or double");
T mu;
T sigma;
T step_length;
uint32_t iterations;
T cost_primal;
T cost_dual;
T res_primal;
T res_dual;
T res_primal_inf;
T res_dual_inf;
T gap_abs;
T gap_rel;
T ktratio;
double solve_time;
clarabel::SolverStatus status;
clarabel::LinearSolverInfo linsolver;
// NB : `PrintStream stream` not passed to C++ API
};
// Instantiate the templates
template struct DefaultInfo<double>;
template struct DefaultInfo<float>;
} // namespace clarabel