Go to Overview over all GrAL packages.
Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

general_indexmap2D Class Reference

Bijection between subsets of and . More...

#include <general-index-map.h>

Collaboration diagram for general_indexmap2D:

Collaboration graph
[legend]
List of all members.

Public Types

typedef int_index_type index_type
typedef general_indexmap2D self

Public Methods

int x0 () const
int xmax () const
int y0 () const
int ymax () const
int n0 () const
int nmax () const
const index_type & ll () const
int llx () const
int lly () const
const index_type & ur () const
int urx () const
int ury () const
bool IsInRange (int x, int y) const
bool IsInRange (const index_type &i) const
bool IsInRange (int i) const
int number (int x, int y) const
int number (const index_type &idx) const
int offset (int x, int y) const
int offset (const index_type ij) const
index_type index (int i) const
void next (index_type &v)
int range_size () const
void pretty_print (std::ostream &out)
void shrink_x_v (int diff, index_type &v1_s, index_type &v2_s) const
void shrink_y_v (int diff, index_type &v1_s, index_type &v2_s) const
self shrinked_map (int diff) const
self shrinked_x_map (int diff) const
self shrinked_y_map (int diff) const
Constructors
 general_indexmap2D (const index_type &V2=index_type(0, 0))
 general_indexmap2D (int urx, int ury)
 general_indexmap2D (const index_type &V1, const index_type &V2, const index_type &Dir)

Detailed Description

Bijection between subsets of and .

This class implements a bijective map between the subset [n0,n0+size-1] of Z and the subset [v1,v2] := [min(v1.x,v2.x), max(v1.x,v2.x)]x[min(v1.y,v2.y), max(v1.y,v2.y)] of ZxZ with given minor direction (varies fastest) :

 (llx,ury)  = v2 (e.g)                     (urx,ury)

          +  n0+(nx*ny)-1                  +  n0+n_minor
          .
          .                                ^
                                           | minor direction
          +  
                                 maj. dir.
          +  n0+(nx*(ny-1)) -1      <-     + n0

 (llx,lly)                                  (urx,lly) = v1 (e.g)

Todo:
Empty ranges cannot be represented (in contrast to xmjr_indexmap2D, where ur < ll indicates an empty range)

Definition at line 38 of file general-index-map.h.


Member Typedef Documentation

typedef int_index_type general_indexmap2D::index_type
 

Definition at line 48 of file general-index-map.h.

typedef general_indexmap2D general_indexmap2D::self
 

Definition at line 49 of file general-index-map.h.

Referenced by shrinked_map, shrinked_x_map, and shrinked_y_map.


Constructor & Destructor Documentation

general_indexmap2D::general_indexmap2D (  const index_type &    V2 = index_type(0,0) )  [inline]
 

Definition at line 61 of file general-index-map.h.

general_indexmap2D::general_indexmap2D (  int    urx,
int    ury
)  [inline]
 

Definition at line 63 of file general-index-map.h.

References urx, and ury.

general_indexmap2D::general_indexmap2D (  const index_type &    V1,
const index_type &    V2,
const index_type &    Dir
)  [inline]
 

Definition at line 66 of file general-index-map.h.


Member Function Documentation

int general_indexmap2D::x0 (    )  const [inline]
 

Definition at line 90 of file general-index-map.h.

References int_index_type::x.

int general_indexmap2D::xmax (    )  const [inline]
 

Definition at line 91 of file general-index-map.h.

References int_index_type::x.

int general_indexmap2D::y0 (    )  const [inline]
 

Definition at line 92 of file general-index-map.h.

References int_index_type::y.

int general_indexmap2D::ymax (    )  const [inline]
 

Definition at line 93 of file general-index-map.h.

References int_index_type::y.

int general_indexmap2D::n0 (    )  const [inline]
 

Definition at line 94 of file general-index-map.h.

Referenced by index, IsInRange, number, offset, and pretty_print.

int general_indexmap2D::nmax (    )  const [inline]
 

Definition at line 95 of file general-index-map.h.

const index_type& general_indexmap2D::ll (    )  const [inline]
 

Definition at line 97 of file general-index-map.h.

