rasdaman API
dirdecompose.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 /
33 #ifndef _R_DIRDECOMPOSE_HH_
34 #define _R_DIRDECOMPOSE_HH_
35 
36 // Include statements
37 
38 #include <iostream>
39 #include <vector>
40 using std::cout;
41 using std::vector;
42 
43 #include "raslib/error.hh"
44 #include "raslib/sinterval.hh"
45 
46 //@ManMemo: Module {\bf rasodmg}
47 
48 /*@Doc:
49 
50  The {\tt r_Dir_Decompose} class is used to specify a decomposition on
51  an n-dimensional cube (for use in {\tt r_Dir_Tiling}). For instance, to
52  specify a tiling restriction on a dimension with the form: [0, 2, 4, 5],
53  the following code would apply:
54 
55  r_Dir_Decompose decomp;
56 
57  decomp << 0 << 2 << 4 << 5;
58 
59  Note that the first and the last elements input into the object must be
60  the origin and limit of that dimension or else a cross-section of the domain
61  will occur (as if the elements outside the specification wouldn't mind).
62 
63  If one dimension is considered to be a prefered access direction, then
64  the r_Dir_Decompose should be empty, this is, no restriction should be
65  entered.
66 */
67 
72 {
73 public:
74 
76 
77  virtual ~r_Dir_Decompose();
78 
80  r_Dir_Decompose(const r_Dir_Decompose& other);
81 
83  const r_Dir_Decompose& operator=(const r_Dir_Decompose& other);
84 
87 
90 
92  int get_num_intervals() const;
93 
95  r_Range get_partition(int number) const throw (r_Eindex_violation);
96 
98  virtual void print_status(std::ostream& os = cout ) const;
99 
100 protected:
102 
105 
108 
111 
114 };
115 
116 //@ManMemo: Module: {\bf rasodmg}
120 extern std::ostream& operator<<(std::ostream& os, const r_Dir_Decompose& d);
121 extern std::ostream& operator<<(std::ostream& os, const std::vector<r_Dir_Decompose>& vec);
122 
123 #endif
Definition: sinterval.hh:233
static const r_Dimension DEFAULT_INTERVALS
Initial number of intervals of the buffer.
Definition: dirdecompose.hh:104
const r_Dir_Decompose & operator=(const r_Dir_Decompose &other)
Assigment operator.
r_Dimension current_interval
The current interval that is being used for input.
Definition: dirdecompose.hh:110
Definition: dirdecompose.hh:71
int r_Range
Definition: mddtypes.hh:100
virtual void print_status(std::ostream &os=cout) const
Prints the current status of the object.
Definition: error.hh:281
unsigned int r_Dimension
Definition: mddtypes.hh:118
virtual ~r_Dir_Decompose()
int get_num_intervals() const
Gets the number of intervals the dimension is to be split into.
std::ostream & operator<<(std::ostream &os, const r_Dir_Decompose &d)
r_Dir_Decompose & prepend(r_Range limit)
Reads a new limit for the current dimension and prepends it to the list of limits.
r_Sinterval get_total_interval()
r_Range get_partition(int number) const
Gets a restriction.
r_Dir_Decompose & operator<<(r_Range limit)
Reads a new limit for the current dimension.
r_Range * intervals
The buffer that holds the information.
Definition: dirdecompose.hh:113
r_Dimension num_intervals
The number of intervals that this object can currently suport.
Definition: dirdecompose.hh:107