rasdaman client API  10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
r_Interest_Tiling Class Reference

This class implements the "Interesting Areas" tiling algorithm. More...

#include <interesttiling.hh>

Inheritance diagram for r_Interest_Tiling:
r_Dimension_Tiling r_Size_Tiling r_Tiling

Public Types

enum  Tilesize_Limit {
  NO_LIMIT, REGROUP, SUB_TILING, REGROUP_AND_SUBTILING,
  NUMBER
}
 Possible strategies to limit the tilesize. More...
 

Public Member Functions

 r_Interest_Tiling (const char *encoded)
 read everything from an encoded string e.g. More...
 
 r_Interest_Tiling (r_Dimension dim, const std::vector< r_Minterval > &interest_areas, r_Bytes ts=r_Tiling::defaultTileSize, Tilesize_Limit strat=SUB_TILING)
 
virtual ~r_Interest_Tiling ()=default
 It takes as parameter a list containing the areas of interest to the user and also the tilesize to be used. More...
 
std::vector< r_Mintervalcompute_tiles (const r_Minterval &obj_domain, r_Bytes cell_size) const
 Decompose an object in tiles. More...
 
virtual void print_status (std::ostream &os) const
 Prints the current status of the object. More...
 
virtual r_Tilingclone () const
 This method provides the core funcionality of this class. More...
 
virtual r_Tiling_Scheme get_tiling_scheme () const
 This method is similar to a copy constructor, this is, is returns a copy of the current object. More...
 
- Public Member Functions inherited from r_Dimension_Tiling
 r_Dimension_Tiling (r_Dimension dim, r_Bytes ts=r_Tiling::defaultTileSize)
 Constructor for this object (Takes dim (no of dimension) and tile size as parameter) More...
 
virtual ~r_Dimension_Tiling ()=default
 
void print_status (std::ostream &os) const override
 Prints the current status of the object. More...
 
bool is_compatible (const r_Minterval &obj_domain, r_Bytes cellTypeSize) const override
 returns true if the cellTypeSize is smaller or equal to the tile size and the dimension fits the obj_domain More...
 
r_Dimension get_dimension () const
 
- Public Member Functions inherited from r_Size_Tiling
 r_Size_Tiling (const char *encoded)
 Constructor that reads everything from a string e.g."100". More...
 
 r_Size_Tiling (r_Bytes ts=r_Tiling::defaultTileSize)
 
virtual ~r_Size_Tiling ()=default
 
r_Bytes get_tile_size () const
 
r_Tiling_Scheme get_tiling_scheme () const override
 This method is similar to a copy constructor, this is, is returns a copy of the current object. More...
 
- Public Member Functions inherited from r_Tiling
virtual ~r_Tiling ()=default
 

Static Public Member Functions

static r_Interest_Tiling::Tilesize_Limit get_tilesize_limit_from_name (const char *name)
 Get a tilesize limit for a tilisize limit name. More...
 
static const char * get_name_from_tilesize_limit (Tilesize_Limit tsl)
 Get a tilisize limit name for a tilesize limit. More...
 

Static Public Attributes

static const char * description
 
- Static Public Attributes inherited from r_Size_Tiling
static const char * description
 
- Static Public Attributes inherited from r_Tiling
static const char * ASTERIX
 return the type of tiling scheme More...
 
static const char * TCOLON
 
static const char * TCOMMA
 
static const char * LSQRBRA
 
static const char * RSQRBRA
 
static const int DefaultBase
 
static const r_Bytes defaultTileSize
 

Protected Types

enum  Blocks_Type { BLOCKS_A, BLOCKS_B, BLOCKS_C }
 The Block types (A, B or C) More...
 

Protected Member Functions

std::vector< r_Dir_Decomposemake_partition (const r_Minterval &domain) const
 Given a domain and a set of interest areas (internal) gener. partition. More...
 
std::vector< r_Mintervalgroup (std::vector< r_Minterval > &blocks, r_Bytes typelen, Blocks_Type btype) const
 A Blocks —> Blocks that belong to two or more interest zones (non-groupable) B Blocks —> Blocks within the same interest zone (groupable by interest zone) C Blocks —> Blocks outside interest zones (groupable) More...
 
