Graphviz 13.0.0~dev.20241222.1117
Loading...
Searching...
No Matches
block.cpp File Reference
#include <algorithm>
#include <cassert>
#include <ostream>
#include <vector>
#include <vpsc/constraint.h>
#include <vpsc/block.h>
#include <vpsc/blocks.h>
#include <fstream>
Include dependency graph for block.cpp:

Go to the source code of this file.

Macros

#define RECTANGLE_OVERLAP_LOGGING   0
 

Functions

static bool gt (const Constraint *const lhs, const Constraint *const rhs)
 > comparator for constraints
 
static void make_heap (std::vector< Constraint * > &heap)
 
static void merge_heaps (std::vector< Constraint * > &heap1, const std::vector< Constraint * > &heap2)
 add all elements from heap2 into the heap heap1
 
static ConstraintfindMin (std::vector< Constraint * > &heap)
 get the minimum heap element
 
static void deleteMin (std::vector< Constraint * > &heap)
 remove the minimum heap element
 
static void insert (std::vector< Constraint * > &heap, Constraint *c)
 add an item to a heap
 
std::ostream & operator<< (std::ostream &os, const Block &b)
 

Macro Definition Documentation

◆ RECTANGLE_OVERLAP_LOGGING

#define RECTANGLE_OVERLAP_LOGGING   0

Definition at line 33 of file block.cpp.

Function Documentation

◆ deleteMin()

static void deleteMin ( std::vector< Constraint * > &  heap)
static

Definition at line 63 of file block.cpp.

References gt().

Referenced by Block::deleteMinInConstraint(), Block::deleteMinOutConstraint(), Block::findMinInConstraint(), and Block::findMinOutConstraint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findMin()

static Constraint * findMin ( std::vector< Constraint * > &  heap)
static

Definition at line 57 of file block.cpp.

References gt().

Referenced by Block::findMinInConstraint(), and Block::findMinOutConstraint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gt()

static bool gt ( const Constraint *const  lhs,
const Constraint *const  rhs 
)
static

Definition at line 37 of file block.cpp.

References compareConstraints().

Referenced by deleteMin(), findMin(), insert(), and make_heap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insert()

static void insert ( std::vector< Constraint * > &  heap,
Constraint c 
)
static

Definition at line 70 of file block.cpp.

References gt().

Here is the call graph for this function:

◆ make_heap()

static void make_heap ( std::vector< Constraint * > &  heap)
static

create a heap within a vector

The standard library’s heap functionality is all structured around creating a max-heap but we want a min-heap. So we flip the comparator we give it.

Definition at line 45 of file block.cpp.

References gt().

Referenced by merge_heaps().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ merge_heaps()

static void merge_heaps ( std::vector< Constraint * > &  heap1,
const std::vector< Constraint * > &  heap2 
)
static

Definition at line 50 of file block.cpp.

References make_heap().

Referenced by Block::mergeIn(), and Block::mergeOut().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const Block b 
)

Definition at line 417 of file block.cpp.