Referenced by pretty_print.

int general_indexmap2D::llx (    )  const [inline]
 

Definition at line 98 of file general-index-map.h.

References int_index_type::x.

int general_indexmap2D::lly (    )  const [inline]
 

Definition at line 99 of file general-index-map.h.

References int_index_type::y.

const index_type& general_indexmap2D::ur (    )  const [inline]
 

Definition at line 100 of file general-index-map.h.

Referenced by pretty_print.

int general_indexmap2D::urx (    )  const [inline]
 

Definition at line 101 of file general-index-map.h.

References int_index_type::x.

Referenced by general_indexmap2D.

int general_indexmap2D::ury (    )  const [inline]
 

Definition at line 102 of file general-index-map.h.

References int_index_type::y.

Referenced by general_indexmap2D.

bool general_indexmap2D::IsInRange (  int    x,
int    y
)  const [inline]
 

Definition at line 106 of file general-index-map.h.

References int_index_type::x, and int_index_type::y.

Referenced by index, IsInRange, and number.

bool general_indexmap2D::IsInRange (  const index_type &    i )  const [inline]
 

Definition at line 109 of file general-index-map.h.

References IsInRange, int_index_type::x, and int_index_type::y.

bool general_indexmap2D::IsInRange (  int    i )  const [inline]
 

Definition at line 112 of file general-index-map.h.

References n0, and range_size.

int general_indexmap2D::number (  int    x,
int    y
)  const [inline]
 

Definition at line 116 of file general-index-map.h.

References IsInRange, n0, range, int_index_type::x, and int_index_type::y.

Referenced by number, and offset.

int general_indexmap2D::number (  const index_type &    idx )  const [inline]
 

Definition at line 124 of file general-index-map.h.

References number, int_index_type::x, and int_index_type::y.

int general_indexmap2D::offset (  int    x,
int    y
)  const [inline]
 

Definition at line 125 of file general-index-map.h.

References n0, and number.

int general_indexmap2D::offset (  const index_type    ij )  const [inline]
 

Definition at line 126 of file general-index-map.h.

References n0, and number.

index_type general_indexmap2D::index (  int    i )  const [inline]
 

Definition at line 128 of file general-index-map.h.

References IsInRange, n0, range, and range_size.

void general_indexmap2D::next (  index_type &    v )  [inline]
 

Definition at line 141 of file general-index-map.h.

int general_indexmap2D::range_size (    )  const [inline]
 

Definition at line 148 of file general-index-map.h.

Referenced by index, IsInRange, and pretty_print.

void general_indexmap2D::pretty_print (  std::ostream &    out ) 
 

Definition at line 4 of file general-index-map.C.

References ll, n0, range_size, ur, int_index_type::x, and int_index_type::y.

void general_indexmap2D::shrink_x_v (  int    diff,
index_type &    v1_s,
index_type &    v2_s
)  const [inline]
 

Definition at line 155 of file general-index-map.h.

References int_index_type::x.

Referenced by shrinked_map, and shrinked_x_map.

void general_indexmap2D::shrink_y_v (  int    diff,
index_type &    v1_s,
index_type &    v2_s
)  const [inline]
 

Definition at line 162 of file general-index-map.h.

References int_index_type::y.

Referenced by shrinked_map, and shrinked_y_map.

self general_indexmap2D::shrinked_map (  int    diff )  const [inline]
 

Definition at line 169 of file general-index-map.h.

References self, shrink_x_v, and shrink_y_v.

self general_indexmap2D::shrinked_x_map (  int    diff )  const [inline]
 

Definition at line 176 of file general-index-map.h.

References self, and shrink_x_v.

self general_indexmap2D::shrinked_y_map (  int    diff )  const [inline]
 

Definition at line 181 of file general-index-map.h.

References self, and shrink_y_v.


The documentation for this class was generated from the following files:
Copyright (c) Guntram Berti 1997-2002. See the GrAL Homepage for up-to-date information.

Generated at Tue Feb 26 16:08:16 2002 for GrAL Cartesian2D by doxygen 1.2.11-20011104 written by Dimitri van Heesch, © 1997-2000