- Protected Member Functions inherited from r_Tiling
void check_nonempty_tiling (const char *encoded) const
 
void check_premature_stream_end (const char *currPos, const char *endPos) const
 
r_Minterval parse_minterval (const char *encoded) const
 
unsigned int parse_unsigned (const char *encoded) const
 
unsigned long parse_unsigned_long (const char *encoded) const
 
long parse_long (const char *encoded) const
 
double parse_double (const char *encoded) const
 
std::unique_ptr< char[]> copy_buffer (const char *buf, size_t len) const
 
const char * advance_to_next_char (const char *p, const char *search) const
 

Protected Attributes

Tilesize_Limit ts_strat
 Parameters: the block list, the lenght of the base cells and the type of the block (A, B or C) More...
 
std::vector< r_Mintervaliareas
 Interest areas. More...
 
- Protected Attributes inherited from r_Dimension_Tiling
r_Dimension dimension {}
 dimension the mdd must have More...
 
- Protected Attributes inherited from r_Size_Tiling
r_Bytes tile_size {}
 Tile size. More...
 

Static Protected Attributes

static const char * tilesizelimit_name_nolimit
 The names of all tilesizelimit types, to avoid redundant storage and inconsistencies. More...
 
static const char * tilesizelimit_name_regroup
 
static const char * tilesizelimit_name_subtiling
 
static const char * tilesizelimit_name_regroupandsubtiling
 
static const char * all_tilesizelimit_names [r_Interest_Tiling::NUMBER]
 

Detailed Description

This class implements the "Interesting Areas" tiling algorithm.

The user specifies which areas are of interest to him and tiling is performed accordingly.

Example of usage: The user says that [10:20, 50:60] and [18:50, 65:70] are of interest to him in the [0:1000, 0:1000] domain. Tiling should be done according to this setting. To specify this with this class the following code would work:

r_Minterval domain(2);
domain << r_Sinterval(0L, 1000L) << r_Sinterval(0L, 1000L);
r_Minteval interest1(2);
interest1 << r_Sinterval(10L, 20L) << r_Sinterval(50L, 60L);
r_Minterval interest2(2);
interest2 << r_Sinterval(18L, 50L) << r_Sinterval(65L, 70L);
std::vector<r_Minterval> interest_areas;
interest_areas.insert_element(interest1);
interest_areas.insert_element(interest2);
r_Interest_Tiling(interest_areas);

Member Enumeration Documentation

◆ Blocks_Type

The Block types (A, B or C)

Enumerator
BLOCKS_A 
BLOCKS_B 
BLOCKS_C 

◆ Tilesize_Limit

Possible strategies to limit the tilesize.

Enumerator
NO_LIMIT 
REGROUP 
SUB_TILING 
REGROUP_AND_SUBTILING 
NUMBER 

Constructor & Destructor Documentation

◆ r_Interest_Tiling() [1/2]

r_Interest_Tiling::r_Interest_Tiling ( const char *  encoded)
explicit

read everything from an encoded string e.g.

"2;[0:9,0:9];[100:109,0:9];100;REGROUPSUBTILING"

◆ r_Interest_Tiling() [2/2]

r_Interest_Tiling::r_Interest_Tiling ( r_Dimension  dim,
const std::vector< r_Minterval > &  interest_areas,
r_Bytes  ts = r_Tiling::defaultTileSize,
Tilesize_Limit  strat = SUB_TILING 
)

◆ ~r_Interest_Tiling()

virtual r_Interest_Tiling::~r_Interest_Tiling ( )
virtualdefault

It takes as parameter a list containing the areas of interest to the user and also the tilesize to be used.

The constructor also takes as parameter the tilesize limitation strategy, that can be the following:

NO_LIMIT: The generated blocks can have any size. REGROUP: Only when performing grouping/merging of blocks, the size of the resulting block of two merges is checked against tilesize. If it's bigger, they are not merged. Blocks larger than tilesize may exist (for instance, if the user specifies an interest area larger then tilesize). SUB_TILING: In this strategie, regrouping is done regardless of the size of the generated blocks. After all the blocks are created, sub-tiling is performed on those whose size is larger than tilesize. REGROUP_AND_SUBTILING: This combines the last two strategies. When merging blocks, blocks larger than tilesize are never created and, when the final blocks are all created, sub-tiling is performed on those whose size is larger then tilesize. An exception is thrown when the dimensions of the domains does not match the specified dimension.

