// file: $isip/class/algo/Spectrum/spec_00.cc
// version: $Id: spec_00.cc 8275 2002-07-02 23:20:05Z picone $
//

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

//---------------------------------------------------------------------------
//
// class-specific public methods:  
//  AlgorithmBase interface contract methods
//
//---------------------------------------------------------------------------

// method: assign
//
// arguments:
//  const AlgorithmBase& arg: (input) object to be assigned
//
// return: a boolean value indicating status
//
// this method assigns the input algorithm object to the current
// Spectrum object
//
boolean Spectrum::assign(const AlgorithmBase& arg_a) {

  // case: input is an Spectrum object
  //
  if (typeid(arg_a) == typeid(Spectrum)) {
    return assign((Spectrum&)arg_a);
  }

  // case: other
  //  if the input algorithm object is not a Spectrum object, return
  //  an error
  //
  else {
    return Error::handle(name(), L"assign", Error::ARG, __FILE__, __LINE__);
  }
}

// method: eq
//
// arguments:
//  const AlgorithmBase& arg: (input) object to be compared
//
// return: a boolean value indicating status
//
// this method checks whether the current Spectrum object is identical
// to the input algorithm object
//
boolean Spectrum::eq(const AlgorithmBase& arg_a) const {

  // case: input is a Spectrum object
  //
  if (typeid(arg_a) == typeid(Spectrum)) {
    return eq((Spectrum&)arg_a);
  }

  // case: other
  //  if the input algorithm object is not a Spectrum object, return
  //  an error
  //
  else {
    return Error::handle(name(), L"eq", Error::ARG, __FILE__, __LINE__);
  }
}

//---------------------------------------------------------------------------
//
// we define non-integral constants in the default constructor
//      
//---------------------------------------------------------------------------

// constants: class name
//
const String Spectrum::CLASS_NAME(L"Spectrum");

// constants: i/o related constants
//
const String Spectrum::DEF_PARAM(L"");
const String Spectrum::PARAM_ALGORITHM(L"algorithm");
const String Spectrum::PARAM_IMPLEMENTATION(L"implementation");
const String Spectrum::PARAM_DYN_RANGE(L"dynamic_range");
const String Spectrum::PARAM_FT(L"ft");

// constants: maximum entropy spectrum scale
//
const Float Spectrum::MAGNITUDE_SCALE(-20);
const ComplexFloat Spectrum::COMPLEX_SCALE(-20);

// constants: NameMap(s) for the enumerated values
//
const NameMap Spectrum::ALGO_MAP(L"FOURIER, MAXIMUM_ENTROPY");
const NameMap Spectrum::IMPL_MAP(L"MAGNITUDE, COMPLEX");

// static instantiations: memory manager and debug level
//
MemoryManager Spectrum::mgr_d(sizeof(Spectrum), Spectrum::name());
