a rectangular region (inside a matrix). More...
#include <util/rect_list.hpp>
a rectangular region (inside a matrix).
Partition definition rectangle. The total partition weight includes elements on boundaries. i.e.
. NOTE: the first element of the matrix is numbered (1,1) not (0,0)
Public Member Functions | |
| rectangle () | |
| rectangle (int xl, int xh, int yl, int yh) | |
| bool | empty () const |
| template<typename Pr > | |
| bool | valid_bound (const Pr &prefixSum) const |
| Check if the boundaries of a given rectangle is inside the matrix. | |
| template<typename T , typename Pr > | |
| T | get_load (const Pr &prefixSum) const |
| computes the load of the rectangle in a prefix sum array. | |
| int | get_area () const |
| computes the area of the rectangle. | |
Public Attributes | |
| int | x_top_l |
| coordinate x - rectangle top left | |
| int | y_top_l |
| coordinate y - rectangle top left | |
| int | x_bot_r |
| coordinate x - rectangle bottom right | |
| int | y_bot_r |
| coordinate y - rectangle bottom right | |
| util::rectangle::rectangle | ( | ) |
| util::rectangle::rectangle | ( | int | xl, | |
| int | xh, | |||
| int | yl, | |||
| int | yh | |||
| ) |
| bool util::rectangle::empty | ( | ) | const |
| int util::rectangle::get_area | ( | ) | const |
computes the area of the rectangle.
computes the load of the rectangle in a prefix sum array.
| prefixSum | is the 2D prefix sum array to use in this rectangle's weight calculation |
. Notice that array refers to the real array not its prefix sum array representation. | bool util::rectangle::valid_bound | ( | const Pr & | prefixSum | ) | const |
Check if the boundaries of a given rectangle is inside the matrix.
| prefixSum | the psa |
coordinate x - rectangle bottom right
coordinate x - rectangle top left
coordinate y - rectangle bottom right
coordinate y - rectangle top left
1.7.1