summaryrefslogtreecommitdiff
path: root/lib/include/problem.hpp
blob: 740751dc1ca9d56c4472ba1b4a8092e26fe1e02f (plain)
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

#include <vector>
#include <limits>

#include <cholmod.h>
#include "graph.hpp"
#include "current_info.hpp"

#ifdef FRACTURE_LONGINT

#define CHOL_F(x) cholmod_l_##x
#define CHOL_INT long int

#else

#define CHOL_F(x) cholmod_##x
#define CHOL_INT int

#endif

class problem {
  private:
    const graph& G;
    unsigned axis;
    cholmod_dense* b;
    cholmod_factor* factor;
    cholmod_sparse* voltcurmat;
    cholmod_common* c;

  public:
    current_info sol;

    problem(const graph&, unsigned, cholmod_common*);
    problem(const graph&, unsigned, cholmod_sparse*, cholmod_common*);
    problem(const problem&);
    ~problem();
    void solve(std::vector<bool>& fuses);
    void break_edge(unsigned, bool unbreak = false);
};