21 #ifndef OPHIDIAN_ABACUS_H
22 #define OPHIDIAN_ABACUS_H
24 #include "../legalization.h"
30 namespace legalization {
34 bool operator()(
const std::pair<entity_system::entity, double> & cell_pair1,
const std::pair<entity_system::entity, double> & cell_pair2) {
35 return cell_pair1.second < cell_pair2.second;
41 unsigned m_last_order_id;
43 double m_displacement;
47 : m_begin(begin), m_last_order_id(0), m_size(0), m_displacement(0), m_weight(0) {
51 void insert_cell(
unsigned order_id,
double x,
double width,
double weight) {
52 m_last_order_id = order_id;
53 m_displacement += weight*(x - m_size);
59 m_last_order_id = cluster.m_last_order_id;
60 m_displacement += cluster.m_displacement - (cluster.m_weight - m_size);
61 m_size += cluster.m_size;
62 m_weight += cluster.m_weight;
73 void align_position(point & position);
75 void place_row(entity_system::entity subrow);
77 void collapse(std::list<cluster> & clusters, std::list<cluster>::iterator cluster_it,
double x_min,
double x_max,
double y);
80 :
legalization(floorplan, placement), m_cells(m_cells_system), m_abacus_subrows(m_subrows_system) {
84 void legalize_placement();
86 void create_subrows();
97 #endif //OPHIDIAN_ABACUS_H
Placement class.
Definition: placement.h:35
entity_system class.
Definition: entity_system.h:40
Definition: legalization.h:32
Floorplan class.
Definition: floorplan.h:37