#include <recti/merge_obj.hpp>
template<typename T1 = int, typename T2 = T1>
MergeObj class
Merging Object (for deferred-merge embedding (DME) algorithm)
Template parameters | |
---|---|
T1 | |
T2 |
The code is defining a class template called MergeObj
that represents a merging segment. The merging segment can include a single point, segment, or region. The template has two type parameters T1
and T2
, which default to int
if not specified. The class inherits from the Point
class, which represents a point in a 2D coordinate system. The MergeObj
class provides various operations and functions for manipulating and comparing merging segments, such as adding and subtracting vectors, checking for overlap and intersection with other merging segments, calculating the minimum distance between merging segments, and merging two merging segments. The class also provides comparison operators and a stream insertion operator for convenient usage. The purpose of the MergeObj
class is to support the deferred-merge embedding (DME) algorithm, as referenced in the code comments.
Reference:
- Ting-Hai Chao, Yu-Chin Hsu, Jan-Ming Ho and A. B. Kahng, "Zero skew clock routing with minimum wirelength," in IEEE Transactions on Circuits and Systems II: Analog and Digital Signal Processing, vol. 39, no. 11, pp. 799-814, Nov. 1992, doi: 10.1109/82.204128.
Public static functions
Constructors, destructors, conversion operators
Comparison operators
definie ==, !=, <, >, <=, >=.
-
template<typename U1, typename U2>auto operator==(const MergeObj<U1, U2>& rhs) const -> bool -> auto constexpr
- Equal to.
-
template<typename U1, typename U2>auto operator!=(const MergeObj<U1, U2>& rhs) const -> bool -> auto constexpr
- Not equal to.
-
template<typename U>auto operator+=(const Vector2<U>& rhs) -> MergeObj & -> auto constexpr
- Add a vector (translation)
-
template<typename U>auto operator-=(const Vector2<U>& rhs) -> MergeObj & -> auto constexpr
- Substract a vector (translation)
-
template<typename U1, typename U2>auto overlaps(const MergeObj<U1, U2>& other) const -> bool -> auto constexpr
- overlap
-
template<typename U1, typename U2>auto intersection_with(const MergeObj<U1, U2>& other) const -> auto constexpr
- intersection
-
template<typename U1, typename U2>auto min_dist_with(const MergeObj<U1, U2>& other) const -> auto constexpr
- overlap
-
template<typename U1, typename U2>auto merge_with(const MergeObj<U1, U2>& other) const -> auto constexpr
- overlap
-
template<typename U>auto operator+(MergeObj lhs, const Vector2<U>& rhs) -> MergeObj -> auto constexpr
- Add.
-
template<typename U>auto operator-(MergeObj lhs, const Vector2<U>& rhs) -> MergeObj -> auto constexpr
- Substract.
-
template<typename R>auto enlarge(const MergeObj& lhs, const R& alpha) -> auto constexpr
-
template<class Stream>auto operator<<(Stream& out, const MergeObj& merge_obj) -> Stream & -> auto
Function documentation
template<typename T1, typename T2>
recti:: MergeObj<T1, T2>:: MergeObj(T1&& xcoord,
T2&& ycoord) constexpr noexcept
Construct a new MergeObj object.
Parameters | |
---|---|
xcoord in | x coordinate |
ycoord in | y coordinate |
This code defines a constructor for the MergeObj
class template. The constructor takes two parameters xcoord
and ycoord
, which are of type T1
and T2
respectively. The constructor is marked as constexpr
and noexcept
, indicating that it can be evaluated at compile-time and it does not throw any exceptions.
template<typename T1, typename T2>
template<typename U1, typename U2>
auto recti:: MergeObj<T1, T2>:: operator==(const MergeObj<U1, U2>& rhs) const -> bool constexpr
Equal to.
Template parameters | |
---|---|
U1 | |
U2 | |
Parameters | |
rhs in | |
Returns | true |
template<typename T1, typename T2>
template<typename U1, typename U2>
auto recti:: MergeObj<T1, T2>:: operator!=(const MergeObj<U1, U2>& rhs) const -> bool constexpr
Not equal to.
Template parameters | |
---|---|
U1 | |
U2 | |
Parameters | |
rhs in | |
Returns | true |
template<typename T1, typename T2>
template<typename U>
auto recti:: MergeObj<T1, T2>:: operator+=(const Vector2<U>& rhs) -> MergeObj & constexpr
Add a vector (translation)
Template parameters | |
---|---|
U | |
Parameters | |
rhs in | |
Returns | MergeObj& |
template<typename T1, typename T2>
template<typename U>
auto recti:: MergeObj<T1, T2>:: operator-=(const Vector2<U>& rhs) -> MergeObj & constexpr
Substract a vector (translation)
Template parameters | |
---|---|
U | |
Parameters | |
rhs in | |
Returns | MergeObj& |
template<typename T1, typename T2>
template<typename U1, typename U2>
auto recti:: MergeObj<T1, T2>:: intersection_with(const MergeObj<U1, U2>& other) const constexpr
intersection
Template parameters | |
---|---|
U1 | |
U2 | |
Parameters | |
other in | |
Returns | true |
template<typename T1, typename T2>
template<typename U1, typename U2>
auto recti:: MergeObj<T1, T2>:: min_dist_with(const MergeObj<U1, U2>& other) const constexpr
overlap
Template parameters | |
---|---|
U1 | |
U2 | |
Parameters | |
other in | |
Returns | true |
template<typename T1, typename T2>
template<typename U1, typename U2>
auto recti:: MergeObj<T1, T2>:: merge_with(const MergeObj<U1, U2>& other) const constexpr
overlap
Template parameters | |
---|---|
U1 | |
U2 | |
Parameters | |
other in | |
Returns | true |
template<typename T1, typename T2>
template<class Stream>
auto recti:: MergeObj<T1, T2>:: operator<<(Stream& out,
const MergeObj& merge_obj) -> Stream &
Template parameters | |
---|---|
Stream | |
Parameters | |
out out | |
merge_obj | |
Returns | Stream& |