Member Function Documentation

◆ clone()

virtual r_Tiling* r_Interest_Tiling::clone ( ) const
virtual

This method provides the core funcionality of this class.

All derived classes must implement it. As input parameters it takes the big object to be decomposed and returns a set of tiles that compose the big object. This method throws an exeception when the dimension specified, extend or the cell_size are incompatible with the current tiling. You can check compatibility by invoking is_compatible. Clones this object

Implements r_Dimension_Tiling.

◆ compute_tiles()

std::vector<r_Minterval> r_Interest_Tiling::compute_tiles ( const r_Minterval obj_domain,
r_Bytes  cell_size 
) const
virtual

Decompose an object in tiles.

Implements r_Dimension_Tiling.

◆ get_name_from_tilesize_limit()

static const char* r_Interest_Tiling::get_name_from_tilesize_limit ( Tilesize_Limit  tsl)
static

Get a tilisize limit name for a tilesize limit.

◆ get_tilesize_limit_from_name()

static r_Interest_Tiling::Tilesize_Limit r_Interest_Tiling::get_tilesize_limit_from_name ( const char *  name)
static

Get a tilesize limit for a tilisize limit name.

◆ get_tiling_scheme()

virtual r_Tiling_Scheme r_Interest_Tiling::get_tiling_scheme ( ) const
virtual

This method is similar to a copy constructor, this is, is returns a copy of the current object.

Derived classes must explicitly implement this method.

Implements r_Tiling.

◆ group()

std::vector<r_Minterval> r_Interest_Tiling::group ( std::vector< r_Minterval > &  blocks,
r_Bytes  typelen,
Blocks_Type  btype 
) const
protected

A Blocks —> Blocks that belong to two or more interest zones (non-groupable) B Blocks —> Blocks within the same interest zone (groupable by interest zone) C Blocks —> Blocks outside interest zones (groupable)

Merge as many blocks together in a list as possible

◆ make_partition()

std::vector<r_Dir_Decompose> r_Interest_Tiling::make_partition ( const r_Minterval domain) const
protected

Given a domain and a set of interest areas (internal) gener. partition.

◆ print_status()

virtual void r_Interest_Tiling::print_status ( std::ostream &  os) const
virtual

Prints the current status of the object.

Implements r_Tiling.

Member Data Documentation

◆ all_tilesizelimit_names

const char* r_Interest_Tiling::all_tilesizelimit_names[r_Interest_Tiling::NUMBER]
staticprotected

◆ description

const char* r_Interest_Tiling::description
static

◆ iareas

std::vector<r_Minterval> r_Interest_Tiling::iareas
protected

Interest areas.

◆ tilesizelimit_name_nolimit

const char* r_Interest_Tiling::tilesizelimit_name_nolimit
staticprotected

The names of all tilesizelimit types, to avoid redundant storage and inconsistencies.

The variable name convention is the prefix tilisizelimit_name_ followed by the name of the data format in lower case, i.e. for NOLIMIT tilisizelimit_name_nolimit. In addition there's an array of names all_tilesizelimit_names where the tilesize limit can be used as index to get the name.

◆ tilesizelimit_name_regroup

const char* r_Interest_Tiling::tilesizelimit_name_regroup
staticprotected

◆ tilesizelimit_name_regroupandsubtiling

const char* r_Interest_Tiling::tilesizelimit_name_regroupandsubtiling
staticprotected

◆ tilesizelimit_name_subtiling

const char* r_Interest_Tiling::tilesizelimit_name_subtiling
staticprotected

◆ ts_strat

Tilesize_Limit r_Interest_Tiling::ts_strat
protected

Parameters: the block list, the lenght of the base cells and the type of the block (A, B or C)

Tilesize limitation strategie


The documentation for this class was generated from the following file:
r_Interest_Tiling::r_Interest_Tiling
r_Interest_Tiling(const char *encoded)
read everything from an encoded string e.g.
r_Minterval
The spatial domain of an MDD is represented by an object of class r_Minterval.
Definition: minterval.hh:225
r_Sinterval
The class represents an interval with lower and upper bound.
Definition: sinterval.hh:213