// file: $isip/class/algo/CoefficientLabel/clab_05.cc
// version: $Id: clab_05.cc 6652 2001-04-11 18:40:02Z duncan $
//

// isip include files
//
#include "CoefficientLabel.h"

// method: apply
//
// arguments:
//  Vector<AlgorithmData>& output: (output) output data
//  const Vector< CircularBuffer<AlgorithmData> >& input: (input) input data
//
// return: a boolean value indicating status
//
// this method calls the appropriate computation methods
//
boolean CoefficientLabel::apply(Vector<AlgorithmData>& output_a,
				const Vector< CircularBuffer<AlgorithmData> >&
				input_a) {

  // determine the number of input channels and force the output to be
  // that number
  //
  long len = input_a.length();
  output_a.setLength(len);
  boolean res = true;
  
  // start the debugging output
  //
  displayStart(this);

  // loop over the channels and call the compute method
  //
  for (long c = 0; c < len; c++) {

    // display the channel number
    //
    displayChannel(c);

    // copy the data
    //
    output_a(c).assign(input_a(c)(0));

    // if the mode is not propagate, set the coef type
    //
    if (coef_type_d != AlgorithmData::PROPAGATE) {
      output_a(c).setCoefType(coef_type_d);
    }

    // possibly display the data
    //
    display(output_a(c), input_a(c)(0), name());
  }

  // finish the debugging output
  //
  displayFinish(this);

  // exit gracefully
  //
  return res;
}
