Workspace 6.21.5
|
An interface to an n-dimensional array of a single workspace data type. More...
#include <DataAnalysis/DataStructures/arraynd.h>
Classes | |
class | const_iterator |
class | const_iterator_range |
Represents a pair of iterators that bound a range of data (i.e. the begin and end corners of a multi-dimensional cube of data). More... | |
Public Types | |
typedef NamedDimensionRange::size_type | size_type |
Public Member Functions | |
ArrayNd () | |
~ArrayNd () override | |
virtual bool | arrayAccessHint (const NamedDimensionRangeList &range)=0 |
const_iterator | begin () const |
ArrayNd * | clone () const override=0 |
const_iterator | end () const |
NamedDimensionRangeList | getAllDimensions () const |
virtual const DataCollection & | getAttributes () const =0 |
template<typename T > | |
bool | getData (const NamedDimensionRangeList &range, T *data) const |
virtual const DataExecution::DataFactory * | getDataFactory () const =0 |
NamedDimensionRange | getDimension (const QString &name) const |
virtual int | getDimensionIndex (const QString &name) const =0 |
virtual ArrayNdDimensionLabels | getDimensionLabels (const QString &dimensionName) const =0 |
virtual QString | getDimensionName (int index) const =0 |
virtual size_type | getDimensionSize (const QString &name) const =0 |
virtual size_type | getDimensionSize (int index) const =0 |
virtual double | getFillValue () const =0 |
virtual QVariant | getFillValueAsVariant () const =0 |
template<typename T > | |
ArrayNdTyped< T > * | getTypedInterface () |
template<typename T > | |
const ArrayNdTyped< T > * | getTypedInterface () const |
virtual QVariant | getValue (const DimensionIndexList &dimIndices) const =0 |
virtual QVariant | getValue (size_type dim0, size_type dim1=0, size_type dim2=0, size_type dim3=0, size_type dim4=0) const =0 |
virtual bool | hasFillValue () const =0 |
virtual bool | isDimensionUnlimited (int index) const =0 |
virtual int | numDimensions () const =0 |
virtual double | operator() (const DimensionIndexList &dimIndices) const =0 |
virtual double | operator() (size_type dim0, size_type dim1=0, size_type dim2=0, size_type dim3=0, size_type dim4=0) const =0 |
const_iterator_range | range (const NamedDimensionRangeList &range) const |
virtual bool | setDimensions (const NamedDimensionRangeList &dimensions)=0 |
template<typename T > | |
bool | setFillValue (const T &value) |
virtual void | setHasFillValue (bool b)=0 |
template<typename T > | |
bool | writeData (const NamedDimensionRangeList &range, const T *data) |
Public Member Functions inherited from Clonable | |
virtual | ~Clonable ()=default |
virtual Clonable * | clone () const =0 |
Protected Member Functions | |
ArrayNd (ArrayNd &&other) | |
ArrayNd (const ArrayNd &other) | |
ArrayNd & | operator= (const ArrayNd &other)=default |
The ArrayNd interface allows generic access to a dataset which contains multi-dimensional data of any Workspace data type, and of any number of dimensions. Concrete sub-classes are free to implement the underlying data storage in any way they wish.
size_type is used to represent the indices and ranges of the dimensions in the ArrayNd. We have selected a 64bit integer, as we can expect considerably large datasets. It must be the same type as the NamedDimensionRange.
|
default |
|
overridedefault |
|
pure virtual |
range | The range we are expecting to read from when using the getValue or operator() functions. |
The range we are hinting that we're about to access repeatedly through individual indexed reads (i.e. using the operator() function).
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, ArrayNdSliceTyped< T >, ArrayNdTyped< T >, and ArrayNdTyped< double >.
ArrayNd::const_iterator begin | ( | ) | const |
|
overridepure virtual |
Implements Clonable.
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, ArrayNdSliceTyped< T >, ArrayNdTyped< T >, and ArrayNdTyped< double >.
ArrayNd::const_iterator end | ( | ) | const |
NamedDimensionRangeList getAllDimensions | ( | ) | const |
|
pure virtual |
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, and ArrayNdSliceTyped< T >.
bool getData | ( | const NamedDimensionRangeList & | range, |
T * | data | ||
) | const |
range | The bounded range from which we are reading data. These dimensions must be specified in terms of the sliced dimensions, not the dimensions of the underlying base dataset. |
data | The data store into which we will write the data that we are reading from the dataset. |
Template convenience function for getting data from an ArrayNd set without it being of a concrete type. The function will check whether the factories match before it attempts to add the data.
The data will be copied into the data parameter in column-major order, corresponding to the order of the dimensions in the dataset (the order of the input range is irrelevant). This means that the dimension with the highest index will vary the fastest.
|
pure virtual |
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, and ArrayNdSliceTyped< T >.
NamedDimensionRange getDimension | ( | const QString & | name | ) | const |
|
pure virtual |
name | The name of the dimension for which we wish to rerieve its index. |
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, and ArrayNdSliceTyped< T >.
|
pure virtual |
dimensionName | The name of the dimension for which we wish to retrieve its labels. |
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, and ArrayNdSliceTyped< T >.
|
pure virtual |
index | The index of the dimension for which we wish to retrieve its name. |
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, and ArrayNdSliceTyped< T >.
|
pure virtual |
name | The name of the dimension for which we wish to retrieve its size, i.e. the number of elements in the specified dimension. |
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, and ArrayNdSliceTyped< T >.
|
pure virtual |
index | The index of the dimension for which we wish to retrieve its size, i.e. the number of elements in the specified dimension. |
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, and ArrayNdSliceTyped< T >.
|
pure virtual |
The Fill Value of the dataset is used to indicate an 'empty' cell. Cells that do not contain any valid data, or data outside the known / valid range, will contain the fill value.
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, ArrayNdSliceTyped< T >, ArrayNdTyped< T >, and ArrayNdTyped< double >.
|
pure virtual |
The Fill Value of the dataset is used to indicate an 'empty' cell. Cells that do not contain any valid data, or data outside the known / valid range, will contain the fill value.
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, ArrayNdSliceTyped< T >, ArrayNdTyped< T >, and ArrayNdTyped< double >.
ArrayNdTyped< T > * getTypedInterface |
const ArrayNdTyped< T > * getTypedInterface |
|
pure virtual |
dimIndices | The set of coordinates at which we wish to inspect the value. The coordinate indices are assumed to be in the same order as they are stored in the dataset. |
Retrieve a single value from the underlying dataset using array subscript notation. The number of parameters supplied must match the underlying dataset. It is up to the developer to ensure that this always occurs.
The dimensions must be provided in the same order as they are stored in the dataset. This can be queried using getDimensionIndex() This version of the function returns a QVariant which contains the specific underlying type that matches the dataset.
Implemented in ArrayNdTyped< T >, ArrayNdTyped< double >, and ArrayNdEmpty.
|
pure virtual |
dim0 | The index in the first dimension |
dim1 | The index in the second dimension |
dim2 | The index in the third dimension |
dim3 | The index in the fourth dimension |
dim4 | The index in the fifth dimension |
Retrieve a single value from the underlying dataset using array subscript notation. The number of parameters supplied MUST match the underlying dataset. It is up to the developer to ensure that this always occurs.
The dimensions must be provided in the same order as they are stored in the dataset. This can be queried using getDimensionIndex().
Implemented in ArrayNdTyped< T >, ArrayNdTyped< double >, and ArrayNdEmpty.
|
pure virtual |
The Fill Value of the dataset is used to indicate an 'empty' cell. Cells that do not contain any valid data, or data outside the known / valid range, will contain the fill value. This function returns a value indicating whether or not a fill value is being used.
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, ArrayNdSliceTyped< T >, ArrayNdTyped< T >, and ArrayNdTyped< double >.
|
pure virtual |
index | The index of the dimension we are inspecting. |
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, and ArrayNdSliceTyped< T >.
|
pure virtual |
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, and ArrayNdSliceTyped< T >.
|
pure virtual |
dimIndices | The set of coordinates at which we wish to inspect the value. The coordinate indices are assumed to be in the same order as they are stored in the dataset. |
Retrieve a single value from the underlying dataset using array subscript notation. The number of parameters supplied must match the underlying dataset. It is up to the developer to ensure that this always occurs.
The dimensions must be provided in the same order as they are stored in the dataset. This can be queried using getDimensionIndex()
Implemented in ArrayNdTyped< T >, ArrayNdTyped< double >, and ArrayNdEmpty.
|
pure virtual |
dim0 | The index in the first dimension |
dim1 | The index in the second dimension |
dim2 | The index in the third dimension |
dim3 | The index in the fourth dimension |
dim4 | The index in the fifth dimension |
Retrieve a single value from the underlying dataset using array subscript notation. The number of parameters supplied MUST match the underlying dataset. It is up to the developer to ensure that this always occurs.
The dimensions must be provided in the same order as they are stored in the dataset. This can be queried using getDimensionIndex().
Implemented in ArrayNdTyped< T >, ArrayNdTyped< double >, and ArrayNdEmpty.
ArrayNd::const_iterator_range range | ( | const NamedDimensionRangeList & | range | ) | const |
|
pure virtual |
dimensions | The complete list of dimensions we want the dataset to have. |
Sets the dimensions of the dataset. This will result in the allocation of the underlying data storage. If the dataset previously contained data, this will result in a resize of the dataset, which may require the copying of data, the cost of which will vary greatly depending upon the implementation. For newly created cells in the dataset, a fill-value will be used (by default, this will be a default constructed object).
To avoid expensive copying, it is recommended to only invoke this function on an empty (i.e. uninitialized) dataset.
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, and ArrayNdSliceTyped< T >.
bool setFillValue | ( | const T & | value | ) |
value | The fill value which we are setting. Will be used to populate all new cells when setDimensions() is invoked. |
Template convenience function for setting the fill value on an ArrayNd set without it being of a concrete type. The function will check whether the factories match before it attempts to add the data.
|
pure virtual |
b | Whether or not to use a fill value for this dataset. By default, the fill value will be the default constructed type of the underlying stored data. |
The Fill Value of the dataset is used to indicate an 'empty' cell. Cells that do not contain any valid data, or data outside the known / valid range, will contain the fill value. This function allows the caller to indicate that a fill value is in use in the dataset.
Implemented in ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, ArrayNdSliceTyped< T >, ArrayNdTyped< T >, and ArrayNdTyped< double >.
bool writeData | ( | const NamedDimensionRangeList & | range, |
const T * | data | ||
) |
range | The bounded range to which we are writing the data. These dimensions must be specified in terms of the sliced dimensions, not the dimensions of the underlying base dataset. |
data | The data which we are going to write into the dataset. |
Template convenience function for adding data to an ArrayNd set without it being of a concrete type. The function will check whether the factories match before it attempts to add the data.
The data will be copied into the data parameter in column-major order, corresponding to the order of the dimensions in the dataset (the order of the input range is irrelevant). This means that the dimension with the highest index will vary the fastest.