Class graph::CompactGraph
Save graph mode of ising and pubo mode in compact format (BitStream)
Constructors
CompactGraph()
Declaration
graph::CompactGraph<ELEMTYPE>::CompactGraph()
Methods
set_allow_dup_merge()
Declaration
void graph::CompactGraph<ELEMTYPE>::set_allow_dup_merge(bool value)
get_const_cost()
Declaration
double graph::CompactGraph<ELEMTYPE>::get_const_cost() const
is_empty()
Declaration
bool graph::CompactGraph<ELEMTYPE>::is_empty() const
configure()
Declaration
void graph::CompactGraph<ELEMTYPE>::configure(Configuration_T&config)
configure()
configure the object from input
Initialize the object's state from the input utils::Config
. This is done by declaring which required and optional parameters are associated with the fields of this object. During initialization, they are checked for their presence, type and any matchers.
Example:
MyClass : public Component {
public:
void configure(const utils::Json& json) override {
this->param(json, "number", my_number)
.description("some description")
.matches(GreaterEquals(0))
.required();
this->param(json, "name", my_name)
.description("some description")
.matches(SizeIs(GreaterThan(0)))
.default_value("no_name");
}
private:
int my_number;
std::string my_name;
}
MyClass my_object;
my_object.configure(utils::json_from_string(R"(
{
"number": 42,
"name": "hello"
}
)"));
Note
By default, nothing is configured from input. You need to overload this method if you want to use this functionality. Don't forget to call the configure method of the parent class if it also needs to be configured (this is not the case for utils::Component
itself).
HINT: Parameters are not limited to scalars and strings; Any component can be a parameter; in which case it is initialized using its own configure method.
utils::Json
Declaration
void graph::CompactGraph<ELEMTYPE>::configure(const utils::Json&) override
init()
Declaration
void graph::CompactGraph<ELEMTYPE>::init()
nodes_size()
Declaration
size_t graph::CompactGraph<ELEMTYPE>::nodes_size() const
edges_size()
Declaration
size_t graph::CompactGraph<ELEMTYPE>::edges_size() const
is_rescaled()
Declaration
bool graph::CompactGraph<ELEMTYPE>::is_rescaled() const
rescale()
Declaration
void graph::CompactGraph<ELEMTYPE>::rescale()
get_scale_factor()
Declaration
double graph::CompactGraph<ELEMTYPE>::get_scale_factor() const
map_output()
Declaration
int graph::CompactGraph<ELEMTYPE>::map_output(int internal_id) const
output_map()
Declaration
const std::map<int, int>&graph::CompactGraph<ELEMTYPE>::output_map() const
edge()
Declaration
const Edge_T&graph::CompactGraph<ELEMTYPE>::edge(size_t edge_id) const
read_next_neig()
Declaration
uint64_t graph::CompactGraph<ELEMTYPE>::read_next_neig(CompactGraphVisitor&reader) const
read_next_coeff()
Declaration
double graph::CompactGraph<ELEMTYPE>::read_next_coeff(CompactGraphVisitor&reader) const
is_edge_end()
Declaration
bool graph::CompactGraph<ELEMTYPE>::is_edge_end(uint32_t value) const
is_node_end()
Declaration
bool graph::CompactGraph<ELEMTYPE>::is_node_end(uint32_t value) const
get_locality()
Declaration
uint32_t graph::CompactGraph<ELEMTYPE>::get_locality() const
get_min_locality()
Declaration
uint32_t graph::CompactGraph<ELEMTYPE>::get_min_locality() const
get_avg_locality()
Declaration
double graph::CompactGraph<ELEMTYPE>::get_avg_locality() const
get_accumulated_dependent_vars()
Declaration
uint64_t graph::CompactGraph<ELEMTYPE>::get_accumulated_dependent_vars() const
get_max_coupling_magnitude()
Declaration
double graph::CompactGraph<ELEMTYPE>::get_max_coupling_magnitude() const
get_min_coupling_magnitude()
Declaration
double graph::CompactGraph<ELEMTYPE>::get_min_coupling_magnitude() const
get_sum_coefficient_degrees_total()
Declaration
uint64_t graph::CompactGraph<ELEMTYPE>::get_sum_coefficient_degrees_total() const
estimate_max_cost_diff()
Declaration
double graph::CompactGraph<ELEMTYPE>::estimate_max_cost_diff() const
get_node_name_to_id_map()
Declaration
const std::map<int, int>&graph::CompactGraph<ELEMTYPE>::get_node_name_to_id_map() const