#pragma once #include #include #include #include #include #include #include "graph.hpp" #include "hooks.hpp" #include "current_info.hpp" #include "array_hash.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 network { private: cholmod_dense *b; cholmod_factor *factor; cholmod_sparse *voltcurmat; cholmod_common *c; public: const graph& G; std::vector fuses; std::vector thresholds; network(const graph&, cholmod_common*); network(const network &other); ~network(); void set_thresholds(double, std::mt19937&); void break_edge(unsigned, bool unbreak = false); current_info get_current_info(); void fracture(hooks&, double cutoff = 1e-13); };