8 #ifndef _DATATYPEDEF_H_
9 #define _DATATYPEDEF_H_
196 if(this->
index != NULL)
200 for(
int i=0;
i<dim_sizes.size();
i++){
201 i_size *= dim_sizes[
i];
204 index =
new int[i_size];
207 for(
int i=0;
i<i_size;
i++)
210 for(
int i=0;
i<dim_sizes.size();
i++){
211 this->
sizes.push_back(dim_sizes[
i]);
224 for(
int i=0;
i<vals.size();
i++){
226 if(vals[
i] >=
sizes[
i] || vals[
i] < 0)
230 for(
int m=(
i+1); m<vals.size(); m++){
231 multiplier *=
sizes[m];
234 flat_i += vals[
i] * multiplier;
247 std::vector<int> blank_ret;
251 std::vector<int> ret;
256 for(
int m=(
i+1); m<
sizes.size(); m++){
260 ret.push_back(index / dimsize);
261 index = index % dimsize;
274 if(rLoc.size() !=
sizes.size())
278 return index[flat_i];
288 if(rLoc.size() !=
sizes.size())
292 index[flat_i] = rVal;
std::vector< int > file1_partitions
std::vector< int > translate_index_to_coords(int index)
Translate index to coordinates.
Variable dimension array, an array whose dimensions can be specified at runtime.
Used to store index order information.
Used by cmd parser to store comparison information.
VariableDimensionArray & operator=(const VariableDimensionArray &vda)
Equals operator deep copy.
VariableDimensionArray(const VariableDimensionArray &vda)
Deep copy.
VariableDimensionArray()
Default constructor that initializes values to default.
int * index
Flat storage of values.
Point object that represents a single point.
pnt(const pnt &p)
Deep copy constructor.
~VariableDimensionArray()
Destructor.
int translate_coord_to_index(std::vector< int > vals)
Translate coordinates to the flat index actually used for storage.
void setValue(std::vector< int > rLoc, int rVal)
Set the value at the given coordinates.
Used to store adjustment (normalization factor, conversion factor) information.
pnt & operator=(const pnt &p)
Equals operator, deep copy.
pnt()
Constructor that initializes values to defaults.
int getValue(std::vector< int > rLoc)
Get the value specified by the loc coordinates.
void initArray(std::vector< int > dim_sizes)
Initialize the array with the specified dimensions.