name: CoefficientLabel : public AlgorithmBase
synopsis:

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

>     #include <CoefficientLabel.h>

>     CoefficientLabel();
>     CoefficientLabel(const CoefficientLabel& arg);
>     boolean eq(const CoefficientLabel& arg);
>     boolean setAlgorithm(ALGORITHM algorithm);

quick start:

>     CoefficientLabel lab;
>     String vname(L"MY_DATA");
>     lab.setVariable(vname);

description:
The CoefficientLabel class is not typically used by algorithm programmers. It is used in isip_transform for two purposes: (1) to add a label to a feature stream in a recipe, and (2) to allow coefficient types to be directly changed by manually setting their type. The latter is mainly useful when you want to reference a feature vector in an output file using a standard type name. This class is most often invokved by inserting the CoefficientLabel component in isip_transform into a graph. The available output types are defined in the Algorithm class.
There are two important methods in this class. The setVariable method is used to assign a name, or label, to a feature stream. The setType label is used to assign a type to a feature stream. For example, suppose you invent a new way to compute the frequency response of a signal, and decide to call this feature "FOO" and give it a type of "SPECTRUM". This class is provided so that you have this option by simply invoking the previously mentioned functions.
Though there are currently no alternatives for algorithms and implementations in this class, we support the standard interface for the classes in the algorithm library. Hence, we supply the table below for reference purposes:
See the Algorithm class for a more complete list of the possible output types.
dependencies:

- AlgorithmBase
- MemoryManager

public constants:

- define the class name:

      static const String CLASS_NAME = L"CoefficientLabel";

- define the algorithm choices:

      enum ALGORITHM { DATA = 0, DEF_ALGORITHM = DATA };

- define the implementation choices:

      enum IMPLEMENTATION { COPY = 0, DEF_IMPLEMENTATION = COPY };

- define the type choices:

      enum TYPE { INPUT = 0, OUTPUT, INTERNAL, DEF_TYPE = INTERNAL };

- define the static NameMap objects

      static const NameMap ALGO_MAP(L"DATA");

      static const NameMap IMPL_MAP(L"COPY");

      static const NameMap TYPE_MAP(L"INPUT,OUTPUT,INTERNAL");

- define i/o related constants:

      static const String DEF_PARAM = L"";

      static const String PARAM_ALGORITHM = L"algorithm";

      static const String PARAM_IMPLEMENTATION = L"implementation";

      static const String PARAM_TYPE = L"type";

      static const String PARAM_VARIABLE = L"variable";

      static const String PARAM_COEF_TYPE = L"coef_type";

- define default value(s) of the class data:

      static const AlgorithmData::COEF_TYPE DEF_COEF_TYPE = AlgorithmData::PROPAGATE;

- define default argument(s):

error codes:

- error code indicating CoefficientLabel class general error:

      static const long ERR = 71500;

protected data:

- algorithm name:

      ALGORITHM algorithm_d;

- implementation name:

      IMPLEMENTATION implementation_d;

- variable name:

      String variable_d;

- type:

      TYPE type_d;

- output coefficient type:

      AlgorithmData::COEF_TYPE coef_type_d;

- static memory manager:

      static MemoryManager mgr_d;

required public methods:

- static methods:

      static const String& name();

      static boolean diagnose(Integral::DEBUG debug_level);

- debug methods: setDebug method is inherited from base class

      boolean debug(const unichar* message) const;

- destructor/constructor(s):

      ~CoefficientLabel();

      CoefficientLabel(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, AlgorithmData::COEF_TYPE coef_type = DEF_COEF_TYPE, TYPE type = DEF_TYPE);

      CoefficientLabel(const CoefficientLabel& arg);

- assign methods:

      boolean assign(const CoefficientLabel& arg);

- operator= methods:

      CoefficientLabel& operator= (const CoefficientLabel& arg);

- i/o methods:

      long sofSize() const;

      boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);

      boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;

      boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);

      boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;

- equality methods:

      boolean eq(const CoefficientLabel& arg) const;

- memory management methods:

      static void* operator new(size_t size);

      static void* operator new[](size_t size);

      static void operator delete(void* ptr);

      static void operator delete[](void* ptr);

      static boolean setGrowSize(long grow_size);

      boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);

class-specific public methods:

- set methods:

      boolean setAlgorithm(ALGORITHM algorithm);

      boolean setImplementation(IMPLEMENTATION implementation);

      boolean setVariable(const String& variable);

      boolean setType(TYPE type);

      boolean setCoefType(AlgorithmData::COEF_TYPE ctype);

      boolean set(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, AlgorithmData::COEF_TYPE coef_type = DEF_COEF_TYPE, TYPE type = DEF_TYPE);

- get methods:

      ALGORITHM getAlgorithm() const;

      IMPLEMENTATION getImplementation() const;

      const String& getVariable() const;

      TYPE getType() const;

      AlgorithmData::COEF_TYPE getCoefType() const;

      boolean get(ALGORITHM& algorithm, IMPLEMENTATION& implementation, AlgorithmData::COEF_TYPE& coef_type, TYPE& type) const;

- AlgorithmBase interface contract methods:

      boolean assign(const AlgorithmBase& arg);

      boolean eq(const AlgorithmBase& arg) const;

      const String& className() const;

      boolean apply(Vector<AlgorithmData>& output, const Vector<AlgorithmData>& input);

      boolean setParser(SofParser* parser);

private methods:

- none.

examples:

- none.

notes:

- This class is not used for computation. Its main use is in isip_transform.