name: AlgorithmData

synopsis:

g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_algo.a

#include <AlgorithmData.h>

AlgorithmData();
const VectorFloat& getVectorFloat() const;
const MatrixFloat& getMatrixFloat() const;
VectorFloat& makeVectorFloat();
MatrixFloat& makeMatrixFloat();
quick start:

AlgorithmData algd_1;
AlgorithmData algd_2;
algd_1.setDataType(AlgorithmData::VECTOR_FLOAT);
algd_1.setCoefType(AlgorithmData::GENERIC);
algd_1.assign(algd_2);
description:

The AlgorithmData class is simply a container class for data passed by the algorithm classes in this library. This is the lowest-level class in the algorithm library and is used to encapsulate the different data formats one can pass to algorithms. Programmers typically do not interact with AlgorithmData directly.

There are two important abstractions handled by this class: data type and coefficient type. These are represented by DATA_TYPE and COEF_TYPE respectively. Data_type controls the precision of the data structure used in computations. For example, a data type of VECTOR_FLOAT implies a result of a calculation will be generated as a vector of floats (typically, 32-bit floating point numbers). Most robust algorithms can operate safely within a 32-bit float, though some, such as matrix inversion, can occasionally require more precision.

The second abstraction, coefficient type, is a little more subtle. Many algorithms, such as a Fourier Transform, operate on any type of vector data in the same way. However, more complex operations, such as computing the spectrum from a linear predictive model, requires a series of more complicated operations. Further, the specific algorithm to perform these computations depends on the type of the representation (e.g., autocorrelation vs. reflection coefficients vs. predictor coefficients). COEF_TYPE is an enumeration that encapsulates all classes in the Algorithm library that require special consideration when performing such operations. For example, PREDICTION and REFLECTION are used to identify the corresponding type of linear prediction coefficients.

There are several special types: GENERIC, PROPAGATE, SIGNAL, and SPECTRUM. GENERIC are used to tell an algorithm that it can ignore the type of the input. PROPAGATE is used to allow the output type to be automatically set to the input type, no matter what the input is. This is an important functionality needed by isip_transform_builder and isip_transform. SIGNAL is used to denote a sampled data signal - it encapsulates things such as vectors and cepstra. SPECTRUM, similarly, is used to represent a frequency domain representation of a SIGNAL or comparable quantity.

These abstractions exist mainly because they are needed to implement our graph-oriented signal processing tool - isip_transform_builder. This is a data-driven tool in which users implement signal processing systems by drawing block diagrams. In such a system, one needs to have some notion of the type of data that is being generated at each step. We use DATA_TYPE and COEF_TYPE for this purpose.

dependencies:

public constants: error codes:

protected data:

required public methods:

class-specific public methods:

private methods: examples:

notes: