Public Types | Public Member Functions | Public Attributes

util::RectList< T, Pr > Class Template Reference

a list of rectangle inside Pr More...

#include <util/rect_list.hpp>


Detailed Description

template<typename T, typename Pr>
class util::RectList< T, Pr >

a list of rectangle inside Pr

Parameters:
Pr type of Prefix Sum Array it applies to
T type of data of the prefix sum array

List of all members.

Public Types

typedef std::vector< rectanglecontainer

Public Member Functions

 RectList (const Pr &ps)
 RectList (const RectList &rlist)
void add_rect (const rectangle &r)
 adds a rectangle into the list
void copy_into (const RectList &rlist)
 Clones a given RectList into this RectList.
void add_into (const RectList &rlist)
 Adds a given RectList into this RectList.
void clear ()
 empties the list
T get_maximum_load () const
 computes the load of the most loaded rectangle.
T get_minimum_load () const
 computes the load of the least loaded rectangle. recall that empty rectangles are never added to the list !
bool valid_part () const
 checks if it is a valid partition of the load matrix.

Public Attributes

container rectangles
const PrprefixSum

Member Typedef Documentation

template<typename T, typename Pr>
typedef std::vector<rectangle> util::RectList< T, Pr >::container

Constructor & Destructor Documentation

template<typename T , typename Pr >
util::RectList< T, Pr >::RectList ( const Pr ps  ) 
template<typename T , typename Pr >
util::RectList< T, Pr >::RectList ( const RectList< T, Pr > &  rlist  ) 

Member Function Documentation

template<typename T , typename Pr >
void util::RectList< T, Pr >::add_into ( const RectList< T, Pr > &  rlist  ) 

Adds a given RectList into this RectList.

Parameters:
rlist Source RectList
template<typename T , typename Pr >
void util::RectList< T, Pr >::add_rect ( const rectangle r  ) 

adds a rectangle into the list

Make partitions with respect to prefix sum if borders are xHigh < xLow or yHigh < yLow it is considered empty not worth to add to rectangle list

Parameters:
r the rectangle to add to the rectangle list
template<typename T , typename Pr >
void util::RectList< T, Pr >::clear (  ) 

empties the list

template<typename T , typename Pr >
void util::RectList< T, Pr >::copy_into ( const RectList< T, Pr > &  rlist  ) 

Clones a given RectList into this RectList.

Parameters:
rlist Source RectList
template<typename T , typename Pr >
T util::RectList< T, Pr >::get_maximum_load (  )  const

computes the load of the most loaded rectangle.

Returns:
the load of the most loaded rectangle
template<typename T , typename Pr >
T util::RectList< T, Pr >::get_minimum_load (  )  const

computes the load of the least loaded rectangle. recall that empty rectangles are never added to the list !

Returns:
the load of the least loaded rectangle
template<typename T , typename Pr >
bool util::RectList< T, Pr >::valid_part (  )  const

checks if it is a valid partition of the load matrix.

The algorithm is : If all the rectangles are inside borders of rect_list; don't collide each other; and cover the whole matrix; then the partitioning is valid.

Returns:
Whether this RectList is a valid partitioning or not

Member Data Documentation

template<typename T, typename Pr>
const Pr& util::RectList< T, Pr >::prefixSum
template<typename T, typename Pr>
container util::RectList< T, Pr >::rectangles

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines